First Ruby Motion App

You’re closer than you think to a career in tech. Our grads have launched rewarding new careers — you can too.

View Our Jobs Report

The following is a guest post by Jack Nolan and originally appeared on his blog. Jack is currently a student a The Flatiron School. You can learn more about him here, or follow him on twitter here.

I recently dived into rubymotion head first and since there is a definite lack of quality tutorials out there I decided to outline my first ruby motion project. The goal of the project was simple, say display hello world to the user. My first set was setting up the app delicate. The following code is the very generic setup.

Blog post image: tumblr_mexmfqlC6h1rtan47.png

This will initialize the window and set the initial controller to the homeController. Then in order for this to work I needed to define the HomeController, so in the controllers/home_controller.rb I define my controller.

Blog post image: tumblr_mexmfxaMbb1rtan47.png

This defines the homecontroller and sets the view local variable. This variable will be used to add UI elements to the view. So next is adding a UILabel to this view using the following code

Blog post image: tumblr_mexmgvSRTe1rtan47.png

This code initializes a new UILabel in the given frame the adds the text to display and finally adds it to the view initialized earlier to be displayed. And thats it! We now have our generic helloworld application next thing to do: put it on the app store and make 1 million dollars.

Headshot of Flatiron School

Flatiron School

Blog Post Author

Read More Flatiron School Articles

Since we opened our doors in 2012, thousands of students have joined Flatiron School to launch new careers in tech.

Explore our Courses

Find the perfect course for you across our in-person and online programs designed to power your career change.

Explore Our Courses
Join a Community

Connect with students and staff at meetups, lectures, and demos – on campus and online.

Join the Community
Schedule a Chat

Have a question about our programs? Our admissions team is here to help.

Schedule a Chat