I created an iOS app that has 3 Sphero enabled flows. I ended up rewriting setupRobotConnection and handleRobot online in each viewDidLoad then closing the connection in each prepareForSegue method. It works for the most part but the NavigationController's Back button can screw things up. I'm thinking this isn't the best way connect to a Sphero and maintain the connection.
For my app, each flow had slightly different handleRobotOnline needs Flow 1: No driving, needs dataStreaming and AsyncData Flow 2: Multiplayer classes for sending commands. Flow 3: Joystick Driving with 1 view that required dataStreaming and AsyncData
My question is: for a multi-view app, where is the best place to: 1) Subscribe to app Notifications? 2) Subscribe to robot online/offline notifications? 3) Check if the app has the correct type of connection to the robot (driveControl, sharedMultiplayer, dataStreaming)?
I can paste code if necessary