Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
RubyMotion iOS Development Essentials

You're reading from  RubyMotion iOS Development Essentials

Product type Book
Published in Jul 2013
Publisher Packt
ISBN-13 9781849695220
Pages 262 pages
Edition 1st Edition
Languages

Table of Contents (19) Chapters

RubyMotion iOS Development Essentials
Credits
About the Authors
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
1. Getting Ready for RubyMotion 2. Instant Gratification – Your First Application 3. Evolution – From Objective-C to RubyMotion 4. Mastering MVC Paradigm 5. User Interface – Cosmetics for Your App 6. Device Capability – Power Unleashed 7. Interface Builder and WebView – More Goodies! 8. Testing – Let's Fail Gracefully 9. Creating a Game 10. Getting Ready for the App Store 11. Extending RubyMotion Index

Some more goodies


We know that it's not so much fun to have only a simple HelloWorld pop-up as our very first application, so let's jazz up our code by adding some more goodies to our alert box; and this time, let's do things in a much better way.

Earlier we had added an alert box in the delegate itself. Actually it is not a good idea to write code in the application delegate. It is better to write code in a Model-View-Controller (MVC) way. Right now we won't cover all three parts of the MVC architecture for now let's begin with the controller for our application and add three buttons in this alert box, add a title, and add a message for the title box.

The class UIAlertView that we've used in the last section has numerous properties, such as title, message, delegate, cancelButtonTitle, otherButtonTitles, and many more. Let's use a few of them in our application as follows:

  1. Create a file root_controller.rb in the app folder and add the following code:

    class RootController < UIViewController...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}