iphone - Swift PageViewController share data between views -
i building application runkeeper (http://www.raywenderlich.com/73984/make-app-like-runkeeper-part-1). please forgive me if using incorrect language describe trying learning swift, , new iphone development :-).
i planning on using uipageviewcontroller 3 pages. on first page, show running timer, start, pause, finish, lap, etc buttons. once timer running, when user press 'lap' button on first page, lap log information shown in table on second page. system should not switch pages unless user swipes page. on third page should map gps. want take information gps (on third page), , perform processing on data, , show results on second page.
my question is, how share or pass information first, , third page second page without page changing second page? note: app should not switch pages when data goes first, third page second. should switch pages if user swipes. second question is, once data available second controller, can execute functions while page still on first or third page?
i've tried use segue, app switch first, third page second page when prepareforsegue called. tried using global data (just try working), data not updated when swipe second page.
please let me know if need explain more clearly.
thank time.
i started thread discuss various ways can share data between view controllers in swift:
how share data between view controllers , other objects in swift?
in case data container singleton choice. you'd need add code in viewwillappear method fetches new values singleton , displays them view controllers display latest data when user swipes 1 of other view controllers.
Comments
Post a Comment