objective c - iOS - Pass Data Multiple Times From Parent View Into Container View's View -


i have uipageviewcontroller, , 1 of view controllers has container view parent view controller passes data container can display dynamic data. have parent view passing data view within container view prepareforsegue method:

//in storyboard-based application, want little preparation before navigation - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender {     nslog(@"called prepare segue");     if ([segue.identifier isequaltostring:@"viewembed"]) {         //pass data     } } 

however, prepareforsegue method called once (note nslog debugging statement), need pass different data child view every time uipageviewcontroller swipes parent view. noticed viewdidload method fires once in parent view because uipageviewcontroller retains state of pages.

is there way re-instantiate (call viewdidload again) parent view every time swiped uipageviewcontroller? i'm thinking make prepareforsegue method fire more once, need do. or thinking wrong way , there more elegant solution?

any or advice appreciated. thanks.

the view did load called once segue since view loaded once. should manually by

  • register delegate updades on uipageviewcontroller
  • impelemt

    - (void)pageviewcontroller:(uipageviewcontroller * nonnull)pageviewcontroller willtransitiontoviewcontrollers:(nsarray<uiviewcontroller *> * nonnull)pendingviewcontrollers receive these updates

  • call method on child but not viewdidload,viewwillappear or viewdidappear since there code should not executed multiple times. should copy current viewdidload code child new method , call method parent when delegate method called


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -