aschuch / StatefulViewController

Placeholder views based on content, loading, error or empty states
MIT License
2.14k stars 149 forks source link

View when internet connection is unavailable. #38

Closed Rashesh-Bosamiya closed 7 years ago

Rashesh-Bosamiya commented 7 years ago

I want to show a view when internet connection not available.

How do I achieve? I am using Alamofire for network API call.

rowinShahi commented 7 years ago

Alamofire.request("https://httpbin.org/get").responseJSON { response in if let error = response.result.value.error { endLoading(error: error) }else{ endLoading(error: nil) } }

Rashesh-Bosamiya commented 7 years ago

Ok, Thanks

Rashesh-Bosamiya commented 7 years ago

A logical help.

Actually, I have a common function for API calling. So, I want to display error view from central function. To the viewController where the request came.

Is it possible?