Closed crenwick closed 8 years ago
Inside that nested view controller, I can present the SparkSetup on the root controller like so:
if let vc = SparkSetupMainController() {
vc.delegate = self
UIApplication.sharedApplication().keyWindow!.rootViewController?.dismissViewControllerAnimated(false, completion: { () -> Void in
UIApplication.sharedApplication().keyWindow!.rootViewController?.presentViewController(vc, animated: true, completion: nil)
})
}
This is obviously not the desired behavior I want, as now I need to handle the strange animation of dismissing and presenting two view controllers at the same time, and I also have to handle the logic to bring back the desired (nested) view controller when the SparkSetup completes.
I'm sure this will also cause issues when the SparkSetup dismisses, as the nested view controller is the SparkSetupMainControllerDelegate
and not the root view controller.
What do you mean works well only on root viewcontroller? You can take the Particle app (Tinker) as an example - it pops up a Setup 'wizard' modal flow which is not on the root VC without any issues. Maybe take a look on that repo as a reference. https://github.com/spark/photon-tinker-ios
Hmmm. I cloned this fork of the example app and was able to get view controllers working without the crashing bug.
I'll try to dig around more and figure out why this is happening with my app.
Great, happy to hear. I'm closing this issue for now, feel free to re-open if necessary or post in our community website if more help is needed https://community.particle.io/c/mobile
Launching the spark setup via:
works fine on the root controller, but when I try to make this action happen on a nested view controller (but still the controller in view), it not only crashes the app but causes the entire phone to restart--losing connection with xcode and making it difficult to debug.
So far, it seems to get to get all the way through the viewDidLoad method before crashing.