         return false
     }
 }
+
+/// UIView extension
+private extension UIView {
+    
+    func showWithDuration(duration: Double?) {
+        guard let duration = duration else {
+            self.alpha = 1
+            return
+        }
+        
+        self.alpha = 0
+        UIView.animateWithDuration(duration, animations: {
+            self.alpha = 1
+        })
+    }
+}

    
    /// This will remove all views added
    private func resetToPossibleState(completion: ((Bool) -> Void)?){
        UIView.animateWithDuration(dataSource?.hideAnimationDurationForDataRequestView(self) ?? 0, animations: { [unowned self] in ()
            self.loadingView?.alpha = 0
            self.emptyView?.alpha = 0
            self.reloadView?.alpha = 0
        }) { [weak self] (completed) in
            if completed {
                self?.resetViews([self?.loadingView, self?.emptyView, self?.reloadView])

    }
}

/// NSError extension
private extension NSError {
    func isNetworkConnectionError() -> Bool {
        let networkErrors = [NSURLErrorNetworkConnectionLost, NSURLErrorNotConnectedToInternet]
        
