objective c - Xcode 4 UIButton segue push to Table View Controller -
right have uibutton
setup in storyboard pushes table view controller. working expected. trying have uibutton
load xml file when pressed , still move onto table view controller.
how can this? have code xml pieces, it's question of code go , how add .h , .m files new viewcontroller subclass uiviewcontroller
. how link files uibutton
i've created in storyboard?
drag button connection new view , select custom segue instead of push or modal.
change new custom segue's class "mysegueclass1" or ever you'd call it.
create new objective-c class same name assigned custom segue.
inside mysegueclass1.m file add following code, , add ever additional actions want -(void)perform
-(void)perform{ uiviewcontroller *dst = [self destinationviewcontroller]; uiviewcontroller *src = [self sourceviewcontroller]; [dst viewwillappear:no]; [dst viewdidappear:no]; [src.view addsubview:dst.view]; cgrect original = dst.view.frame; dst.view.frame = cgrectmake(dst.view.frame.origin.x, 0-dst.view.frame.size.height, dst.view.frame.size.width, dst.view.frame.size.height); [uiview beginanimations:nil context:nil]; dst.view.frame = cgrectmake(original.origin.x, original.origin.y, original.size.height, original.size.width); [uiview commitanimations]; [self performselector:@selector(animationdone:) withobject:dst afterdelay:0.2f]; } - (void)animationdone:(id)vc{ uiviewcontroller *dst = (uiviewcontroller*)vc; uinavigationcontroller *nav = [[self sourceviewcontroller] navigationcontroller]; [nav popviewcontrolleranimated:no]; [nav pushviewcontroller:dst animated:no]; }
Comments
Post a Comment