Folder structure
In this section, we will understand the folder structure of our application as we know from the previous section that motion create <project name>
sets up the directory structure with all the essential files to run a simple RubyMotion application. Let's walk through each one of them to have a precise understanding of their function:
The
app
folder: This is the core of your application code; you will write most of your code in this folder. RubyMotion iterates in this folder and loads any.rb
file that it catches.Tip
If you want to keep your code somewhere else other than the
app
directory, add the folder path to theRakefile
.The
app_delegate.rb
file in theapp
folder: This file is at the heart of the RubyMotion application. If you are a little familiar with iOS development, this is the delegate file. A delegate is an object that usually reacts to some event in another object and/or can affect how another object behaves. There are various methods that can be implemented...