Skip to content

Instantly share code, notes, and snippets.

@piotrbernad
Created September 27, 2017 18:19
Show Gist options
  • Save piotrbernad/45a0cf50d2f10989262de102ba677d84 to your computer and use it in GitHub Desktop.
Save piotrbernad/45a0cf50d2f10989262de102ba677d84 to your computer and use it in GitHub Desktop.
EmptyDataSetSource Example
extension PostsTableViewController: DZNEmptyDataSetSource {
func title(forEmptyDataSet scrollView: UIScrollView!) -> NSAttributedString! {
switch self.state {
case .loading:
return NSAttributedString(string: NSLocalizedString("Loading...", comment: ""))
case .refreshing:
return NSAttributedString(string: NSLocalizedString("Refreshing", comment: ""))
case .error:
return NSAttributedString(string: NSLocalizedString("Error", comment: ""))
default:
return NSAttributedString(string: "")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment