CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2019-01-09
by Parth Patel

Original Post

Original - Posted on 2019-01-09
by Parth Patel



            
Present in both answers; Present only in the new answer; Present only in the old answer;

I find one solution to this issue if you using Alamofire.
First import Alamofire in your common class otherwise you can create a separate class for check internet connection.
> import Alamofire
class Connectivity { class func isConnectedToInternet() ->Bool { return NetworkReachabilityManager()!.isReachable } }
Call below method before you API call
if !Connectivity.isConnectedToInternet() { ServiceHandler.ShowAlert(message: "Check your internet connectivity.", title: "Error", parentView: self) //This is my comman method for display alert. return }
I find one solution to this issue if you using Alamofire.
First import Alamofire in your common class otherwise you can create a separate class for check internet connection.
> import Alamofire
class Connectivity { class func isConnectedToInternet() ->Bool { return NetworkReachabilityManager()!.isReachable } }
Call below method before you API call
if !Connectivity.isConnectedToInternet() { ServiceHandler.ShowAlert(message: "Check your internet connectivity.", title: "Error", parentView: self) //This is my comman method for display alert. return }

        
Present in both answers; Present only in the new answer; Present only in the old answer;