aschuch / StatefulViewController

Placeholder views based on content, loading, error or empty states

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

View when internet connection is unavailable.

Rashesh-Bosamiya opened this issue · comments

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

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

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

Ok, Thanks

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?