ios - How to restart an app when resumes from multi-tasking -
so app relies on internet connection , every time app opened home screen checks using reachability , allows user continue or tells them connected. issue when app resumed multitasking, skips initial view controller , goes straight were. there way in swift app refresh or restart when resumed multi-tasking?
thanks
edit when using code:
let storyboard = uistoryboard(name: "mainstoryboard", bundle: nil) self.window.rootviewcontroller = mainstoryboard.instantiateinitialviewcontroller()
i expected declaration error.
you can set root view controller , restart main vc. assuming using storyboard:
(self referring appdelegate)
swift:
let storyboard = uistoryboard(name: "mystoryboardname", bundle: nil) self.window.rootviewcontroller = storyboard.instantiateinitialviewcontroller()
objective-c:
self.window.rootviewcontroller = [[uistoryboard storyboardwithname:@"mystoryboardname" bundle:nil] instantiateinitialviewcontroller];
Comments
Post a Comment