View when internet connection is unavailable.
Rashesh-Bosamiya opened this issue · comments
Rashesh Bosamiya commented
I want to show a view when internet connection not available.
How do I achieve? I am using Alamofire for network API call.
Rowin Shahi commented
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
Ok, Thanks
Rashesh Bosamiya commented
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?