All Projects → luispadron → Uiemptystate

luispadron / Uiemptystate

Licence: mit
An empty state control to give visually appealing context when building iOS applications.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Uiemptystate

Airbyte
Airbyte is an open-source EL(T) platform that helps you replicate your data in your warehouses, lakes and databases.
Stars: ✭ 4,919 (+2679.1%)
Mutual labels:  data
Files
A nicer way to handle files & folders in Swift
Stars: ✭ 2,189 (+1136.72%)
Mutual labels:  xcode
Databay
Databay is a Python interface for scheduled data transfer. It facilitates transfer of (any) data from A to B, on a scheduled interval.
Stars: ✭ 175 (-1.13%)
Mutual labels:  data
Onyx
Distributed, masterless, high performance, fault tolerant data processing
Stars: ✭ 2,019 (+1040.68%)
Mutual labels:  data
Lfai Landscape
🌄 Open Source AI Landscape - provides overview of top tier projects in the open source AI ecosystem, shows projects through GitHub data, funding or market cap, first and last commits, contributor count and much other information.
Stars: ✭ 172 (-2.82%)
Mutual labels:  data
Countrypicker
A simple, customizable Country picker for picking country or dialing code. 🇮🇳 🇯🇵 🇰🇷 🇩🇪 🇨🇳 🇺🇸 🇫🇷 🇪🇸 🇮🇹 🇷🇺 🇬🇧
Stars: ✭ 174 (-1.69%)
Mutual labels:  xcode
Assetchecker
👮Sanitize your Assets.xcassets files
Stars: ✭ 167 (-5.65%)
Mutual labels:  xcode
Fake2db
Generate fake but valid data filled databases for test purposes using most popular patterns(AFAIK). Current support is sqlite, mysql, postgresql, mongodb, redis, couchdb.
Stars: ✭ 2,113 (+1093.79%)
Mutual labels:  data
Irldocumentscanner
A drop-in Objective-C ViewController that will Automatically scan a document for you you.
Stars: ✭ 172 (-2.82%)
Mutual labels:  xcode
Grafter
Linked Data & RDF Manufacturing Tools in Clojure
Stars: ✭ 174 (-1.69%)
Mutual labels:  data
Exportsheetdata
Add-on for Google Sheets that allows sheets to be exported as JSON or XML.
Stars: ✭ 170 (-3.95%)
Mutual labels:  data
General Store
Simple, flexible store implementation for Flux. #hubspot-open-source
Stars: ✭ 171 (-3.39%)
Mutual labels:  data
Xcodeplugintool
🎧a easy way use plugins after Xcode upgraded
Stars: ✭ 174 (-1.69%)
Mutual labels:  xcode
Tiercel
简单易用、功能丰富的纯 Swift 下载框架
Stars: ✭ 2,241 (+1166.1%)
Mutual labels:  xcode
Ncov2019 data crawler
疫情数据爬虫,2019新型冠状病毒数据仓库,轨迹数据,同乘数据,报道
Stars: ✭ 175 (-1.13%)
Mutual labels:  data
Covid 19 Uk Data
Coronavirus (COVID-19) UK Historical Data
Stars: ✭ 169 (-4.52%)
Mutual labels:  data
Codeexamples
Code Examples
Stars: ✭ 2,089 (+1080.23%)
Mutual labels:  xcode
Nessie
Nessie provides Git-like capabilities for your Data Lake
Stars: ✭ 176 (-0.56%)
Mutual labels:  data
Openintro
📦 R package for data and supplemental functions for OpenIntro resources
Stars: ✭ 176 (-0.56%)
Mutual labels:  data
Everypolitician Data
data for national legislatures worldwide
Stars: ✭ 174 (-1.69%)
Mutual labels:  data

banner

Requirements

  • Xcode 9.0 +
  • iOS 9.0 or greater

Installation

CocoaPods

  1. Install CocoaPods
  2. Add this repo to your Podfile
target 'Example' do
  use_frameworks!
	
  pod 'UIEmptyState'
end
  1. Run pod install
  2. Open up the new .xcworkspace that CocoaPods generated
  3. Whenever you want to use the library: import UIEmptyState

Carthage

  1. Make sure Carthage is install

    brew install carthage

  2. Add this repo to your Cartfile

    github "luispadron/UIEmptyState"

Manually

  1. Simply download the UIEmptyState source files and import them into your project.

Usage

As long as you are using a UIViewController subclass you will get default conformance as well as the reloadEmptyState method.

// No subclassing required, simply conform to the two protocols
class ViewController: UITableViewController, UIEmptyStateDataSource, UIEmptyStateDelegate {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Set the data source and delegate
        self.emptyStateDataSource = self
        self.emptyStateDelegate = self
        // Optionally remove seperator lines from empty cells
        self.tableView.tableFooterView = UIView(frame: CGRect.zero)
   }
   
   override func viewDidAppear(_ animated: Bool) {
   	super.viewDidAppear(animated)
	// Set the initial state of the tableview, called here because cells should be done loading by now
	// Number of cells are used to determine if the view should be shown or not
	self.reloadEmptyState()
   }
}

Whenever you need to reload the empty state view for example, on data changes to your table view source, make sure to call self.reloadEmptyState() if inside a UITableViewController or UICollectionViewController. If inside a regular UIViewController make sure to call the appropriate reloadEmptyStateForTableView(_:) or reloadEmptyStateForCollectionView(_:) methods.

Example:

// Inside a UITableViewController subclass

func foo() {
	// My data has changed here, I want to my tableview, 
	// and in case I no longer have data (user deleted, etc) also reload empty view
	self.tableView.reloadData()
	// Reload empty view as well
	self.reloadEmptyState()
}

func deleteFoo() {
	// This works too, just call after end updates
	tableView.beginUpdates()
	fooSource.remove(at: indexPath.row)
	tableView.deleteRows(at: [indexPath], with: .automatic)
	tableView.endUpdates()
	// Call reload of empty state 
	self.reloadEmptyState()
}

If you need more help take a look at the example project here (Pokemon nerds, will like it): Example

Documentation

Read the full documentation here

Example Project

  1. Clone this repo
  2. Change directory into Example
  3. Run pod install

License (MIT)

Copyright (c) 2017 Luis Padron

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].