jakespracher / Snapchat-Swipe-View

Handy four way snapchat style scrolling navigation
MIT License
143 stars 19 forks source link

Button to scroll to viewcontroller #8

Open devJoshLopez opened 8 years ago

devJoshLopez commented 8 years ago

I have a button on the "middle" vc that should take the user to the "right" vc. Using a segue makes the swiping stop working. How would I scroll to the second vc with a button? The same functionality can be seen on snapchat where the bottom right button on the main vc takes you to the stories vc.

ghost commented 7 years ago

@devJoshLopez You need to set the contentOffSet of the scrollview and animate it. Then I simply post notifications from my viewcontroller to change the content offset of the scroll view :)

jakespracher commented 7 years ago

^yep I agree. I suppose I could implement this and make it optional, but I left it out initially since some people may not want this behavior and its not too difficult to add

WayneEld commented 7 years ago

Correct you can post a notification from your middle view controller to either the SnapContainerViewController or the VerticalScrollViewController (that contains the notification observer on the scroll view set up). You can then set the content off set for the scroll view as @danieldelouya said.

PranavMadanahalli commented 6 years ago

@danieldelouya could you post your solution here! :)