Git Product home page Git Product logo

emptykit's People

Contributors

archerzzboy avatar omiz avatar zionchang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

emptykit's Issues

Code refactoring

This issue is to solve your requirement, and I'm thinking code refactoring, so is there any suggestion about how to make EmptyKit better. Thanks!

3.0.3 broke tableView.reloadData()

In the most recent version of EmptyKit, the empty view does not remove when reloading tableview with function tableView.reloadData(). Also forcing the update by tableView.ept.reloadData() still keeps the empty view. When the viewController is viewed again, this is solved.

This also happens in the demo project. Running on simulator and iOS 10. (Version 10.0 (SimulatorApp-726.7
simulator screen shot jan 10 2017 01 57 42
)

Nothing displayed when number or rows == 0

Hi,

my problem is, that the tableview does not show the empty view.
In the UI debugger i got the following information:

"height and vertical position are ambiguous for UIView"

This info is for the UIView of the EmptyKit.EmptyView.

In a another TableView everything works as expected.

Vertical alignment does not take into account tableheaderview

When adding a tableheaderview, the empty view is not aligned correctly, the image is overlapping the tableheaderview. Is this an issue or should this be adjusted using offset?

To reproduce in the example project:

override func viewDidLoad() { super.viewDidLoad() tableView.tableFooterView = UIView() tableView.tableHeaderView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: 300, height: 150)) tableView.tableHeaderView?.backgroundColor = UIColor.black setupEmpty() }

simulator screen shot jan 16 2017 09 02 12

When uses custom view...

[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x600000284060 UIView:0x7fab1b4063a0.centerY == EmptyKit.EmptyView:0x7fab1b40a520.centerY - 44 (active)>",
"<NSLayoutConstraint:0x600000283c00 V:|-(0)-[UIView:0x7fab1b4063a0] (active, names: '|':EmptyKit.EmptyView:0x7fab1b40a520 )>",
"<NSLayoutConstraint:0x600000284380 V:[UIView:0x7fab1b4063a0]-(0)-| (active, names: '|':EmptyKit.EmptyView:0x7fab1b40a520 )>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600000284060 UIView:0x7fab1b4063a0.centerY == EmptyKit.EmptyView:0x7fab1b40a520.centerY - 44 (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

Why use weak

weak var dataSource: EmptyDataSource? {
get {
return objc_getAssociatedObject(base, &datasourceKey) as? EmptyDataSource
}
set {
UITableView.swizzleIfNeeded
UICollectionView.swizzleIfNeeded
objc_setAssociatedObject(base, &datasourceKey, newValue, .OBJC_ASSOCIATION_ASSIGN)
}
}

AutoreleasingUnsafeMutablePointer

Cannot convert value of type 'AutoreleasingUnsafeMutablePointer' (aka 'AutoreleasingUnsafeMutablePointer<AnyObject.Type>') to expected argument type 'AutoreleasingUnsafeMutablePointer<AnyClass?>!' (aka 'ImplicitlyUnwrappedOptional<AutoreleasingUnsafeMutablePointer<Optional<AnyObject.Type>>>')

failed when compiling swizzle.swift , installed manually

/Users/foolbear/Jobs/Reading/Reading/Utilities/EmptyKit/Swizzle.swift:30:11: error: use of undeclared type 'UIApplication'
extension UIApplication {
^~~~~~~~~~~~~
/Users/foolbear/Jobs/Reading/Reading/Utilities/EmptyKit/Swizzle.swift:44:11: error: use of undeclared type 'UITableView'
extension UITableView: SelfAware {
^~~~~~~~~~~
/Users/foolbear/Jobs/Reading/Reading/Utilities/EmptyKit/Swizzle.swift:52:11: error: use of undeclared type 'UICollectionView'
extension UICollectionView: SelfAware {
^~~~~~~~~~~~~~~~
/Users/foolbear/Jobs/Reading/Reading/Utilities/EmptyKit/Swizzle.swift:36:29: error: use of undeclared type 'UIResponder'
override open var next: UIResponder? {
^~~~~~~~~~~
/Users/foolbear/Jobs/Reading/Reading/Utilities/EmptyKit/Swizzle.swift:36:23: error: property does not override any property from its superclass
override open var next: UIResponder? {
~~~~~~~~ ^
/Users/foolbear/Jobs/Reading/Reading/Utilities/EmptyKit/Swizzle.swift:36:29: error: use of undeclared type 'UIResponder'
override open var next: UIResponder? {
^~~~~~~~~~~
/Users/foolbear/Jobs/Reading/Reading/Utilities/EmptyKit/Swizzle.swift:36:14: error: only classes and overridable class members can be declared 'open'; use 'public'
override open var next: UIResponder? {
^~~~
public
/Users/foolbear/Jobs/Reading/Reading/Utilities/EmptyKit/Swizzle.swift:38:9: error: use of unresolved identifier 'UIApplication'
UIApplication.runOnce
^~~~~~~~~~~~~
/Users/foolbear/Jobs/Reading/Reading/Utilities/EmptyKit/Swizzle.swift:47:9: error: use of unresolved identifier 'UITableView'
UITableView.swizzleIfNeeded
^~~~~~~~~~~
/Users/foolbear/Jobs/Reading/Reading/Utilities/EmptyKit/Swizzle.swift:55:9: error: use of unresolved identifier 'UICollectionView'
UICollectionView.swizzleIfNeeded
^~~~~~~~~~~~~~~~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.