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.
your parentviewcontroller keep pointer childviewcontroller , call function, write in childviewcontroller, showuseralert. once fired, can show alert.
have parentviewcontroller fire
nsnotification
nsnotificationcenter
. child should listen , act accordingly.- the child should implement delegate , parentviewcontroller should set delegate.
i go first one.
Comments
Post a Comment