cwRichardKim / RKSwipeBetweenViewControllers

Swipe between ViewControllers like in the Spotify or Twitter app with an interactive Segmented Control in the Navigation Bar
MIT License
1.67k stars 156 forks source link

Created a version that behaves more like Tinder in Swift #24

Open jonathanxie opened 9 years ago

jonathanxie commented 9 years ago

Hey @cwRichardKim

Thanks for creating and sharing this!!!

I was able to port it into Swift with behavior that is more like Tinder located at:

https://github.com/jonathanxie/JXSwipeBetweenViews/blob/master/README.md

Might be a bit buggy but it works decently well...

swipe

Also, for the X_OFFSET issue, I noticed that it appears if you set the navigationView to the titleView of the navigationBar:

pageController.navigationController.navigationBar.topItem.titleView = navigationView;

Try setting the background color of the navigationBar to red and you can see that it's somehow smaller than the screen even though the self.navigationBar.frame.size.width is the same as the width of the screen.

Anyway, I set my navigationView to be a subview of the navigationBar and I didn't have the X_OFFSET issue. The X_OFFSET issue gets really annoying when I run the app on different devices on fullscreen mode instead of scalemode. Couldn't figure out an easy solution so I just did this:

 navigationBar.addSubview(navigationView)

I have a version of this in Objective-C using your code base. If you want me to put that up too for others who are still using Objective-C, let me know!

Hope this helps others out!

markmark1 commented 8 years ago

yes can u upload the obj-c version - When I run you test it shows the app running in the middle of the screen with about a cm on the top and bottom (iphone6) of empty space - how to fix that ?