SlideShare a Scribd company logo
1 of 31
Download to read offline
RoR to RubyMotion
Writing Your First iOS App
With RubyMotion
Michael Denomy
BostonMotion User Group
June 25, 2013
About Me
• Tech Lead at Cyrus Innovation
- Agile web consultancy with offices in New
York and Boston
- http://www.cyrusinnovation.com
• Agile and XP practitioner since 2004
- Passionate about TDD and pairing
• mdenomy on twitter and github
• Blog at www.mdenomy.wordpress.com
Goals
• Capture my experiences getting started
with RubyMotion
- Help someone else along
- Get ideas for where to go next
• Target Audience
- Developers familiar with Ruby on Rails
- Little to no previous experience with iOS
- Desire to learn
• Some talk, some code
The Vision
MVC
Ruby
The Reality initWithNibName?
UIControlEventTouchUpInside?
What’s a Nib?
More Cold Hard Facts
• RubyMotion is not free
- $199.99
- No trial, but 30 day money back
- There is a student discount program
• iOS Developer Program is not free
- $99 / year
- Required to deploy to devices and distribute
via AppStore
• You will need to understand iOS SDK
- iOS documentation is difficult to navigate
It Gets Better
It Gets Better
Good Stuff
• Growing community with lots of online
resources
• More and more gems appearing that
provide a Rails-like experience
• Free to use the tools you like
- Sublime plug in for RubyMotion has code
completion and rake shortcuts
https://github.com/haraken3/
SublimeRubyMotionBuilder
MVC in iOS
• MVC is MVC right?
• No “convention over configuration”
- Have to wire things up manually
• Slightly different terminology that Rails
UIViewControllers
• Controller receives actions from the
framework (e.g. view loaded) and the
user (e.g. button pressed)
- Interacts with Models and View
• UIViewControllers you need to know
- UINavigationController
- UITabBarController
- UIViewController
- UITableViewController
Models
• Models are PORO’s in RubyMotion
• Support built-in for
- attr_accessor
- attr_reader
- attr_writer
• Possible to serialize/deserialize data
using NSCoder and NSKeyedArchiver
- Looked for other options to support storage
and relationships
Views
• UIView is a base class
• Buttons, labels, date pickers, etc., all
inherit from UIView
• Views can have subviews
- Simplifies screen layout and allows re-use
Let’s Look at Some Code
• Basic Navigation
- Application Delegate
- Root View Controller
- UITabBarController
- UIViewControllers
MyWines App
• I enjoy the occasional glass of wine.
• I would like to have a way to track the
wines I like and prices I've paid for them
- Record tasting notes
- Record purchases and price info
- Search for wine by name/producer
- Save to Favorites
- Save label picture
• Spoiler alert
- I have done next to nothing to style the app
Sketch It Out
It’s a lot cheaper and faster to iterate at this
level than in code
What Tools Did I Choose
• Bundler - Simplify dependencies
• ProMotion - Screen development and workflow
• Formotion - Entry/edit forms
• MotionModel - Models and relations
• Teacup - Styling DSL
• Sugarcube - UI extensions
• BubbleWrap - I used it for camera, but lots more
(JSON, HTTP, RSS, Location, Audio, Video)
• MotionAwesome - Buttons and icons
More at http://rubymotion-wrappers.com/
ProMotion
• Simplifies screen development
• Support for table screens
- Easily search for table entries
• Helpers for tab and navbar controllers
Formotion
• Easily create forms
for entry/edit
• Integrates with
ProMotion
• Support For
- text
- dates
- sliders
- check boxes
- and many more
MotionModel
• Wanted something like ActiveRecord
• Chose MotionModel gem
- Lightweight
- Feels Railsy
‣ Validations
‣ ActiveRecord-like syntax
‣ Relations
- Serialization / deserialization support
- Actively maintained
- Formotion support(turned out not to matter)
Teacup
• Layout and style
your app in a DSL
• Frees you up from
layout of screens in
XCode
• Allows you to keep
your views a lot
cleaner
• Hierarchical and
supports variables
Sugarcube
• Tons of helpful ‘syntactic sugar’ extensions
to make your development easier
- conversion of hex color codes to UIColor
- alert and action dialogs
- symbol to iOS, e.g.,
‣ :touch.uicontrolevent becomes UIControlEventTouchUpInside
- array helpers
- hash to object conversions
BubbleWrap
• Amazing set of tools for
- HTTP
- JSON
- RSS
- Camera
- Location
- Alert boxes
- REPL support
• Just using it for the camera in my app
MotionAwesome
• Great set of icons and buttons
• Based on FontAwesome
• So far only used it to create a camera
button using a camera icon
Deploying to Device
• Must be in Apple Developer Program
- $99/year
• Get provisioning and developer
certificates
• Deploy using rake
- rake device
- Make sure to quit iTunes and Image Capture
• Can’t do some things with simulator
- e.g. Camera
Where Do I Go Next
• Better use of views and subviews
- As app evolves will have more common
controls/groups -> re-use
- Easier to lay out due to relative positioning
used in subviews
• Better/more styling
- Will require more understanding of iOS
• Persist images to file system
• Do more with models
- Averages, filtering, etc
Where Do I Go Next
• Testing
- This was very much a spike, but as the app
evolves want to incorporate more automated
testing
- Tested the models, especially persistence and
validation since these were areas of risk
- Want to look at more integration testing
‣ motion-frank (maintained by Cyrus Innovation)
‣ motion-calabash
Questions I Still Have
• ProMotion is awesome, but I wonder if
down the road this paints me into a
corner
• Wild West of gems
- Will be interesting to see what ideas and
tools rise to the top
• How much iOS should I learn
- Interface Builder
- CoreData
Resources
• RubyMotion Developer Center
- http://www.rubymotion.com/developer-center/
• RubyMotion by Clay Allsop
- http://pragprog.com/book/carubym/rubymotion
• iOS Dev Center
- Tons of useful info, navigation is horrible
- https://developer.apple.com/devcenter/ios/index.action
- https://developer.apple.com/library/ios/#featuredarticles/
ViewControllerPGforiPhoneOS
• RubyMotion Wrappers and Libraries
- http://rubymotion-wrappers.com/
Questions
• Q&A
RoR to RubyMotion
Writing Your First iOS App
Michael Denomy
BostonMotion User Group
June 25, 2013

More Related Content

What's hot

Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swaggerTony Tam
 
Developing in the Cloud
Developing in the CloudDeveloping in the Cloud
Developing in the CloudRyan Cuprak
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Ryan Cuprak
 
React && React Native workshop
React && React Native workshopReact && React Native workshop
React && React Native workshopStacy Goh
 
Flexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldFlexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldKevin Ball
 
Combining R With Java For Data Analysis (Devoxx UK 2015 Session)
Combining R With Java For Data Analysis (Devoxx UK 2015 Session)Combining R With Java For Data Analysis (Devoxx UK 2015 Session)
Combining R With Java For Data Analysis (Devoxx UK 2015 Session)Ryan Cuprak
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeRadosław Scheibinger
 
Modern javascript
Modern javascriptModern javascript
Modern javascriptKevin Ball
 
Building Awesome APIs in Grails
Building Awesome APIs in GrailsBuilding Awesome APIs in Grails
Building Awesome APIs in Grailsclatimer
 
React Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + AuthenticationReact Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + AuthenticationKobkrit Viriyayudhakorn
 
Akka.net versus microsoft orleans
Akka.net versus microsoft orleansAkka.net versus microsoft orleans
Akka.net versus microsoft orleansBill Tulloch
 
Angular Owin Katana TypeScript
Angular Owin Katana TypeScriptAngular Owin Katana TypeScript
Angular Owin Katana TypeScriptJustin Wendlandt
 
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBoxKobkrit Viriyayudhakorn
 
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...Paul Durivage
 
Introduction to Realm Mobile Platform
Introduction to Realm Mobile PlatformIntroduction to Realm Mobile Platform
Introduction to Realm Mobile PlatformChristian Melchior
 
Write retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with AzureWrite retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with AzureMarco Parenzan
 
The Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendThe Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendSpike Brehm
 
Lambdaless and AWS CDK
Lambdaless and AWS CDKLambdaless and AWS CDK
Lambdaless and AWS CDKMooYeol Lee
 

What's hot (20)

Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
 
Developing in the Cloud
Developing in the CloudDeveloping in the Cloud
Developing in the Cloud
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
React && React Native workshop
React && React Native workshopReact && React Native workshop
React && React Native workshop
 
Flexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldFlexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework World
 
Combining R With Java For Data Analysis (Devoxx UK 2015 Session)
Combining R With Java For Data Analysis (Devoxx UK 2015 Session)Combining R With Java For Data Analysis (Devoxx UK 2015 Session)
Combining R With Java For Data Analysis (Devoxx UK 2015 Session)
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
 
Modern javascript
Modern javascriptModern javascript
Modern javascript
 
Fluxible
FluxibleFluxible
Fluxible
 
Building Awesome APIs in Grails
Building Awesome APIs in GrailsBuilding Awesome APIs in Grails
Building Awesome APIs in Grails
 
React Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + AuthenticationReact Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + Authentication
 
Akka.net versus microsoft orleans
Akka.net versus microsoft orleansAkka.net versus microsoft orleans
Akka.net versus microsoft orleans
 
Angular Owin Katana TypeScript
Angular Owin Katana TypeScriptAngular Owin Katana TypeScript
Angular Owin Katana TypeScript
 
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
 
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
 
Introduction to Realm Mobile Platform
Introduction to Realm Mobile PlatformIntroduction to Realm Mobile Platform
Introduction to Realm Mobile Platform
 
Write retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with AzureWrite retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with Azure
 
The Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendThe Evolution of Airbnb's Frontend
The Evolution of Airbnb's Frontend
 
Lambdaless and AWS CDK
Lambdaless and AWS CDKLambdaless and AWS CDK
Lambdaless and AWS CDK
 
Realm Presentation
Realm PresentationRealm Presentation
Realm Presentation
 

Similar to From Ruby on Rails to RubyMotion - Writing your First iOS App with RubyMotion

The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...Mark Roden
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day WorkshopShyam Seshadri
 
A Smooth Transition to HTML5
A Smooth Transition to HTML5A Smooth Transition to HTML5
A Smooth Transition to HTML5Chris Bannon
 
Riding the Edge with Ember.js
Riding the Edge with Ember.jsRiding the Edge with Ember.js
Riding the Edge with Ember.jsaortbals
 
UWP apps development - Part 2
UWP apps development - Part 2UWP apps development - Part 2
UWP apps development - Part 2Jiri Danihelka
 
Building mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and BackboneBuilding mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and BackboneTroy Miles
 
State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conferencedmethvin
 
Single Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.WebSingle Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.WebChris Canal
 
Node.js 101
 Node.js 101 Node.js 101
Node.js 101FITC
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angularBasarat Syed
 
FITC - Bootstrap Unleashed
FITC - Bootstrap UnleashedFITC - Bootstrap Unleashed
FITC - Bootstrap UnleashedRami Sayar
 
Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014Sean McCullough
 
Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Adam Mokan
 
jQuery Mobile Introduction
jQuery Mobile IntroductionjQuery Mobile Introduction
jQuery Mobile IntroductionJoris Graaumans
 
UX design for every screen
UX design for every screenUX design for every screen
UX design for every screenFour Kitchens
 
Selenium for everyone
Selenium for everyoneSelenium for everyone
Selenium for everyoneTft Us
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Ganesh Kondal
 

Similar to From Ruby on Rails to RubyMotion - Writing your First iOS App with RubyMotion (20)

The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
Wheel.js
Wheel.jsWheel.js
Wheel.js
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
A Smooth Transition to HTML5
A Smooth Transition to HTML5A Smooth Transition to HTML5
A Smooth Transition to HTML5
 
Riding the Edge with Ember.js
Riding the Edge with Ember.jsRiding the Edge with Ember.js
Riding the Edge with Ember.js
 
UWP apps development - Part 2
UWP apps development - Part 2UWP apps development - Part 2
UWP apps development - Part 2
 
Building mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and BackboneBuilding mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and Backbone
 
State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conference
 
Single Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.WebSingle Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.Web
 
Node.js 101
 Node.js 101 Node.js 101
Node.js 101
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angular
 
FITC - Bootstrap Unleashed
FITC - Bootstrap UnleashedFITC - Bootstrap Unleashed
FITC - Bootstrap Unleashed
 
ASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So FarASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So Far
 
Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014
 
Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012
 
jQuery Mobile Introduction
jQuery Mobile IntroductionjQuery Mobile Introduction
jQuery Mobile Introduction
 
UX design for every screen
UX design for every screenUX design for every screen
UX design for every screen
 
Selenium for everyone
Selenium for everyoneSelenium for everyone
Selenium for everyone
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 

More from Michael Denomy

Intro to automated testing
Intro to automated testingIntro to automated testing
Intro to automated testingMichael Denomy
 
Breathe In and Out With Me - Burlington Ruby Conference 2015
Breathe In and Out With Me - Burlington Ruby Conference 2015Breathe In and Out With Me - Burlington Ruby Conference 2015
Breathe In and Out With Me - Burlington Ruby Conference 2015Michael Denomy
 
Writing Maintainable Tests with PageObjects
Writing Maintainable Tests with PageObjectsWriting Maintainable Tests with PageObjects
Writing Maintainable Tests with PageObjectsMichael Denomy
 
Memory Management in RubyMotion
Memory Management in RubyMotionMemory Management in RubyMotion
Memory Management in RubyMotionMichael Denomy
 
Aikido, Controller Tests, and LinkedIn
Aikido, Controller Tests, and LinkedInAikido, Controller Tests, and LinkedIn
Aikido, Controller Tests, and LinkedInMichael Denomy
 
Design Principles - Michael Denomy at Launch Academy
Design Principles - Michael Denomy at Launch AcademyDesign Principles - Michael Denomy at Launch Academy
Design Principles - Michael Denomy at Launch AcademyMichael Denomy
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven DevelopmentMichael Denomy
 

More from Michael Denomy (9)

Intro to automated testing
Intro to automated testingIntro to automated testing
Intro to automated testing
 
Breathe In and Out With Me - Burlington Ruby Conference 2015
Breathe In and Out With Me - Burlington Ruby Conference 2015Breathe In and Out With Me - Burlington Ruby Conference 2015
Breathe In and Out With Me - Burlington Ruby Conference 2015
 
Writing Maintainable Tests with PageObjects
Writing Maintainable Tests with PageObjectsWriting Maintainable Tests with PageObjects
Writing Maintainable Tests with PageObjects
 
Memory Management in RubyMotion
Memory Management in RubyMotionMemory Management in RubyMotion
Memory Management in RubyMotion
 
Aikido, Controller Tests, and LinkedIn
Aikido, Controller Tests, and LinkedInAikido, Controller Tests, and LinkedIn
Aikido, Controller Tests, and LinkedIn
 
Reinventing Yourself
Reinventing YourselfReinventing Yourself
Reinventing Yourself
 
Design Principles - Michael Denomy at Launch Academy
Design Principles - Michael Denomy at Launch AcademyDesign Principles - Michael Denomy at Launch Academy
Design Principles - Michael Denomy at Launch Academy
 
Debugging rails
Debugging railsDebugging rails
Debugging rails
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 

Recently uploaded

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Recently uploaded (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

From Ruby on Rails to RubyMotion - Writing your First iOS App with RubyMotion

  • 1. RoR to RubyMotion Writing Your First iOS App With RubyMotion Michael Denomy BostonMotion User Group June 25, 2013
  • 2. About Me • Tech Lead at Cyrus Innovation - Agile web consultancy with offices in New York and Boston - http://www.cyrusinnovation.com • Agile and XP practitioner since 2004 - Passionate about TDD and pairing • mdenomy on twitter and github • Blog at www.mdenomy.wordpress.com
  • 3. Goals • Capture my experiences getting started with RubyMotion - Help someone else along - Get ideas for where to go next • Target Audience - Developers familiar with Ruby on Rails - Little to no previous experience with iOS - Desire to learn • Some talk, some code
  • 6. More Cold Hard Facts • RubyMotion is not free - $199.99 - No trial, but 30 day money back - There is a student discount program • iOS Developer Program is not free - $99 / year - Required to deploy to devices and distribute via AppStore • You will need to understand iOS SDK - iOS documentation is difficult to navigate
  • 9. Good Stuff • Growing community with lots of online resources • More and more gems appearing that provide a Rails-like experience • Free to use the tools you like - Sublime plug in for RubyMotion has code completion and rake shortcuts https://github.com/haraken3/ SublimeRubyMotionBuilder
  • 10. MVC in iOS • MVC is MVC right? • No “convention over configuration” - Have to wire things up manually • Slightly different terminology that Rails
  • 11. UIViewControllers • Controller receives actions from the framework (e.g. view loaded) and the user (e.g. button pressed) - Interacts with Models and View • UIViewControllers you need to know - UINavigationController - UITabBarController - UIViewController - UITableViewController
  • 12. Models • Models are PORO’s in RubyMotion • Support built-in for - attr_accessor - attr_reader - attr_writer • Possible to serialize/deserialize data using NSCoder and NSKeyedArchiver - Looked for other options to support storage and relationships
  • 13. Views • UIView is a base class • Buttons, labels, date pickers, etc., all inherit from UIView • Views can have subviews - Simplifies screen layout and allows re-use
  • 14. Let’s Look at Some Code • Basic Navigation - Application Delegate - Root View Controller - UITabBarController - UIViewControllers
  • 15. MyWines App • I enjoy the occasional glass of wine. • I would like to have a way to track the wines I like and prices I've paid for them - Record tasting notes - Record purchases and price info - Search for wine by name/producer - Save to Favorites - Save label picture • Spoiler alert - I have done next to nothing to style the app
  • 16. Sketch It Out It’s a lot cheaper and faster to iterate at this level than in code
  • 17. What Tools Did I Choose • Bundler - Simplify dependencies • ProMotion - Screen development and workflow • Formotion - Entry/edit forms • MotionModel - Models and relations • Teacup - Styling DSL • Sugarcube - UI extensions • BubbleWrap - I used it for camera, but lots more (JSON, HTTP, RSS, Location, Audio, Video) • MotionAwesome - Buttons and icons More at http://rubymotion-wrappers.com/
  • 18. ProMotion • Simplifies screen development • Support for table screens - Easily search for table entries • Helpers for tab and navbar controllers
  • 19. Formotion • Easily create forms for entry/edit • Integrates with ProMotion • Support For - text - dates - sliders - check boxes - and many more
  • 20. MotionModel • Wanted something like ActiveRecord • Chose MotionModel gem - Lightweight - Feels Railsy ‣ Validations ‣ ActiveRecord-like syntax ‣ Relations - Serialization / deserialization support - Actively maintained - Formotion support(turned out not to matter)
  • 21. Teacup • Layout and style your app in a DSL • Frees you up from layout of screens in XCode • Allows you to keep your views a lot cleaner • Hierarchical and supports variables
  • 22. Sugarcube • Tons of helpful ‘syntactic sugar’ extensions to make your development easier - conversion of hex color codes to UIColor - alert and action dialogs - symbol to iOS, e.g., ‣ :touch.uicontrolevent becomes UIControlEventTouchUpInside - array helpers - hash to object conversions
  • 23. BubbleWrap • Amazing set of tools for - HTTP - JSON - RSS - Camera - Location - Alert boxes - REPL support • Just using it for the camera in my app
  • 24. MotionAwesome • Great set of icons and buttons • Based on FontAwesome • So far only used it to create a camera button using a camera icon
  • 25. Deploying to Device • Must be in Apple Developer Program - $99/year • Get provisioning and developer certificates • Deploy using rake - rake device - Make sure to quit iTunes and Image Capture • Can’t do some things with simulator - e.g. Camera
  • 26. Where Do I Go Next • Better use of views and subviews - As app evolves will have more common controls/groups -> re-use - Easier to lay out due to relative positioning used in subviews • Better/more styling - Will require more understanding of iOS • Persist images to file system • Do more with models - Averages, filtering, etc
  • 27. Where Do I Go Next • Testing - This was very much a spike, but as the app evolves want to incorporate more automated testing - Tested the models, especially persistence and validation since these were areas of risk - Want to look at more integration testing ‣ motion-frank (maintained by Cyrus Innovation) ‣ motion-calabash
  • 28. Questions I Still Have • ProMotion is awesome, but I wonder if down the road this paints me into a corner • Wild West of gems - Will be interesting to see what ideas and tools rise to the top • How much iOS should I learn - Interface Builder - CoreData
  • 29. Resources • RubyMotion Developer Center - http://www.rubymotion.com/developer-center/ • RubyMotion by Clay Allsop - http://pragprog.com/book/carubym/rubymotion • iOS Dev Center - Tons of useful info, navigation is horrible - https://developer.apple.com/devcenter/ios/index.action - https://developer.apple.com/library/ios/#featuredarticles/ ViewControllerPGforiPhoneOS • RubyMotion Wrappers and Libraries - http://rubymotion-wrappers.com/
  • 31. RoR to RubyMotion Writing Your First iOS App Michael Denomy BostonMotion User Group June 25, 2013