One of the more popular posts in the last few months has been Sliding Views On and Off Screen – Part 1 – Creating a Reusable Sliding Message Widget. The post inspired two developers to use the code example as a starting point to come up with a few different approaches to working with sliding views.
Both readers contacted me to share their ideas and code, in this post I’ll introduce each developer, show a short movie of their approach and include a link to their respective Xcode projects.
Sliding Views with Interface Builder
The first project was written by Gregory Meach, a developer new to the iPhone, you can find Greg here on his blog. Greg created an interesting application using Interface Builder to demonstrate various options for sliding views on/off screen, from the top, from the bottom, etc. Here’s a short video of his work:
You can download Greg’s project here: Xcode – SlidingViewInterfaceBuilder.zip
Sliding Views with UIView and DrawRect
Another reader, Cory D. Wiles, took a different approach and created a UIView for the sliding widget, which involves writing a DrawRect method to display the desired text message inside the view. A short video follows that shows the end result:
Cory D. Wiles is a Senior Software Developer with St. Jude Children’s Research Hospital. Cory develops and maintains the internal and external web apps (PHP, Zend Framework, Java, Apache, MySQL) as well as St. Judes main website. Cory wrote the content delivery system for the site and is also responsible for their internal iPhone apps. Cory is also a Freelance Web developer, focusing primarily on PHP and Zend Framework and Joomla! and WordPress customization. He is also writing a companion iPhone app for a website he is creating, which he hopes to have live by the end of 2009. You can find Cory on his blog or website.
Cory’s project is available here: Xcode – SlidingViewDrawRect.zip
Thanks to both Greg and Cory for taking the time to tinker with the original example and come up with unique ways to build on the code, also, their willingness to share their Xcode projects with others. Very cool.