iOS Programming: The Big Nerd Ranch Guide, 7th Edition

Book description

Updated for Xcode 11, Swift 5, and iOS 13, iOS Programming: The Big Nerd Ranch Guide leads you through the essential concepts, tools, and techniques for developing iOS applications. After completing this book, you will have the know-how and the confidence you need to tackle iOS projects of your own.

 

Based on Big Nerd Ranch’s popular iOS training and its well-tested materials and methodology, this bestselling guide teaches iOS concepts and coding in tandem. The result is instruction that is relevant and useful.

 

Throughout the book, the authors explain what’s important and share their insights into the larger context of the iOS platform. You get a real understanding of how iOS development works, the many features that are available, and when and where to apply what you’ve learned.

Table of contents

  1. Title Page
  2. Acknowledgments
  3. Table of Contents
  4. Introduction
    1. Prerequisites
    2. What Has Changed in the Seventh Edition?
    3. Our Teaching Philosophy
    4. How to Use This Book
    5. Using an eBook
    6. How This Book Is Organized
    7. Style Choices
      1. Typographical conventions
    8. Necessary Hardware and Software
  5. 1. A Simple iOS Application
    1. Creating an Xcode Project
    2. Model-View-Controller
    3. Designing Quiz
    4. Interface Builder
    5. Building the Interface
      1. Creating view objects
      2. Configuring view objects
      3. Running on the simulator
      4. A brief introduction to Auto Layout
      5. Making connections
        1. Declaring outlets
        2. Setting outlets
        3. Defining action methods
        4. Setting targets and actions
        5. Summary of connections
    6. Creating the Model Layer
      1. Implementing action methods
      2. Loading the first question
    7. Building the Finished Application
    8. Application Icons
    9. Launch Screen
    10. For the More Curious: Running an Application on a Device
  6. 2. The Swift Language
    1. Types in Swift
    2. Using Standard Types
      1. Inferring types
      2. Specifying types
        1. Number and Boolean types
        2. Collection types
      3. Literals and subscripting
      4. Initializers
      5. Properties
      6. Instance methods
    3. Optionals
      1. Subscripting dictionaries
    4. Loops and String Interpolation
    5. Enumerations and the Switch Statement
      1. Enumerations and raw values
    6. Closures
    7. Exploring Apple’s Swift Documentation
  7. 3. Views and the View Hierarchy
    1. View Basics
    2. The View Hierarchy
    3. Creating a New Project
    4. Views and Frames
      1. Customizing the labels
    5. The Auto Layout System
      1. The alignment rectangle and layout attributes
      2. Constraints
      3. Adding constraints in Interface Builder
      4. Intrinsic content size
      5. Misplaced views
      6. Adding more constraints
    6. Challenges
    7. Bronze Challenge: More Auto Layout Practice
    8. Silver Challenge: Adding a Gradient Layer
    9. Gold Challenge: Spacing Out the Labels
    10. For the More Curious: Retina Display
  8. 4. View Controllers
    1. The View of a View Controller
    2. Setting the Initial View Controller
    3. Tab Bar Controllers
      1. Tab bar items
    4. Loaded and Appearing Views
      1. Refactoring in Xcode
      2. Accessing subviews
    5. Interacting with View Controllers and Their Views
    6. Bronze Challenge: Another Tab
    7. Silver Challenge: Different Background Colors
  9. 5. Programmatic Views
    1. Creating a View Programmatically
    2. Programmatic Constraints
      1. Anchors
      2. Activating constraints
      3. Layout guides
      4. Margins
      5. Explicit constraints
    3. Programmatic Controls
    4. Bronze Challenge: Points of Interest
    5. Silver Challenge: Rebuild the Conversion Interface
    6. For the More Curious: NSAutoresizingMaskLayoutConstraint
  10. 6. Text Input and Delegation
    1. Text Editing
      1. Keyboard attributes
      2. Responding to text field changes
      3. Dismissing the keyboard
    2. Implementing the Temperature Conversion
      1. Number formatters
    3. Delegation
      1. Conforming to a protocol
      2. Using a delegate
      3. More on protocols
    4. Bronze Challenge: Disallow Alphabetic Characters
    5. Silver Challenge: Displaying the User’s Region
  11. 7. Internationalization and Localization
    1. Internationalization
      1. Formatters
      2. Base internationalization
      3. Preparing for localization
    2. Localization
      1. NSLocalizedString and strings tables
    3. Bronze Challenge: Another Localization
    4. For the More Curious: Bundle’s Role in Internationalization
    5. For the More Curious: Importing and Exporting as XLIFF
  12. 8. Debugging
    1. A Buggy Project
    2. Debugging Basics
      1. Interpreting console messages
      2. Fixing the first bug
      3. Caveman debugging
    3. The Xcode Debugger: LLDB
      1. Setting breakpoints
      2. Stepping through code
      3. The LLDB console
  13. 9. UITableView and UITableViewController
    1. Beginning the LootLogger Application
    2. UITableViewController
      1. Subclassing UITableViewController
    3. Creating the Item Class
      1. Custom initializers
    4. UITableView’s Data Source
      1. Giving the controller access to the store
      2. Implementing data source methods
    5. UITableViewCells
      1. Creating and retrieving UITableViewCells
      2. Reusing UITableViewCells
    6. Editing Table Views
      1. Editing mode
      2. Adding rows
      3. Deleting rows
      4. Moving rows
    7. Design Patterns
    8. Bronze Challenge: Sections
    9. Silver Challenge: Constant Rows
    10. Gold Challenge: Favorite Items
  14. 10. Subclassing UITableViewCell
    1. Creating ItemCell
    2. Exposing the Properties of ItemCell
    3. Using ItemCell
    4. Dynamic Cell Heights
    5. Dynamic Type
      1. Responding to user changes
    6. Bronze Challenge: Cell Colors
    7. Silver Challenge: Long Item Names
  15. 11. Stack Views
    1. Using UIStackView
      1. Implicit constraints
        1. Content hugging priorities
        2. Content compression resistance priorities
      2. Stack view distribution
      3. Nested stack views
      4. Stack view spacing
    2. Segues
    3. Hooking Up the Content
    4. Passing Data Around
    5. Bronze Challenge: More Stack Views
  16. 12. Navigation Controllers
    1. UINavigationController
    2. Navigating with UINavigationController
    3. Appearing and Disappearing Views
    4. Dismissing the Keyboard
      1. Event handling basics
      2. Dismissing by pressing the Return key
      3. Dismissing by tapping elsewhere
    5. UINavigationBar
      1. Adding buttons to the navigation bar
    6. Bronze Challenge: Displaying a Number Pad
    7. Silver Challenge: A Different Back Button Title
    8. Gold Challenge: Pushing More View Controllers
  17. 13. Saving, Loading, and Scene States
    1. Codable
    2. Property Lists
    3. Error Handling
    4. Application Sandbox
      1. Constructing a file URL
    5. Scene States and Transitions
    6. Persisting the Items
      1. Notification center
      2. Saving the Items
      3. Loading the Items
    7. Bronze Challenge: Throwing Errors
    8. Gold Challenge: Support Multiple Windows
    9. For the More Curious: Manually Conforming to Codable
    10. For the More Curious: Scene State Transitions
    11. For the More Curious: The Application Bundle
  18. 14. Presenting View Controllers
    1. Adding a Camera Button
    2. Alert Controllers
    3. Presentation Styles
  19. 15. Camera
    1. Displaying Images and UIImageView
    2. Taking Pictures and UIImagePickerController
      1. Creating a UIImagePickerController
      2. Setting the image picker’s delegate
      3. Presenting the image picker modally
      4. Permissions
      5. Saving the image
    3. Creating ImageStore
    4. Giving View Controllers Access to the Image Store
    5. Creating and Using Keys
    6. Persisting Images to Disk
    7. Loading Images from the ImageStore
    8. Bronze Challenge: Editing an Image
    9. Silver Challenge: Removing an Image
    10. For the More Curious: Navigating Implementation Files
      1. // MARK:
  20. 16. Adaptive Interfaces
    1. Size Classes
      1. Modifying traits for a specific size class
    2. Adapting to Dark Mode
      1. Adding colors to the Asset Catalog
      2. Using custom dynamic colors
    3. Bronze Challenge: Stacked Text Field and Labels
  21. 17. Extensions and Container View Controllers
    1. Starting Mandala
      1. Creating the model types
      2. Adding resources to the Asset Catalog
    2. Extensions
    3. Creating a custom container view controller
      1. Creating the MoodSelectionViewController
      2. Creating the MoodListViewController
      3. Handling the embed segue
  22. 18. Custom Controls
    1. Creating a Custom Control
      1. Relaying actions
    2. Using the Custom Control
    3. Updating the Interface
    4. Adding the Highlight View
    5. Bronze Challenge: More Access Control
  23. 19. Controlling Animations
    1. Property Animators
      1. Basic animations
      2. Timing functions
      3. Spring animations
    2. Animating Colors
    3. Animating a Button
  24. 20. Web Services
    1. Starting the Photorama Application
    2. Building the URL
      1. Formatting URLs and requests
      2. URLComponents
    3. Sending the Request
      1. URLSession
    4. Modeling the Photo
    5. JSON Data
      1. JSONDecoder and JSONEncoder
      2. Parsing JSON data
    6. Enumerations and Associated Values
    7. Passing the Photos Around
    8. Downloading and Displaying the Image Data
    9. The Main Thread
    10. Bronze Challenge: Printing the Response Information
    11. Silver Challenge: Fetch Recent Photos from Flickr
    12. For the More Curious: HTTP
  25. 21. Collection Views
    1. Displaying the Grid
    2. Collection View Data Source
    3. Customizing the Layout
    4. Creating a Custom UICollectionViewCell
    5. Downloading the Image Data
      1. Image caching
    6. Navigating to a Photo
    7. Bronze Challenge: Horizontal Scrolling
    8. Silver Challenge: Updated Item Sizes
  26. 22. Core Data
    1. Object Graphs
    2. Entities
      1. Modeling entities
      2. NSManagedObject and subclasses
    3. NSPersistentContainer
    4. Updating Items
      1. Inserting into the context
      2. Saving changes
    5. Updating the Data Source
      1. Fetch requests and predicates
    6. Silver Challenge: Photo View Count
    7. For the More Curious: The Core Data Stack
      1. NSManagedObjectModel
      2. NSPersistentStoreCoordinator
      3. NSManagedObjectContext
  27. 23. Core Data Relationships
    1. Relationships
    2. Adding Tags to the Interface
    3. Background Tasks
    4. Silver Challenge: Favorites
  28. 24. Accessibility
    1. VoiceOver
      1. Testing VoiceOver
      2. Accessibility in Photorama
    2. Bronze Challenge: VoiceOver Pronunciation
  29. 25. Afterword
    1. What to Do Next
    2. Shameless Plugs
  30. Index

Product information

  • Title: iOS Programming: The Big Nerd Ranch Guide, 7th Edition
  • Author(s): Christian Keur, Aaron Hillegass
  • Release date: April 2020
  • Publisher(s): Big Nerd Ranch Guides
  • ISBN: 9780135264843