iOS 12 Programming for Beginners - Third Edition

Book description

Begin your iOS 12 app development journey with this practical guide

Key Features

  • Kick-start your iOS programming career and have fun building iOS apps of your choice
  • Get to grips with Xcode 10 and Swift 4.2, the building blocks of iOS development
  • Discover the latest features of iOS 12 - SiriKit, notifications, and much more

Book Description

Want to build iOS 12 applications from scratch with the latest Swift 4.2 language and Xcode 10 by your side? Forget sifting through tutorials and blog posts; this book is a direct route to iOS development, taking you through the basics and showing you how to put principles into practice. Take advantage of this developer-friendly guide and start building applications that may just take the App Store by storm!

If you're already an experienced programmer, you can jump right in and learn the latest iOS 12 features. For beginners, this book starts by introducing you to iOS development as you learn Xcode and Swift. You'll also study advanced iOS design topics, such as gestures and animations, to give your app the edge. You'll explore the latest Swift 4.2 and iOS 12 developments by incorporating new features, such as the latest in notifications, custom-UI notifications, maps, and the recent additions in Sirikit. The book will guide you in using TestFlight to quickly get to grips with everything you need to get your project on the App Store.

By the end of this book, you'll be ready to start building your own cool iOS applications confidently.

What you will learn

  • Explore the distinctive design principles that define the iOS user experience
  • Navigate panels within an Xcode project
  • Use the latest Xcode asset catalogue of Xcode 10
  • Create a playgrounds project within your projects and understand how Ranges and Control flow work
  • Study operations with integers and work your way through if statements
  • Build a responsive UI and add privacy to your custom-rich notifications
  • Set up Sirikit to add voice for Siri shortcuts
  • Collect valuable feedback with TestFlight before releasing your apps on the App Store

Who this book is for

This book is for you if you are completely new to Swift, iOS, or programming and want to make iOS applications. However, you'll also find this book useful if you're an experienced programmer looking to explore the latest iOS 12 features.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. iOS 12 Programming for Beginners Third Edition
  3. Packt Upsell
    1. Why subscribe?
    2. Packt.com
  4. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Getting Familiar with Xcode
    1. Getting started
    2. The Xcode interface
      1. Navigator panel
      2. Standard editor
      3. Utilities panel
      4. Debug panel
      5. Toolbar
      6. Generic iOS device
      7. iOS device
      8. Connecting wirelessly
      9. Window pane controls
    3. Summary
  7. Building a Foundation with Swift
    1. Playgrounds – an interactive coding environment
    2. Data types – where it all starts
      1. String
      2. Integer data type
      3. Floating-point numbers
      4. Booleans
      5. Variables and constants – where data is held
        1. Creating a variable with a string
        2. Creating a variable with an integer (int)
        3. Debug and print() – detecting your bugs
        4. Adding floating-point numbers
        5. Creating a Boolean
        6. Why constants versus variables?
      6. Comments – leaving yourself notes or reminders
    3. Type safety and type inference
      1. Concatenating strings
      2. String interpolation
    4. Operations with our integers
      1. Increment and decrement
      2. Comparison operators
    5. Summary
  8. Building on the Swift Foundation
    1. Creating a Playground project
    2. The if statements – having fun with logic statements
    3. Optionals and optional bindings
      1. Why optionals?
    4. Functions
    5. Summary
  9. Digging Deeper
    1. Creating a Playground project
    2. Ranges
      1. Closed range
      2. Half-closed range
    3. Control flow
      1. The for...in loop
      2. One-sided range
      3. The while loop
      4. The repeat...while loop
    4. Summary
  10. Digging into Collections
    1. Arrays
      1. Creating an empty array
      2. Creating an array with initial values
      3. Creating a mutable array
      4. Adding items to an array
      5. Checking the number of elements in an array
      6. Checking for an empty array
      7. Retrieving a value from an array
      8. Iterating over an array
      9. Removing items from an array
    2. Dictionaries
      1. Creating a dictionary
      2. Adding and updating dictionary elements
      3. Accessing an item in a dictionary
      4. Iterating over dictionary values
      5. Iterating over dictionary keys
      6. Iterating over dictionary keys and values
      7. Checking the number of items in a dictionary
      8. Removing items from a dictionary
    3. Sets
      1. Creating an empty set
      2. Creating a set with an array literal
      3. Creating a mutable set
      4. Adding items to a set
      5. Checking whether a set contains an item
      6. Iterating over a set
      7. Intersecting two sets
      8. Joining two sets
      9. Removing items from a set
    4. Summary
  11. Starting the UI Setup
    1. Useful terms
      1. View Controllers
      2. Table View Controllers
      3. Collection View Controllers
      4. Navigation Controllers
      5. Tab Bar Controllers
      6. Storyboards
      7. Segues
      8. Stack Views
      9. Auto Layout
      10. Model View Controller (MVC)
    2. App tour
      1. The Explore tab
      2. Locations
      3. Restaurant listings
      4. Restaurant detail
      5. The Map tab
    3. Project setup
      1. Creating a new project
    4. Summary
  12. Setting Up the Basic Structure
    1. Starting from scratch
    2. Storyboard setup
      1. Adding our app assets
      2. Storyboards
        1. Creating our launch screen
        2. Adding a Navigation Controller
    3. Summary
  13. Building Our App Structure in Storyboard
    1. Adding a Collection View Controller
    2. Hooking up our outlets
    3. Creating a custom color
    4. Setting up our cell
    5. Section header
    6. Updating the grid
    7. Adding a modal
      1. Updating Bar Button Items
      2. Unwinding our Cancel button
      3. Adding our first Table View
    8. Summary
  14. Finishing Up Our App Structure in Storyboard
    1. Adding our Restaurant List View
    2. Hooking up our outlets
    3. Setting up our cell
    4. Adding the Reviews View
    5. Viewing reviews 
    6. Map Kit View
    7. Summary 
  15. Designing Cells
    1. Setting up the Explore header  
      1. Adding Auto Layout to the Explore header
      2. Setting up the Explore cell
      3. Adding Auto Layout to the Explore cell
    2. Setting up the Restaurant cell
      1. Adding Auto Layout to the Restaurant cell  
      2. The Locations cell 
    3. Summary
  16. Getting Started with the Grid
    1. Understanding the Model View Controller architecture
      1. Getting familiar with the setup
    2. Classes and structures
    3. Controllers and classes
      1. Understanding Collection Views
      2. Creating our controller
      3. Understanding Collection View controllers and Collection View cells
      4. Getting data into Collection View
      5. Understanding the data source
    4. Summary
  17. Getting Data into Our Grid
    1. Model
      1. ExploreData.plist
      2. ExploreItem.swift
      3. ExploreDataManager.swift
    2. Getting data
    3. Connecting to our cell
    4. Hooking up our UI with IBOutlets
    5. Restaurant listing
    6. Summary
  18. Getting Started with the List
    1. Understanding Table Views
    2. Creating our Location View Controller class
    3. Connecting our Table View with our Location View Controller
    4. Digging into our Table View code
    5. Adding the data source and delegate
    6. Adding locations to our Table View
    7. Creating our first property list (plist)
    8. Adding data to our property list
    9. Creating our location data manager
    10. Working with our data manager
    11. Summary
  19. Where Are We?
    1. Setting up map annotations
      1. What is an MKAnnotation?
      2. Creating a restaurant annotation
      3. Creating our Map Data Manager  
      4. Creating a base class 
      5. Refactoring code 
        1. Refactoring ExploreDataManager
    2. Creating and adding annotations
      1. Creating our Map View Controller 
      2. Creating custom annotations
    3. Map to restaurant detail
      1. Creating a storyboard reference
      2. Map to restaurant detail
        1. Passing data to restaurant  detail
    4. Organizing your code
      1. Refactoring ExploreViewController
        1. Using the MARK  comment
        2. Refactoring RestaurantViewController
        3. Refactoring MapViewController
    5. Summary
  20. Working with an API
    1. Creating an API Manager
      1. What is an API?
      2. Understanding a JSON file
      3. Exploring the API Manager file
    2. Location list
      1. Selecting a location
      2. Adding a Header view
      3. Passing a selected location back to Explore View
      4. Unwinding our Done button
      5. Getting the last selected location
      6. Passing location and cuisine to the restaurant list
      7. Creating our restaurant cell class
        1. Setting up restaurant list cell outlets
        2. Creating a restaurant data manager
        3. Handling no data
    3. Summary 
  21. Displaying Data in Restaurant Detail
    1. Displaying data in our static Table View
    2. Summary
  22. Foodie Reviews
    1. Getting started with reviews
    2. Displaying ratings in our custom UIControl
    3. Adding our touch events
    4. Setting up the unwind segues
    5. Creating our ReviewFormController 
    6. Summary 
  23. Working with Photo Filters
    1. Understanding filters 
    2. Creating our filter scroller 
      1. Creating a filter cell
      2. Creating our PhotoFilterViewController
    3. Getting permission 
    4. Summary
  24. Understanding Core Data
    1. What is Core Data?
    2. Creating a data model 
      1. Entity autogeneration
      2. The RestaurantPhoto Entity
      3. Review item
      4. Core Data manager 
    3. Summary
  25. Saving Reviews
    1. Saving reviews 
    2. Saving photos 
    3. Adding an overall rating 
    4. Summary 
  26. Universal
    1. Explore
    2. Location listing 
    3. Restaurant listing 
      1. Updating the restaurant detail page
    4. Summary
  27. iMessages
    1. Understanding iMessages
      1. Creating our extension
      2. Updating our assets 
    2. Creating a framework 
      1. Connecting your message cell 
    3. Showing restaurants 
      1. iMessage crashing 
      2. Sending reservations
    4. Summary
  28. Notifications
    1. Starting with the basics 
      1. Getting permission 
      2. Setting up notifications 
      3. Showing notifications 
    2. Customizing our notifications
      1. Deliver quietly (iOS 12 feature)
      2. Embedding images (iOS 10 feature)
      3. Adding buttons
      4. Grouped notifications (iOS 11)
      5. Summary and hidden text (iOS 12)
      6. Custom UI in notifications 
      7. Custom Notification Settings (iOS 12)
    3. Summary 
  29. SiriKit
    1. Using Siri Shortcuts
      1. Siri voice shortcut
      2. Understanding SiriKit
      3. Supported intents
      4. Enabling Siri's capabilities
      5. Creating users
      6. Updating our intent handler
      7. Testing Siri
    2. Summary
  30. Beta and Store Submission
    1. Creating a bundle identifier
    2. Creating a certificate signing request
    3. Creating production and development certificates
    4. Creating a production provisioning profile
    5. Creating a development provisioning profile
    6. Creating an App Store listing
    7. Creating an archive build
    8. Internal and external testing
      1. Internal testing
      2. External testing
    9. Summary
  31. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: iOS 12 Programming for Beginners - Third Edition
  • Author(s): Craig Clayton
  • Release date: December 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781789348668