GithubHelp home page GithubHelp logo

carabina / ssplaceholdertableview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simformsolutionspvtltd/ssplaceholdertableview

0.0 1.0 0.0 280 KB

License: MIT License

Ruby 11.01% Swift 88.99%

ssplaceholdertableview's Introduction

SSPlaceHolderTableView

This is simple, customised and easy state wise PlaceHolder for TableView and CollectionView.

Version License Platform Swift Version PRs Welcome

Requirements

  • iOS 11.0+
  • Xcode 10.0+

Installation

SSPlaceHolderTableView doesn't contain any external dependencies.

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

pod 'SSPlaceHolderTableView'

Usage example

Set UITableView to TableView

alt text

Set UICollectionView to CollectionView

alt text

Set TableView State to Use Placeholder TableView

Usage example

NetworkUnReachableBlock

  • If you want to use inbuild Rechability for api call, You can simply add your api call inside this networkUnReachableBlock.

  • Put this code in viewDidLoad

      tblView.networkUnReachableBlock = {
      // put your API Call here.
      }
    

Loading State

  • You can put this state before your API call or data collectng method.

  • Customisation: In loadingImg param You can pass your custom image and in loadingLabelTitle you can pass your custom attributed string.

      tblView.setState(.loading(loadingImg: nil, loadingLabelTitle: nil))
    

Data Available State

  • When your data successfully available simply put this line in your code.

      tblView.setState(.dataAvailable(viewController: self))
    

Data UnAvailable State

  • When your data not available simply put this line in your code.

  • Customisation: In noDataImg param You can pass your custom image for no data and in noDataLabelTitle you can pass your custom attributed string.

      tblView.setState(.noDataAvailable(noDataImg: nil, noDataLabelTitle: nil))
    

No Internet available State

  • When Internet is not available put this line.

  • Customisation: In noInternetImg param You can pass your custom image for no internet state and in noInternetLabelTitle you can pass your custom attributed string.

      tblView.setState(.checkInternetAvaibility(noInternetImg: nil, noInternetLabelTitle: nil))
    

NOTE

  • If you want to use this in UICollectionView Simply replace your collectionView object with tblView in above codes.

Contribute

We would love you for the contribution to SSPlaceHolderTableView, check the LICENSE file for more info.

License

SSPlaceHolderTableView is Distributed under the MIT license. See LICENSE for more information..

ssplaceholdertableview's People

Contributors

vishalpatel-simformsolutions avatar simform-solutions avatar

Watchers

Carabineiro avatar

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.