swift - iOS: Go back to previous view -
i have 2 views in story board:
[view1] -> [navigation controller] -> [view2]
to go view1(has tableview) view 2, on click of row on view1:
self.performseguewithidentifier("showmyview2", sender:self)
this works.
now have button on view 2, when clicked should take me previous view i.e view 1.
i tried this:
navigationcontroller!.popviewcontrolleranimated(true)
but not work. how go first view?
first add navigation controller first view1 through storyboard.(editor->embed navigation controller), if navigation not present.
or
self.dismissviewcontrolleranimated(true, completion: nil);
call function , try instead of navigation popviewcontroller
Comments
Post a Comment