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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -