O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning to Build iOS Apps with Swift: A Hands-On Guide to Swift App Development

Book Description

This is the Rough Cut version of the printed book.

This hands-on guide to iOS development with Swift is designed to support programmers with all levels of experience, including those moving from Objective-C or other platforms, and those learning to program for the first time.

Whatever your experience, you'll learn hands-on, step-by-step, as you build a wide variety of practical iOS apps. If you're a beginner, modular chapter sidebars concisely introduce all the core programming concepts you'll need. If you're more experienced, these sections offer a helpful review, often including helpful comparisons with Objective-C and other languages — and they're designed to be easily "skippable" if you don't need them. You'll start by working on smaller "proof-of-concepts" apps in the earlier chapters of the book before moving on to working on a more extensive project in later chapters.  

iOS programming instructor Randy Scovil guides you through:

  • Understanding Swift and its advantages

  • Setting up your development environment, and getting started quickly

  • Using Swift's "Playgrounds" to get instant feedback on your code

  • Working with View Controllers, the MVC pattern, basic and advanced UI Controls, and Storyboards

  • Incorporating interactivity into your app

  • Using navigation and tab bar controllers

  • Mastering Table and Collection Views, from the basics to advanced techniques

  • Getting data via web services, and storing it on a device or in the cloud via CloudKit

  • Implementing Scroll and Touch events

  • Getting started with custom drawing and SpriteKit game development

  • Deploying your app to test devices and to Apple's App Store

  • Throughout, Scovil draws on his experience teaching iOS developers at all levels of experience. He anticipates and answers your most common questions, and guides you up the learning curve while consistently keeping you engaged with interesting and achievable tasks. The result: a powerful "success cycle" in which your growing skills reinforce your confidence and accelerate your progress. It's the "Swiftest" way to master Swift!

    Table of Contents

    1. Contents
    2. 1. Getting Started
      1. A Word on Learning iOS
      2. Key Features of This Book
      3. The Tools You’ll Be Using
      4. Installing Xcode
      5. Creating an iOS App Project
      6. Getting Familiar With Xcode
      7. Parts of an iOS App Project
      8. Running an App in the iOS Simulator
      9. Helpful Xcode Resources
      10. Summary
      11. Challenges
    3. 2. Introducing Swift and Playgrounds
      1. A (The) Brief History of Swift
      2. Key Swift Goals and Concepts
      3. Using Playgrounds
      4. Getting Results
      5. Declaring Your Intentions
      6. Figure It Out
      7. Summary
      8. Challenges
    4. 3. View Controllers, UI Controls, and Storyboards
      1. A Quick Review of iOS App Projects
      2. View Controllers
      3. Model-View Controller
      4. Custom View Controllers
      5. Building the User Interface
      6. View Controllers and Storyboards
      7. Summary
      8. Challenges
    5. 4. Making Your App Interactive
      1. Introducing UIControls
      2. Responding to User Events with Target-Action
      3. Sidebar: Conditional Statements
      4. Implementing Multiple Results
      5. Handling Multiple Controls
      6. Summary
      7. Challenges
    6. 5. Using More Advanced UIControls
      1. Selecting Values with UISlider
      2. Using UISegmentedControl for Multiple, Exclusive Options
      3. Delegation and Protocols
      4. Sidebar for Experienced Developers: Protocols and Other Languages
      5. Inputting Text with UITextField
      6. Another Type of Delegation – Data Sources
      7. Sidebar for Beginning Developers: Arrays
      8. UIPickerView - A View, A Control, or Both?
      9. Tip: The UICatalog Sample App
      10. Summary
      11. Challenges
    7. 6. Multiple Views with Navigation Controllers and Tab Bar Controllers
      1. Navigation Controllers
      2. Connecting Controllers – Root View Controllers and Segues
      3. Exchanging Data between View Controllers
      4. Unwind (Exit) Segues
      5. Tab Bar Controllers
      6. Summary
      7. Challenges
    8. 7. Table Views, Part 1
      1. Table Views And Table View Controllers
      2. Populating the Table with a Data Source
      3. Table View Cells
      4. Implementing cellForRowAtIndexPath()
      5. Changing the Contents of the Data Store
      6. Summary
      7. Challenge
    9. 8. Representing Data in Swift
      1. Basic Data Types
      2. Strings and Characters
      3. Collections
      4. Enumerations
      5. Structures
      6. Value and Reference Types
      7. Classes
      8. Optionals
      9. Summary
      10. Challenges