ios - Why UIBarButtonItem doesn't call IBAction before segue? -
my question similar : swift: make button trigger segue new scene
the issue is:
i have view controller, button causes view controller appear modally.
i have ctrl+click button second view controller, , created segue in ib.
then ctrl+click button again source code of view controller create ibaction method.
i assumed button 2 things now: a) call ibaction method , , b) perform segue.
what happens segue reason.
when delete segue, or remove call view controller ib, ibaction called, xcode tells me second view controller not reachable now.
i want able present actionsheet user , able performsegue second view controller, based on user selected action sheet.
i know can programatically call performsegue
requires creation of segue , attaching physical button in ib, defeats purpose of not calling ibaction button may have.
if want additional steps before calling segue attach ibaction uibutton , call perform segue within this, in code. can add segue storyboard , give id, without having connect button. control-clicking on viewcontroller , drag next viewcontroller in storyboard.
Comments
Post a Comment