iOS Question Page state

Discussion in 'iOS Questions' started by daxydoggie, Jul 15, 2015.

  1. daxydoggie

    daxydoggie Member Licensed User

    Hi,

    In B4A my app is a series of activities, and because the app can unload an activity when not being used, i always save sate away when the activity is deactivated.
    In B4i, I am porting this app, I use the page/multi-module approach, each page has a code module, so it is more like the B4A app, each module implements a show() method as Erel's guidelines.
    Most folk talk here about saving state on application_background (the overall app - not the page), so my question is
    1) do I need to save state when one of my pages is hidden from view, restore state when displayed? If so are there page events to catch for show/hide?
    Or
    2) as long as the overall app is not in background, can I still access all page code module public scoped variables, and not bother about between page state saving?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    1) The relevant events are Appear and Disappear. However you don't need to manage the state there as the pages will not be destroyed as long as the app is in the foreground.
    2) Yes.

    The life cycle of iOS apps is much simpler than in Android.
     
    GGSoft likes this.
  3. daxydoggie

    daxydoggie Member Licensed User

    Thanks Erel.
     
Loading...