0
votes

I'm currently building an app that needs to be able to swipe left to the next view controller and then show random quotes dynamically from a dictionary. I've added the current gesture recognizer from the initial view controller however I don't want the standard push segue functionality.

How it should function: From swiping left you are swiped to the next view controller. From this view controller I could use a scroll view. Could I generate dynamic sub views based on the count of the dictionary or is there something else.

Current gesture recognizer:

  let swipeLeft = UISwipeGestureRecognizer(target: self, action: "goSwipe:")
    swipeLeft.direction = .Left
    self.view.addGestureRecognizer(swipeLeft)

I would like to be able to swipe left on the inital view controller to the next (there's only 2 VC's in the app).

Thanks

1
if you no need of I don't want the standard push segue functionality then which one you want - Anbu.Karthik
I want to the next view controller to slide in from the left when a user swipes - Jesse C
then follow vaibhav answer it suitable for your answer - Anbu.Karthik

1 Answers

1
votes

you can use horizontal scrollview by setting down its contentSize method x position then generate dynamic sub views based on the count of the dictionary.

Check this out here.