售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
RubyMotion iOS Development Essentials
Table of Contents
RubyMotion iOS Development Essentials
Credits
About the Authors
Acknowledgement
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Ready for RubyMotion
How can I develop an iOS application?
Native apps using Objective-C
Mobile web applications
Hybrid applications
What is RubyMotion?
Why RubyMotion?
If you are not an Objective-C fan
It is not a bridge
Managed memory
Terminal-based workflow
Easy debugging with REPL
It is extendable
Debugging and testing
Pop quiz
RubyMotion installation – furnish your environment
Prerequisites for RubyMotion
Installing RubyMotion
Update RubyMotion
How do we check we've done everything correctly?
Pick your own editor – you are not forced to use Xcode
How to get help
FAQs
Summary
2. Instant Gratification – Your First Application
Your first application
Folder structure
Some more goodies
Let's understand the code
Exploring the command line
Motion command – one-stopshop
Rake tasks – get things done fast
Rake file – configuring your application
REPL – the interactive console
Debugger – catch your mistakes!
How to start debugging
While testing on a simulator
While testing on a device
Entering commands before starting
Breakpoint
Listing breakpoints
Moving between the different breakpoints
Checking the value of a local variable
Checking the value of an instance variable
Disable breakpoint
Exit debugger
Summary
3. Evolution – From Objective-C to RubyMotion
Ruby and Objective-C – a partnership
Ruby and Objective-C share the same ancestor
Interfacing with C and Objective-C
Types
Enumerations and constants
Functions
Structures
Pointers
Classes
Objective-C messages
RubyMotion selectors
Memory management
Summary
4. Mastering MVC Paradigm
Model-View-Controller (MVC)
Model
View
Controller
The restaurant application
Creating a model
Writing more code
Restaurant controller
Restaurant view
Connecting to an external API
Search restaurant by city
What just happened
Picture speaks louder than words
Play time
Summary
5. User Interface – Cosmetics for Your App
Bars
The tab bar
Customizing the tab bar
The navigation bar
Customizing the navigation bar
The status bar
Basic UI elements
Label
Textfield
Switch button
Slider
Button
Picker view
Hands-on – add a Restro Application
Summary
6. Device Capability – Power Unleashed
Camera – smile please!
Camera example
Understanding the Camera code
Location Manager – directions for apps
Location Manager example
Gestures – non-verbal communication
Gesture example
Do it yourself
Core Data – manage your data
Core Data example
Creating an employee
Deleting the employee
Address Book – manage your contacts
Do it yourself
Task 1 – show nearest restaurant
Task 2 – mark each restaurant on a map with a pin
Summary
7. Interface Builder and WebView – More Goodies!
Interface Builder
Let's try the Interface Builder
.xib to RubyMotion
UIWebView – embed web content
Summary
8. Testing – Let's Fail Gracefully
Unit testing
Functional testing
Device events
Rotate device
Accelerometer device event
Gestures
Tap
Flick
Pinch open
Pinch close
Drag
Rotation
Summary
9. Creating a Game
Cocos2D
Let's create a game – Whac-A-Mole
Let's start coding!
Adding motion to moles
Adding touch events to the game
Adding scores
Games without any sounds are boring — let's add some sound
Summary
10. Getting Ready for the App Store
Generating certificates
Do it yourself
Provisioning profile
App ID
Adding devices
Developer Provisioning Profile
Do it yourself
Setting up the RubyMotion project
Entitlements
Info.plist settings
Building icons
Configuring your application
Installing on a device
iTunes Connect
Creating bundles for submission
Summary
11. Extending RubyMotion
RubyMotion gems
Teacup – say goodbye to Xcode and XIB files!
BubbleWrap – making Cocoa APIs more Ruby-like
motion-addressbook – access phonebook easily
CocoaPods – managing Objective-C libraries
Installing CocoaPods with RubyMotion
Summary
What next?
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜