Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

🔸 Swift Rewrite 🔸 #450

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

🔸 Swift Rewrite 🔸 #450

wants to merge 25 commits into from

Conversation

dzenbot
Copy link
Owner

@dzenbot dzenbot commented Jan 1, 2020

I'm working on a new project that requires loads of empty data set, so might as well rewrite this lib in Swift. A rewrite has been long due.

Just putting the PR out there for visibility for now. I need eyes on this code, specially for reviewing and applying good practices. I'm looking to simplify the code as much as possible, while still being easy to read and inviting for contributions.

This rewrite won't be exactly how it was proposed on #174.
This won't be:

  • An Objc-C compatible version
  • Fully backwards compatible. Most APIs will be, but not entirely.
  • Fully featured like the original project. Instead, it will be simple and extendable.

Initial prototype is looking crisp.
image

@dzenbot dzenbot added this to the Version 2 milestone Jan 1, 2020
dzenbot and others added 12 commits January 1, 2020 21:15
* Removes SnapKit from EmptyDataSet

* Removes weak self from UIKit animation block as it's not required
…456)

* Removes SnapKit from EmptyDataSet

* Removes weak self from UIKit animation block as it's not required

* Adds early exit to isEmpty function to prevent unnecessary calculation

* Removes SnapKit from Bento
Copy link

@eytanschulman eytanschulman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion this Swift rewrite is almost ready, with some slight changes, but in a separate project, maybe DZNEmptyDataSet-Swift as it does not have full feature parity with DZNEmptyDataSet, like you noted. I think this could totally be released as a simple Swift Package, and people could start using it 😄

}
}

extension ViewController: EmptyDataSetSource {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not conform to protocol EmptyDataSetSource, needs to implement:

imageTintColor(forEmptyDataSet scrollView: UIScrollView)


protocol EmptyDataSetProtocol {
func swizzle() -> Bool
func isEmpty() -> Bool

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method isEmpty() doesn't seem to be used anywhere, only implemented. Is this intended?


public var isEmptyDataSetVisible: Bool {
// guard let view = emptyDataSetView else { return false }
// return !view.isHidden

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the default implementation (returning true) then this should be removed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants