https://github.com/isapozhnik/loadingviewcontroller
View controller which supports changing of it's content with predefined views: ContentView, LoadingView, ErrorView, NoDataView
https://github.com/isapozhnik/loadingviewcontroller
contentview loading loadingview viewcontroller
Last synced: about 2 months ago
JSON representation
View controller which supports changing of it's content with predefined views: ContentView, LoadingView, ErrorView, NoDataView
- Host: GitHub
- URL: https://github.com/isapozhnik/loadingviewcontroller
- Owner: iSapozhnik
- License: mit
- Created: 2016-06-29T11:50:57.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T12:45:04.000Z (about 8 years ago)
- Last Synced: 2025-03-07T22:18:26.986Z (3 months ago)
- Topics: contentview, loading, loadingview, viewcontroller
- Language: Swift
- Homepage:
- Size: 866 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LoadingViewController
[](https://travis-ci.org/iSapozhnik/LoadingViewController)
[](http://cocoapods.org/pods/LoadingViewController)
[](http://cocoapods.org/pods/LoadingViewController)
[](http://cocoapods.org/pods/LoadingViewController)## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Installation
LoadingViewController is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "LoadingViewController"
```UITableViewController and UICollectionViewController are not supported yet.
## How to use
Subclass your controller from LoadingViewController. On the top of View of your controller put another UIView which will be content view. All your content should be on the top of Content view. Link *_contentView_* property with this newly created view.
```swift
override func viewDidLoad() {
super.viewDidLoad()
setVisibleScreen(.Loading)
APIService.fetchSomeData({ response in
// Update UI
self.setVisibleScreen(.Content)
})
}
```## TODO
* add support of UITableViewController and UICollectionViewController
* implement NoData view, Empty view
* fix autolayout issues
* add pull to refresh and load more features
* code refactoring :)## Author
Sapozhnik Ivan, [email protected]
## License
LoadingViewController is available under the MIT license. See the LICENSE file for more info.