i have one app which contains many map view. And i need to check internet connect is true or false. If false one uialert message will show and uiactivity Indicator
will show ( will start).... its working fine..
But when i suddenly connect the internet , that uiactivity indicator in not stoping. Still getting run.
Here my code:
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
ActiviyuInc.hidden = true
showmethod()
}
func showmethod () {
if Reachability.isConnectedToNetwork() == false {
print("Internet connection FAILED")
let alert = UIAlertView(title: "No Internet Connection", message: "Make sure your device is connected to the internet.", delegate: nil, cancelButtonTitle: "OK")
alert.show()
if Reachability.isConnectedToNetwork() == false {
ActiviyuInc.hidden = false
ActiviyuInc.startAnimating()
}
else {
ActiviyuInc.hidden = true
ActiviyuInc.stopAnimating()
}
}
}
When my app in run, that time when i connect to internet , still my uiactivityIndicator
is not stoping..
Help me out !!!