To run the example project, clone the repo, and run pod install
from the Example directory first.
Xcode 10 or later Mac OS X Mojave
ZainFramework is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ZainFramework'
Handling an empty UITableView. Print a friendly message.
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if numberOfItems == 0{
tableView.setEmptyMessage("We could not found any posts")
}
return numberOfItems.count
}
TableView Loading Extention
\\Use anywhere you want in tableview
\\this loading is a refreshControl so no need to write all the old code :)
tableView.beginRefreshing()
tableView.endRefreshing()
let urlString = "https://www.google.com/"
ImageView.cacheImage(urlString: urlString)
\\you can change the url and enjoy
\\Activity Indicator Extention
\\Use inside of a ViewController function
self.startActivityIndicator()
self.stopActivityIndicator()
self.showAlert(text: "Replace Text here")
self.showLoadingAlert(text: "Replace Text here")
\\a bit tricky extention but if you get it your code will be a lot easier
\\modern code
let viewController = StandardVC.instantiate() \\Class name must be same in
pushVC(viewController)
\\old code
let viewController = storyboard?.instantiateViewController(withIdentifier: "StandardVC")
self.navigationController?.pushViewController(viewController, animated: true)
\\new code
self.dismissVC()
\\old code
self.navigationController?.dismiss(animated: true, completion: nil)
zainanjum100, [email protected]
ZainFramework is available under the MIT license. See the LICENSE file for more info.