Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Joshua Hawthorne
18,523 PointsHow to Create a Menu That Slides Up From the Bottom (and has an overlay) in Swift
I'm building an iPhone app in Swift. I would like my users to have a menu slide up from the bottom when they tap a button on the table view. Instagram has a very good example of what I am trying to do:
http://cdn.coolmompicks.com/wp-content/uploads/sites/2/2015/03/editing-captions-Instagram.jpg
You see how when the user taps the button, the menu slides up from the bottom, and the rest of the table view has a black overlay with a low alpha (it's see through)? This is what I would like to implement, but I have no idea how to do it. Do I add two views to my table view, one for the overlay, and one for the menu, and animate them to appear on the button tap? How would I get the views to "Float" above the table view? Or, do I need to add another View Controller and have it partially transition with some sort of custom segue? Or am I totally off the mark? What is the simplest and most effective way to create that Instagram style menu?
2 Answers
Joshua Hawthorne
18,523 PointsI've found the best way to do this is with UIAlertController. You can find the developer reference here: (https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAlertController_class/index.html#//apple_ref/occ/cl/UIAlertController)
Dustin McCaffree
14,310 Pointshttps://www.youtube.com/watch?v=8EFfPT3UeWs
Try this tutorial. There is plenty of material out there if you look! :) Good luck!
Dustin