swift - how to cancel segue if both UITextFields contain text -
i have 2 uitextfields 1 normal uitextfield other uitextfield connected uipickerview. want 1 of them respond mybutton , perform correct segue viewcontrollera if info inserted in fields correct , matches array of strings, , viewcontrollerb if inserted text not match array. uipickerview entered text correct.. situation if there text inside both of fields how can construct uialert when button pressed action doesn't happen. or hide uibutton if both fields contain text
to make segue conditional, need use shouldperformseguewithidentifier:sender:
below.
override func shouldperformseguewithidentifier(identifier: string, sender: anyobject?) -> bool { if identifier == "segue1identifier"{ //check required conditions //if conditions setisfy : return true //else return false : not allow segue perform, prepareforsegue:sender: not call } }
Comments
Post a Comment