You are previewing Swift iOS 24-Hour Trainer.
O'Reilly logo
Swift iOS 24-Hour Trainer

Book Description

Jump into the app development world with confidence!

iOS Swift 24-Hour Trainer combines book and video lessons in Apple's Swift programming language to prepare you to build iPhone and iPad apps—and distribute them through the Appstore. First, this approachable text covers the fundamentals of Swift by introducing you to iOS development in this language, and presenting best practices for setting up a development environment and using variables, statements, expressions, operators, functions, and closures. Next, you explore common tasks, such as alert views, table views, and collection views. You then deepen your knowledge of Swift by considering network programming and local data storage. Finally, this engaging resource dives into slightly more advanced concepts, such as tab bars, web views, the accelerometer, camera, photo library, Google maps, and core location.

Swift was designed by Apple to incorporate modern scripting features while offering simpler, cleaner syntax than Objective-C to maintain a minimal and easy to read style. This more expressive code offers numerous key features, such as closures unified with function pointers, tuples and multiple value returns, generics, and functional programming patterns.

  • Learn how to obtain a device UDID
  • Test your applications on an actual device, so you can see your work in action
  • Distribute your applications outside of the App store, allowing you to test your work with real users
  • Review common reasons why apps are rejected by Apple to strengthen your case when submitting your apps for distribution

iOS Swift 24-Hour Trainer is an essential guide to Apple's Swift programming language for beginning programmers.

Table of Contents

  1. Introduction
    1. Who This Book Is For
    2. What This Book Covers
    3. How This Book Is Structured
    4. Instructional Videos
    5. Conventions
    6. Errata
  2. Section I: Hello iOS!
    1. Lesson 1: Hello iOS!
      1. iOS Developer Essentials
      2. TRY IT
    2. Lesson 2: A Tour of Xcode and the iOS Simulator
      1. The Welcome Screen
      2. Creating a New Project
      3. An Overview of the Xcode IDE
      4. Features of the iOS Simulator
      5. Try It
    3. Lesson 3: Introducing Swift
      1. Introducing Xcode Playgrounds
      2. Constants and Variables
      3. Data Types
      5. Strings
      6. Tuples
      7. Optionals
      8. Control Flow Statements
      9. Control Transfer Statements
      10. Try It
    4. Lesson 4: Functions
      1. Declaring Functions
      2. Parameters and Return Values
      3. Try It
    5. Lesson 5: Closures
      1. Function Types
      2. Closure Types
      3. Try It
    6. Lesson 6: Error Handling
      1. The ErrorType Protocol
      2. Throwing and Catching Errors
      3. Try It
    7. Lesson 7: Object-Oriented Programming with Swift
      1. Creating Classes with Swift
      2. Properties
      3. Methods
      4. Instantiating Objects
      5. Inheritance
      6. Computed Properties
      7. Enumerations
      8. Protocols
      9. Try It
    8. Lesson 8: Supporting Multiple Device Types
      1. Device Differences
      2. The Universal XCode Template
      3. Try It
    9. Lesson 9: Introduction to UIKit and Adaptive Layout
      1. Introducing the UIKit Framework
      2. Basic Constraints
      3. Previewing Your Layout
      4. Creating Outlets
      5. Creating Actions
      6. Try It
    10. Lesson 10: Introduction to Storyboards
      1. Try It
  3. Section II: More iOS Development
    1. Lesson 11: Handling User Input
      1. Text Fields
      2. Text Views
      3. Try It
    2. Lesson 12: Alert Views and Action Sheets
      1. Alert Views
      2. Action Sheets
      3. Try It
    3. Lesson 13: Adding Images to Your View
      1. The UIImage Class
      2. The UIImageView Class
      3. Try It
    4. Lesson 14: Pickers
      1. Date Pickers
      2. Custom Pickers
      3. Try It
    5. Lesson 15: Navigation Controllers
      1. Adding a Navigation Controller to a Storyboard
      2. The Navigation Controller Interface
      3. Try It
    6. Lesson 16: Table Views
      1. Table View Appearance
      2. Creating a Table View with Interface Builder
      3. Try It
    7. Lesson 17: Collection Views
      1. Creating a Collection View with Interface Builder
      2. Collection View Cells
      3. Collection View Delegate and Data Source
      4. Try It
    8. Lesson 18: Tab Bars and Toolbars
      1. Creating a Tab Bar Controller
      2. Toolbars
      3. Try It
    9. Lesson 19: Creating Views That Scroll
      1. The UIScrollView Class
      2. Scroll Views and Text Fields
      3. Try It
    10. Lesson 20: Popovers and Modal Views
      1. Popovers
      2. Modal Views
      3. Try It
    11. Lesson 21: Touches and Gestures
      1. Touch Events
      2. Gesture Recognizers
      3. Try It
  4. Section III: Storing Data and Network Programming
    1. Lesson 22: Property Lists
      1. Creating Property Lists
      2. Reading Property Lists
      3. Try It
    2. Lesson 23: Application Settings
      1. Adding a Settings Bundle
      2. Reading Preferences with Code
      3. Try It
    3. Lesson 24: Introduction to iCloud Storage
      1. Basic Concepts
      2. Preparing to Use the iCloud Storage APIs
      3. Checking for Service Availability
      4. Using iCloud Document Storage
      5. Try It
    4. Lesson 25: Introduction to CloudKit
      1. Containers, Databases, and Records
      2. Development and Production Environments
      3. The CloudKit Dashboard
      4. Preparing to Use CloudKit
      5. Common Operations
      6. Try It
    5. Lesson 26: Introduction to Core Data
      1. Basic Concepts
      2. Adding Core Data to a Project
      3. Instantiating Core Data Objects
      4. Writing Managed Objects
      5. Reading Managed Objects
      6. Try It
    6. Lesson 27: Consuming RESTful JSON Web Services
      1. Types of Web Services
      2. JSON and NSJSONSerialization
      3. NSURLSession and Application Transport Security
      4. Try It
  5. Section IV: Beyond the Basics
    1. Lesson 28: Social Media Integration
      1. The Share Sheet
      2. Try It
    2. Lesson 29: Where Am I? Introducing Core Location
      1. Permissions
      2. Accuracy
      3. Receiving Location Updates
      4. Handling Errors and Checking Hardware Availability
      5. Geocoding and Reverse Geocoding
      6. Obtaining Compass Headings
      7. Try It
    3. Lesson 30: Introduction to Map Kit
      1. Adding Annotations
      2. Accessory Views
      3. Try It
    4. Lesson 31: Using the Camera and Photo Library
      1. Selecting the Image Source
      2. Presenting the Image Picker
      3. Try It
    5. Lesson 32: Introduction to User Interface Testing
      1. Adding Support for UI Testing to Your Project
      2. Anatomy of a Test Case
      3. New Classes for UI Testing
      4. Test Assertions
      5. UI Recording
      6. Waiting for Elements in a UI Test
      7. Try It
    6. Lesson 33: Introduction to Test Driven Development
      1. Adding Support for Unit Testing to Your Project
      2. TDD Techniques
      3. Anatomy of a Test Case
      4. Test Assertions
      5. Try It
  6. Section V: Reference
    1. Appendix A: Testing Your App on a Device
      1. Obtaining and Registering UDIDs
      2. Creating an App ID (Bundle Identifier)
      3. Creating a Development Certificate
      4. Creating a Provisioning Profile
      5. Configuring Your Project
    2. Appendix B: Beta Testing with TestFlight
      1. Preparing a Distribution Build for TestFlight
      2. Internal and External Testers
    3. Appendix C: App Store Distribution
      1. Creating an Application Profile
      2. Preparing and Uploading the Application Binary
      3. Submitting the App for Review
  7. End User License Agreement