ios - Push a uiviewcontroller on top of existing ViewController when my App becomes active again -
my app has multiple uiviewcontrollers can displayed user @ time. app can started document (for example, attachment mail app).
the scenario following: - user starts app , navigates inside application - user puts app in background mode , goes mail app - mail app user selects mail attachment , opens attachment app - app enter in foreground , display attachment in specific view controller. - when user has finished attachment, should able return previous state in app (before attachment opened).
i have overloaded following methods uiapplicationdelegate:
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions - (bool)application:(uiapplication *)application openurl:(nsurl *)url sourceapplication:(nsstring *)sourceapplication annotation:(id)annotation { - (void)applicationdidbecomeactive:(uiapplication *)application using these methods i'm able find if there's document displayed , if app started or not.
my issue push specific viewcontroller.
below extract of code push viewcontroller nothing happen, idea? how can find active viewcontroller in app?
- (void)applicationdidbecomeactive:(uiapplication *)application { nslog(@"applicationdidbecomeactive"); if (_navigationcell != nil) { if ([datacenter sharedinstance].isappstarting == false) { // push new navigation stack display cell navigation //pusharroundmeid uiwindow* window = [uiapplication sharedapplication].keywindow; uiviewcontroller* rvc = window.rootviewcontroller; uistoryboard* sb= [uistoryboard storyboardwithname:@"mainstoryboardiphoneapp" bundle:[nsbundle mainbundle]]; aroundmeviewcontroller* avc = [sb instantiateviewcontrollerwithidentifier:@"aroundmeviewcontrollerid"]; if (avc != nil) { [rvc presentviewcontroller:avc animated:true completion:null]; window.rootviewcontroller = avc; } } } }
Comments
Post a Comment