You are previewing Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming.
O'Reilly logo
Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming

Book Description

Covers iOS 7 and Xcode 5

Learning iOS Developmentis the perfect first book for every new iOS 7 developer. It delivers  a complete foundation for iOS development, including an introduction to the Objective-C language, Xcode development tools, best-practice user interface development, and best practices for all  aspects of app development and deployment.

Throughout Learning iOS Development, you explore the iOS development process as you create  and expand a handy car valet app. The hands-on projects enable you to create meaningful code  as soon as possible, building confidence and mastery. The annotated code listings work with all  the latest iOS technology, so you’ll be ready to jump into this exciting development field.

With Learning iOS Development, it’s easy to learn at your own pace, on your own--or to deepen  the knowledge you may be gaining in a classroom or workplace.

Coverage includes

  • Installing all the tools, programs, and devices  you need to create iOS apps

  • Building your first app and mastering the  essentials of Objective-C

  • Making the most effective use of device memory

  • Storyboarding your interface and connecting it to your underlying code

  • Using Auto Layout to support devices with different sizes and orientations

  • Managing app data with Core Data

  • Creating sophisticated custom gestures

  • Deploying your app through Apple’s App Store

  • Quickly localizing your app for multiple languages  and countries

  • Implementing scrolling, navigation, table views,  and other core iOS features

  • Mastering advanced table views and navigation,  including iPad split views

  • Passing code encapsulated in blocks for communicating between parts of your app and with the system

  • Tuning and debugging your apps for the best  performance and quality

  • Discovering great resources to take your next steps  as an iOS developer

Table of Contents

  1. About This eBook
  2. Title Page
  3. Copyright Page
  4. Dedication Page
  5. Contents at a Glance
  6. Table of Contents
  7. Foreword
  8. Acknowledgments
  9. About the Authors
  10. Preface
    1. What You’ll Need
    2. Your Roadmap to iOS Development
    3. How This Book Is Organized
    4. About the Sample Code
    5. Getting the Sample Code
    6. Contribute!
    7. Accessing git
    8. Accessing GitHub
    9. Contacting the Author
  11. Editor’s Note: We Want to Hear from You!
  12. 1. Hello, iOS SDK
    1. Installing Xcode
    2. About the iOS SDK
      1. What You Get for Free
      2. iOS Developer Program (Individual and Company)
      3. Developer Enterprise Program
      4. Developer University Program
      5. Registering
      6. iTunes U and Online Courses
      7. The iOS SDK Tools
    3. Testing Apps: The Simulator and Devices
      1. Simulator Limitations
      2. Tethering
      3. iOS Device Considerations
    4. Understanding Model Differences
      1. Screen Size
      2. Camera
      3. Audio
      4. Telephony
      5. Core Location and Core Motion Differences
      6. Vibration Support and Proximity
      7. Processor Speeds
      8. OpenGL ES
      9. iOS
    5. Summary
  13. 2. Objective-C Boot Camp
    1. Building Hello World the Template Way
      1. Creating the Hello World Project
      2. A Quick Tour of the Xcode Project Interface
      3. Adding the Hello World Label
    2. Objective-C Boot Camp
      1. The Objective-C Programming Language
      2. Classes and Objects
    3. The CarValet App: Implementing Car Class
      1. Implementing Car Methods
      2. Properties
      3. Creating and Printing Cars
    4. Properties: Two More Features
      1. Custom Getters and Setters
    5. Subclassing and Inheritance: A Challenge
      1. Inheritance and Subclassing
    6. Summary
    7. Challenges
  14. 3. Introducing Storyboards
    1. Storyboard Basics
      1. Scenes
    2. Scene 1: Creating the Add/View Scene
      1. Adding the Add/View Visual Elements
      2. Adding the Initial Add/View Behaviors
      3. Adding Car Display Behaviors
      4. Adding Previous and Next Car Buttons
    3. Scene 2: Adding an Editor
      1. Adding the Editor Visual Elements
      2. Adding Editor Behaviors
      3. Hooking It All Together
      4. Why Not Segue Back?
    4. Improving the Storyboard: Take 1
      1. Exchanging Data Using a Protocol
    5. Improving the Storyboard: Take 2
    6. Summary
    7. Challenges
  15. 4. Auto Layout
    1. Auto Layout Basics
      1. Constraints
    2. Perfecting Portrait
      1. Thinking in Constraints
      2. What Makes a Complete Specification
      3. Adding/Viewing Cars: Designing and Implementing the Constraints
      4. Edit Car: An Initial Look
    3. Adding Landscape
      1. Adding and Viewing Cars: Designing the Landscape Constraints
    4. Summary
    5. Challenges
  16. 5. Localization
    1. Localization Basics
      1. Redirection
      2. Formats
    2. Preparing the App for Localization
      1. Setting Up Localization for the Add/View Car Scene
    3. German Internationalization
      1. Adding the German Locale
      2. Changing the Device Language
      3. Updating the German Localizable.strings
      4. Changing Label Constraints
      5. Formatting and Reading Numbers
    4. Right-to-Left: Arabic Internationalization
      1. Adding Arabic Strings
      2. Making Dates and Numbers Work
      3. Text Alignment
    5. Summary
    6. Challenges
  17. 6. Scrolling
    1. Scrolling Basics
    2. Bounce Scrolling
      1. Adding a Scroll View to the View/Edit Scene
    3. Handling the Keyboard
      1. Adding the Scroll View
      2. Resizing for the Keyboard
      3. Adding Resizing
    4. Scrolling Through Content
      1. Populating the Scroll View
      2. Adding Paging
      3. Adding Zoom
      4. Rotation
      5. What Car Is This?
    5. Summary
    6. Challenges
  18. 7. Navigation Controllers I: Hierarchies and Tabs
    1. Navigation Controller
      1. Navigation Controller Classes
      2. Message-Based Navigation
      3. A Bit of Color
    2. Tab Bar Controller
      1. How the Tab Bar Works
      2. CarValet: Adding a Tab Bar
      3. Car Valet: Moving Info
    3. Summary
    4. Challenges
  19. 8. Table Views I: The Basics
    1. Introduction to Table Views
      1. Project TableTry
    2. Phase I: Replacing the Add/View Scene
      1. Adding a Car View Cell
      2. Adding New Cars
      3. Removing Cars
    3. Phase II: Adding an Edit Screen Hierarchy
      1. Adding a View Car Scene
      2. Populating the View Car Scene with Data
      3. Editing Data
      4. Editing the Year
    4. Summary
    5. Challenges
  20. 9. Introducing Core Data
    1. Introduction to Core Data
    2. Moving CarValet to Core Data
      1. Adding the CDCar Model
      2. Adding Core Data Boilerplate Code
      3. Converting CarTableViewController
    3. Easier Tables: NSFetchedResultsController
      1. Part 1: Integrating NSFetchedResultsController
      2. Part 2: Implementing NSFetchedResultsControllerDelegate
    4. Summary
    5. Challenges
  21. 10. Table Views II: Advanced Topics
    1. Custom Table View Cells
      1. Adding the Custom Cell Visual Elements
    2. Sections and Sorting
      1. Section Headers
      2. Enabling Changing of Section Groups
    3. Adding an Index
      1. Showing the Year in an Index
    4. Searching Tables
      1. Adding Searching
    5. Summary
    6. Challenges
  22. 11. Navigation Controllers II: Split View and the iPad
    1. Split View Controller
    2. Adding a Split View Controller
      1. Adding the Split View Controller
      2. Adding App Section Navigation
    3. Adding About
      1. Creating MainMenuViewController
      2. Polishing Menu Images
    4. Accessing the Menu in Portrait
      1. Implementing the DetailController Singleton
    5. Adding Car Images
    6. Adding Cars
      1. Adapting the Car Table to iPad
      2. Car Detail Controller
      3. Car Detail Controller, Take 2: iPad Specific
    7. Summary
    8. Challenges
  23. 12. Touch Basics
    1. Gesture Recognizer Basics
    2. Swiping Through Cars
      1. Moving Through Cars
      2. Calling nextOrPreviousCar:
      3. Adding Action Selectors
      4. Adding the Swipe Gestures
      5. Preventing Recognizers from Working
    3. Custom Recognizers
      1. Recognizer States
      2. Specializing Recognizer Messages
    4. iPad Go Home
      1. Creating the Return Gesture Recognizer
      2. Adding the Gesture Recognizer to the Current Detail
      3. Creating and Responding to the Gesture Recognizer
    5. One More Gesture
      1. Drag Gesture Recognizer
      2. Adding the Taxi View with Drag
    6. Summary
    7. Challenges
  24. 13. Introducing Blocks
    1. Block Basics
      1. Declaring Blocks
      2. Using Blocks
      3. Writing Blocks
    2. Variable Scope
      1. Copying and Modification
    3. Replacing a Protocol
      1. Step 1: Changing ViewCarTableViewController
      2. Step 2: Updating CarTableViewController
      3. Step 3: Modifying CarDetailViewController
      4. Step 4: Updating MainMenuViewController
    4. Summary
    5. Challenges
  25. 14. Instruments and Debugging
    1. Instruments
      1. Templates and Instruments
      2. An Example Using the Time Profiler
      3. A Last Word on Instruments
    2. The Debugger
      1. Debug Gauges: Mini “Instruments”
      2. Breakpoints, and Actions, and Code...Oh My!
    3. Bug Hunt: Instruments and the Debugger
      1. Starting with Zombies
      2. Moving On to the Debugger
    4. Summary
    5. Challenges
  26. 15. Deploying Applications
    1. Certificates, Profiles, and Apps
      1. Generating a Development Certificate and Profile
      2. App ID and Provisioning
    2. Prelaunch
      1. Bug Reporting
      2. Metrics
      3. Quality Assurance Testing
      4. Marketing
    3. Uploading and Launching
      1. App Details
      2. Uploading to the App Store
      3. Some Things to Watch Postlaunch
    4. Where to Go Next
      1. Websites
      2. Developer Groups and Conferences
      3. Other Social Media
    5. Summary
    6. Challenges
  27. Index