RubyMotion, Ruby classes, methods and objects are Objective-C classes Objective-C classes, methods and objects are available in Ruby as if they were native. Monday, September 2, 13
200 'Hello'.drawAtPoint(pt, withFont: font) #It is possible to pass the field values directly to the constructor. pt = CGPoint.new(100, 200) 'Hello'.drawAtPoint(pt, withFont: font) #RubyMotion will also accept arrays as a convenience. #They must contain the same number and type of objects expected in the structure. 'Hello'.drawAtPoint([100, 200], withFont: font) C structures are mapped to classes in RubyMotion. Monday, September 2, 13
RootScreen.new(nav_bar: true) end end class RootScreen < PM::Screen title "Root Screen" def push_new_screen open NewScreen end end class NewScreen < PM::TableScreen title "Table Screen" def table_data [{ cells: [ { title: "About this app", action: :tapped_about }, { title: "Log out", action: :log_out } ] }] end end Monday, September 2, 13