ALDataRequestView 2.3.2

ALDataRequestView 2.3.2

LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Antoine v.d. Lee, Jeroen Bakker.


A simple way to show:

  • Loading view while a producer or observable is started
  • Reload view when a producer or observable is failed
  • Empty view when a producer or observable returns an empty array or an object which inherits the Emptyable protocol and isEmpty is true


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

ReactiveSwift & RxSwift

Simply call

attachTo(dataRequestView: dataRequestView)

on your signalProducer or observable.

Make sure you implement the ALDataRequestViewDataSource:

func loadingView(for dataRequestView: ALDataRequestView) -> UIView?
func reloadViewController(for dataRequestView: ALDataRequestView) -> ALDataReloadType?
func emptyView(for dataRequestView: ALDataRequestView) -> UIView?


let request = URLRequest(url: URL(string: "")!)
rxDisposable = request).attachToDataRequestView(dataRequestView: dataRequestView!).subscribe()
let request = URLRequest(url: URL(string: "")!)
dataSignalProducer = URLSession.shared request)
    .flatMap(.latest, transform: { (data, response) -> SignalProducer<Data, NSError> in
        if let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode > 299 {
            return SignalProducer(error: NSError(domain: "", code: httpResponse.statusCode, userInfo: nil))
        return SignalProducer(value: data)
    .attachTo(dataRequestView: dataRequestView!)


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

pod "ALDataRequestView"

Swift version vs Pod version

Swift version Pod version
3.X >= 2.0.0
2.3 1.0.4


Antoine van der Lee, [email protected]


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