The 3 main snapchat buttons are on the bottom on the screen, but as you swipe and move between different view controllers, they stay in the same position. Not only that, they also shrink and grow depending on which view you are in.
I'm trying to do something similar. I have a button at the top of my vc, and when I segue to another one I would like it to stay it there and still be functional.
For complex animations you can achieve this by creating custom transition between view controller. Important to note is that in the transition logic you have to animate controller in such way that substitution of buttons will not be visible. Just when the first controller buttons have disappeared under them will be the second controller buttons.
What I did for this was a scrollview with viewcontrollers within it. There are tutorials on youtube just search for snapchat scroll or snapchat menu system or w/e. Then I put the buttons on the scrollview, so as you slide to each view controller the buttons stay stationary. I also made a slider but it becomes pretty complicated. My slider is also disappearing when i navigate out and back, so there is a LOT of tweaking involved.
One possible way of going about this would be using a
UIPageViewController
and setting it up to show the requiredUIViewControllers
at the appropriate indexes. You will have to programmatically add the buttons after subclassing theUIPageViewController
.Alternatively:
You can also use
UICollectionView
with full screen size cells and add the requiredUIViewController.view
at the proper indexes inside theUICollectionViewCell.contentView
. Add the buttons on top of theUICollectionView
and animate the button by increasing or decreasing the constraints based on thescrollView
contentOffset