ios - Is there a way To call a Child UIViewController method from Parent UIViewController? -


i'm new in objective-c , problem in (xcode) parent uiviewcontroller monitoring ibeacon's , when user go child uiviewcontroller monitoring still running , need call child vc method parent. if actual closest beacon changed, want alert user "hey! moved! etc.". there proper way it? (sorry bad english , if i'm not specific)

there several ways it.

  1. your parentviewcontroller keep pointer childviewcontroller , call function, write in childviewcontroller, showuseralert. once fired, can show alert.

  2. have parentviewcontroller fire nsnotification nsnotificationcenter. child should listen , act accordingly.

  3. the child should implement delegate , parentviewcontroller should set delegate.

i go first one.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -