mardi 23 juin 2015

How to trigger a UIViewController segue based on gesture actions in a UItableViewCell using Xcode

I am prototyping an iOS app, using Xcode and swift language, that uses different gesture actions in a given UITableViewCell to initiate a particular segue to another UIViewController.

The UI is modeled after the mail app where a pan gesture recognizer is added to a UITableViewCell view. Depending on if the UITableViewCell view is panned left or right or how far it is panned before released should determine which 1 of several view controllers is segued to.

I have successfully set up the pan gesture recognizer in the UITableViewCell to my satisfaction by switching on the translationInView and the action and animations work great.

What I was planning to do on each switch condition is add a performSegueWithIdentifier to trigger 1 of the 4 different segues, but apparently this does not work from within a UITableViewCell.

Any help is GREATLY appreciated! :D Charlie

See more ..

Aucun commentaire:

Enregistrer un commentaire