Skip to content

MohammedAlimoor/MHTableView

Repository files navigation

MHTableView

CI Status Version License Platform

Easier way to Control empty States UITableView ,UICollectionview

Requirements

  • Swift 4.0
  • iOS 8.0 or later

Features

  • Extension :) for UITableView , UICollectionview
  • support custom view
  • Please wait or IndicatorView -and more :)

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

MHTableView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MHTableView'

Usage

Only Text

 tableview.showEmpty(text: "Sorry there is no data")

Text & button with callback

tableview.showEmpty(text: "Connection Error", buttonText: "Try") {
    // callback here
}

Text & button & image with callback

tableview.showEmpty(text: "Connection Error", buttonText: "Try", image: #imageLiteral(resourceName: "error.png")) {
// callback here
}

Please wait or IndicatorView

tableview.showEmptyIndicatorView(text: "Loading", showText: true)

custom view

 let  rec =  CGRect(x: 0, y: 0, width: self.bounds.size.width, height: self.bounds.size.height)
       let view = View(frame: rec) // your   custom view
tableview.showEmpty(emptyview: view)

Author

MohammedAlimoor, ameral.java@gmail.com

License

MHTableView is available under the MIT license. See the LICENSE file for more info.