I'm using a UIContainer to switch between views using segmented control + swipe gesture.
My storyboard is like this one.
Override func viewDidLoad() {
super.viewDidLoad()
var swipeRight = UISwipeGestureRecognizer(target: self, action: "respondToSwipeGesture:")
swipeRight.direction = UISwipeGestureRecognizerDirection.Right
self.view.addGestureRecognizer(swipeRight)
}
I tired many open resources for Github but it is written in objective-C? Can anyone help
func respondToSwipeGesture(gestureReconizer: UISwipeGestureRecognizer) {
self.performSegueWithIdentifier("SegueFromFirstScreenToSecond", sender: nil)
}
Here is the method you would have to implement if you already have created the segue and named it "SegueFromFirstScreenToSecond". If you have not already made the segue, do not worry! It is as easy as drawing from the first responder of the view in storyboard to the next screen and then setting the identifier to "SegueFromFirstScreenToSecond".
Best of luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With