objective c - Segue between UIViewControllers without Storyboard OR XIB -
i have nifty project downloaded github (here) , playing around it. project has no storyboard or xibs whatsoever, , 1 viewcontroller, defined viewcontroller.h file , viewcontroller.m file.
perhaps noob question, can have viewcontroller1.h/m programmatically segue viewcontroller2.h/m without using xibs or storyboards? found lot of code on , elsewhere allowing 1 segue programmatically 1 view within storyboard, 1 xib or scoreboard xib (though not opposite) nothing on how segue 1 totally code-based vc another. code found requires define view in terms of bundle location of storyboard or xib file, want use neither.
note: accepted answer did because of ingenuity/interesting-ness, sake of simplicity ended opting answer same question (mine duplicate appears): ios: present view controller programmaticallly
you can use [viewcontroller presentviewcontroller:anothercontroller animated:yes completion:nil];
present view controller modally.
another alternative use uinavigationcontroller
, [viewcontroller.navigationcontroller pushviewcontroller:anothercontroller animated:yes];
the second method work if viewcontroller
in stack of navigationcontroller
Comments
Post a Comment