Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Xin Hong committed Jan 12, 2016
1 parent 8bf465c commit 9a632fe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
#TBEmptyDataSet
TBEmptyDataSet is an extension of UITableView/UICollectionView's super class, it will display a placeholder emptyDataSet when the data of tableView/collectionView is empty.

TBEmptyDataSet can be composed of an image, a title and a description like this:
TBEmptyDataSet can be composed of an image, a title and a description, or you can set it as a custom view.

![Screenshot](Screenshots/Empty Photos.png)

![Screenshot](Screenshots/Empty Events.png)
![Example](Screenshots/Example.gif "Example")

![Screenshot](Screenshots/Empty Message.png)

You can also set it as a custom view, such as a loading view:

![Screenshot](Screenshots/Custom Loading.png)

##How To Get Started
###Carthage
Specify "TBEmptyDataSet" in your Cartfile:
```ogdl
github "teambition/TBEmptyDataSet"
```

###Usage
##### 1. Assign the data source and delegate
Expand All @@ -25,69 +24,69 @@ tableView.emptyDataSetDelegate = self
Data source functions:
```swift
func imageForEmptyDataSet(scrollView: UIScrollView!) -> UIImage? {
// return the image for EmptyDataSet
// return the image for EmptyDataSet
}

func titleForEmptyDataSet(scrollView: UIScrollView!) -> NSAttributedString? {
// return the title for EmptyDataSet
// return the title for EmptyDataSet
}

func descriptionForEmptyDataSet(scrollView: UIScrollView!) -> NSAttributedString? {
// return the description for EmptyDataSet
// return the description for EmptyDataSet
}

func imageTintColorForEmptyDataSet(scrollView: UIScrollView!) -> UIColor? {
// return the image tint color for EmptyDataSet
// return the image tint color for EmptyDataSet
}

func backgroundColorForEmptyDataSet(scrollView: UIScrollView!) -> UIColor? {
// return the backgroundColor for EmptyDataSet
// return the backgroundColor for EmptyDataSet
}

func verticalOffsetForEmptyDataSet(scrollView: UIScrollView!) -> CGFloat {
// return the vertical offset for EmptyDataSet
// return the vertical offset for EmptyDataSet, default is 0
}

func verticalSpaceForEmptyDataSet(scrollView: UIScrollView!) -> CGFloat {
// return the vertical space for EmptyDataSet
// return the vertical space for EmptyDataSet, default is 12
}

func customViewForEmptyDataSet(scrollView: UIScrollView!) -> UIView? {
// return an optional UIView instance for EmptyDataSet
// return an UIView instance for EmptyDataSet
}
```
Delegate functions:
```swift
func emptyDataSetShouldDisplay(scrollView: UIScrollView!) -> Bool {
// should display EmptyDataSet or not
// should display EmptyDataSet or not, default is true
}

func emptyDataSetTapEnabled(scrollView: UIScrollView!) -> Bool {
// enable tap gesture or not
// enable tap gesture or not, default is true
}

func emptyDataSetScrollEnabled(scrollView: UIScrollView!) -> Bool {
// scrollView can scroll or not
// scrollView can scroll or not, default is false
}

func emptyDataSetDidTapView(scrollView: UIScrollView!) {
// do something
// do something
}

func emptyDataSetWillAppear(scrollView: UIScrollView!) {
// do something
// do something
}

func emptyDataSetDidAppear(scrollView: UIScrollView!) {
// do something
// do something
}

func emptyDataSetWillDisappear(scrollView: UIScrollView!) {
// do something
// do something
}

func emptyDataSetDidDisappear(scrollView: UIScrollView!) {
// do something
// do something
}
```

Expand Down
Binary file added Screenshots/Example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9a632fe

Please sign in to comment.