1. The Scope of This Book
2. Some Swift Conventions
3. Versions
4. Acknowledgments
5. From the Programming iOS 4 Preface
6. Conventions Used in This Book
7. Using Code Examples
8. Safari® Books Online
9. How to Contact Us
1. Views
1.1. The Window
1.2. Experimenting With Views
1.3. Subview and Superview
1.4. Visibility and Opacity
1.5. Frame
1.6. Bounds and Center
1.7. Window Coordinates and Screen Coordinates
1.8. Transform
1.9. Trait Collections and Size Classes
1.10. Layout
1.10.1. Autoresizing
1.10.2. Autolayout
1.10.3. Configuring Layout in the Nib
1.10.4. View Debugging, Previewing, and Designing
1.10.5. View Events Related to Layout
2. Drawing
2.1. Images and Image Views
2.1.1. Image Files
2.1.2. Image Views
2.1.3. Resizable Images
2.1.4. Image Rendering Mode
2.1.5. Reversible Images
2.2. Graphics Contexts
2.3. UIImage Drawing
2.4. CGImage Drawing
2.5. Snapshots
2.6. CIFilter and CIImage
2.7. Blur and Vibrancy Views
2.8. Drawing a UIView
2.9. Graphics Context Settings
2.10. Paths and Shapes
2.11. Clipping
2.12. Gradients
2.13. Colors and Patterns
2.14. Graphics Context Transforms
2.15. Shadows
2.16. Erasing
2.17. Points and Pixels
2.18. Content Mode
3. Layers
3.1. View and Layer
3.2. Layers and Sublayers
3.2.1. Manipulating the Layer Hierarchy
3.2.2. Positioning a Sublayer
3.2.3. CAScrollLayer
3.2.4. Layout of Sublayers
3.3. Drawing in a Layer
3.3.1. Content Resizing and Positioning
3.3.2. Layers that Draw Themselves
3.4. Transforms
3.4.1. Depth
3.5. Shadows, Borders, and Masks
3.6. Layer Efficiency
3.7. Layers and Key–Value Coding
4. Animation
4.1. Drawing, Animation, and Threading
4.2. Image View and Image Animation
4.3. View Animation
4.3.1. View Animation Options
4.3.2. Canceling a View Animation
4.3.3. Custom Animatable View Properties
4.3.4. Springing View Animation
4.3.5. Keyframe View Animation
4.3.6. Transitions
4.4. Implicit Layer Animation
4.4.1. Animation Transactions
4.4.2. Media Timing Functions
4.5. Core Animation
4.5.1. CABasicAnimation and Its Inheritance
4.5.2. Using a CABasicAnimation
4.5.3. Springing Animation
4.5.4. Keyframe Animation
4.5.5. Making a Property Animatable
4.5.6. Grouped Animations
4.5.7. Freezing an Animation
4.5.8. Transitions
4.5.9. Animations List
4.6. Actions
4.6.1. What an Action Is
4.6.2. Action Search
4.6.3. Hooking Into the Action Search
4.6.4. Making a Custom Property Implicitly Animatable
4.6.5. Nonproperty Actions
4.7. Emitter Layers
4.8. CIFilter Transitions
4.9. UIKit Dynamics
4.9.1. The Dynamics Stack
4.9.2. Custom Behaviors
4.9.3. Animator and Behaviors
4.10. Motion Effects
4.11. Animation and Autolayout
5. Touches
5.1. Touch Events and Views
5.2. Receiving Touches
5.3. Restricting Touches
5.4. Interpreting Touches
5.5. Gesture Recognizers
5.5.1. Gesture Recognizer Classes
5.5.2. Gesture Recognizer Conflicts
5.5.3. Subclassing Gesture Recognizers
5.5.4. Gesture Recognizer Delegate
5.5.5. Gesture Recognizers in the Nib
5.6. Touch Delivery
5.6.1. Hit-Testing
5.6.2. Initial Touch Event Delivery
5.6.3. Gesture Recognizer and View
5.6.4. Touch Exclusion Logic
5.6.5. Gesture Recognition Logic
5.6.6. Touches and the Responder Chain
6. View Controllers
6.1. View Controller Responsibilities
6.2. View Controller Hierarchy
6.3. View Controller Creation
6.4. How a View Controller Gets Its View
6.4.1. Manual View
6.4.2. Generic Automatic View
6.4.3. View in a Separate Nib
6.4.4. Nib-Instantiated View Controller
6.4.5. Storyboard-Instantiated View Controller
6.5. View Resizing
6.5.1. View Size in the Nib Editor
6.5.2. Bars and Underlapping
6.5.3. Resizing Events
6.5.4. Rotation
6.6. Presented View Controller
6.6.1. Presenting a View
6.6.2. Communication With a Presented View Controller
6.6.3. Presented View Animation
6.6.4. Presentation Styles
6.6.5. Adaptive Presentation
6.6.6. Rotation of a Presented View
6.7. Tab Bar Controller
6.7.1. Tab Bar Items
6.7.2. Configuring a Tab Bar Controller
6.8. Navigation Controller
6.8.1. Bar Button Items
6.8.2. Navigation Items and Toolbar Items
6.8.3. Configuring a Navigation Controller
6.9. Custom Transition
6.9.1. Noninteractive Custom Transition Animation
6.9.2. Interactive Custom Transition Animation
6.9.3. Custom Presented View Controller Transition
6.9.4. Transition Coordinator
6.10. Page View Controller
6.10.1. Preparing a Page View Controller
6.10.2. Page View Controller Navigation
6.10.3. Other Page View Controller Configurations
6.11. Container View Controllers
6.11.1. Adding and Removing Children
6.11.2. Container View Controllers, Traits, and Resizing
6.12. Storyboards
6.12.1. Triggered Segues
6.12.2. Container Views and Embed Segues
6.12.3. Storyboard References
6.12.4. Unwind Segues
6.13. View Controller Lifetime Events
6.13.1. Incoherencies in View Controller Events
6.13.2. Appear and Disappear Events
6.13.3. Event Forwarding to a Child View Controller
6.14. View Controller Memory Management
6.15. State Restoration
6.15.1. How to Test State Restoration
6.15.2. Participating in State Restoration
6.15.3. Restoration ID, Identifier Path, and Restoration Class
6.15.4. Restoring View Controller State
6.15.5. Restoration Order of Operations
6.15.6. Restoration of Other Objects
6.15.7. Snapshot Suppression
7. Scroll Views
7.1. Creating a Scroll View in Code
7.1.1. Manual Content Size
7.1.2. Automatic Content Size With Autolayout
7.1.3. Using a Content View
7.2. Scroll View in a Nib
7.3. Scrolling
7.3.1. Paging
7.3.2. Tiling
7.4. Zooming
7.4.1. Zooming Programmatically
7.4.2. Zooming with Detail
7.5. Scroll View Delegate
7.6. Scroll View Touches
7.7. Floating Scroll View Subviews
7.8. Scroll View Performance
8. Table Views and Collection Views
8.1. Table View Cells
8.1.1. Built-In Cell Styles
8.1.2. Registering a Cell Class
8.1.3. Custom Cells
8.2. Table View Data
8.2.1. The Three Big Questions
8.2.2. Reusing Cells
8.2.3. Table View Sections
8.2.4. Refreshing Table View Data
8.2.5. Variable Row Heights
8.3. Table View Cell Selection
8.3.1. Managing Cell Selection
8.3.2. Responding to Cell Selection
8.3.3. Navigation From a Table View
8.3.4. Cell Choice and Static Tables
8.4. Table View Scrolling and Layout
8.5. Table View State Restoration
8.6. Table View Searching
8.6.1. Configuring a Search Controller
8.6.2. Using a Search Controller
8.7. Table View Editing
8.7.1. Deleting Cells
8.7.2. Custom Action Buttons
8.7.3. Editable Content in Cells
8.7.4. Inserting Cells
8.7.5. Rearranging Cells
8.7.6. Dynamic Cells
8.8. Table View Menus
8.9. Collection Views
8.9.1. Collection View Classes
8.9.2. Using a Collection View
8.9.3. Custom Collection View Layouts
8.9.4. Switching Layouts
8.9.5. Collection Views and UIKit Dynamics
9. iPad Interface
9.1. Popovers
9.1.1. Preparing a Popover
9.1.2. Popover Presentation, Dismissal, and Delegate
9.1.3. Adaptive Popovers
9.1.4. Popover Segues
9.1.5. Popover Presenting a View Controller
9.2. Split Views
9.2.1. Expanded Split View Controller (iPad)
9.2.2. Collapsed Split View Controller (iPhone)
9.2.3. Expanding Split View Controller (iPhone 6 Plus)
9.2.4. Customizing a Split View Controller
9.2.5. Setting the Collapsed State
9.2.6. Replacing the Child View Controllers
9.2.7. Split View Controller in a Storyboard
9.3. iPad Multitasking
10. Text
10.1. Fonts and Font Descriptors
10.1.1. Fonts
10.1.2. Font Descriptors
10.2. Attributed Strings
10.2.1. Attributed String Attributes
10.2.2. Making an Attributed String
10.2.3. Modifying and Querying an Attributed String
10.2.4. Custom Attributes
10.2.5. Drawing and Measuring an Attributed String
10.3. Labels
10.3.1. Number of Lines
10.3.2. Wrapping and Truncation
10.3.3. Resizing a Label to Fit Its Text
10.3.4. Customized Label Drawing
10.4. Text Fields
10.4.1. Summoning and Dismissing the Keyboard
10.4.2. Keyboard Covers Text Field
10.4.3. Configuring the Keyboard
10.4.4. Text Field Delegate and Control Event Messages
10.4.5. Text Field Menu
10.5. Text Views
10.5.1. Text View as Scroll View
10.5.2. Text View and Keyboard
10.6. Text Kit
10.6.1. Text Container
10.6.2. Alternative Text Kit Stack Architectures
10.6.3. Layout Manager
10.6.4. Text Kit Without a Text View
11. Web Views
11.1. WKWebView
11.1.1. WKWebView Content
11.1.2. Tracking Changes in a WKWebView
11.1.3. WKWebView Navigation
11.1.4. Communicating With a WKWebView Web Page
11.1.5. WKWebView Shortcomings
11.2. Safari View Controller
11.3. Developing Web View Content
12. Controls and Other Views
12.1. UIActivityIndicatorView
12.2. UIProgressView
12.3. UIPickerView
12.4. UISearchBar
12.5. UIControl
12.5.1. UISwitch
12.5.2. UIStepper
12.5.3. UIPageControl
12.5.4. UIDatePicker
12.5.5. UISlider
12.5.6. UISegmentedControl
12.5.7. UIButton
12.5.8. Custom Controls
12.6. Bars
12.6.1. Bar Position and Bar Metrics
12.6.2. Bar Appearance
12.6.3. UIBarButtonItem
12.6.4. UINavigationBar
12.6.5. UIToolbar
12.6.6. UITabBar
12.7. Tint Color
12.8. Appearance Proxy
13. Modal Dialogs
13.1. Alerts and Action Sheets
13.1.1. Alerts
13.1.2. Action Sheets
13.1.3. Dialog Alternatives
13.2. Local Notifications
13.2.1. Registering a Notification
13.2.2. Scheduling a Notification
13.2.3. Hearing About a Local Notification
13.2.4. Today Extensions
13.3. Activity Views
13.3.1. Presenting an Activity View
13.3.2. Custom Activities
13.3.3. Action Extensions
13.3.4. Share Extensions
14. Audio
14.1. System Sounds
14.2. Audio Session
14.2.1. Activation
14.2.2. Ducking
14.2.3. Interruptions
14.2.4. Secondary Audio
14.2.5. Routing Changes
14.3. Audio Player
14.4. Remote Control of Your Sound
14.5. Playing Sound in the Background
14.6. AVAudioEngine
14.7. MIDI Playback
14.8. Speech Synthesis
14.9. Further Topics in Sound
15. Video
15.1. AVPlayerViewController
15.1.1. Other AVPlayerViewController Properties
15.1.2. Picture-in-Picture
15.2. Introducing AV Foundation
15.2.1. Some AV Foundation Classes
15.2.2. Things Take Time
15.2.3. Time is Measured Oddly
15.2.4. Constructing Media
15.2.5. Synchronizing Animation With Video
15.2.6. AVPlayerLayer
15.2.7. Further Exploration of AV Foundation
15.3. UIVideoEditorController
16. Music Library
16.1. Exploring the Music Library
16.1.1. Querying the Music Library
16.1.2. Persistence and Change in the Music Library
16.2. Music Player
16.3. MPVolumeView
16.4. Playing Songs With AV Foundation
16.5. Media Picker
17. Photo Library and Image Capture
17.1. Photo Library Authorization
17.2. Choosing From the Photo Library
17.3. Photos Framework
17.3.1. Querying the Photo Library
17.3.2. Modifying the Library
17.3.3. Being Notified of Changes
17.3.4. Displaying Images
17.3.5. Editing Images
17.3.6. Photo Editing Extension
17.4. Using the Camera
17.4.1. Camera Authorization
17.4.2. Using the Camera with UIImagePickerController
17.4.3. Customizing the Image Capture Interface
17.4.4. Image Capture With AV Foundation
18. Contacts
18.1. Contacts Authorization
18.2. Fetching Contact Information
18.3. Saving Contact Information
18.4. Contact Sorting, Groups, and Containers
18.5. Contacts Interface
18.5.1. CNContactPickerViewController
18.5.2. CNContactViewController
19. Calendar
19.1. Calendar Database
19.1.1. Calendar Database Authorization
19.1.2. Calendar Database Contents
19.1.3. Calendar Database Changes
19.1.4. Creating Calendars and Events
19.1.5. Recurrence
19.1.6. Fetching Events
19.1.7. Reminders
19.1.8. Proximity Alarms
19.2. Calendar Interface
19.2.1. EKEventViewController
19.2.2. EKEventEditViewController
19.2.3. EKCalendarChooser
20. Mail and Messages
20.1. Mail Message
20.2. Text Message
20.3. Twitter Post
21. Maps
21.1. Displaying a Map
21.2. Annotations
21.2.1. Custom Annotation View
21.2.2. Custom Annotation Class
21.2.3. Other Annotation Features
21.3. Overlays
21.3.1. Custom Overlay Class
21.3.2. Custom Overlay Renderer
21.3.3. Other Overlay Features
21.4. Map Kit and Current Location
21.5. Communicating With the Maps App
21.6. Geocoding, Searching, and Directions
21.6.1. Geocoding
21.6.2. Searching
21.6.3. Directions
22. Sensors
22.1. Core Location
22.1.1. Location Manager and Delegate
22.1.2. Core Location Authorization
22.1.3. Location Tracking
22.1.4. Where Am I?
22.1.5. Heading
22.1.6. Background Location
22.2. Acceleration, Attitude, and Activity
22.2.1. Shake Events
22.2.2. Raw Acceleration
22.2.3. Gyroscope
22.2.4. Motion Activity
23. Persistent Storage
23.1. The Sandbox
23.1.1. Standard Directories
23.1.2. Visually Inspecting the Sandbox
23.1.3. Basic File Operations
23.1.4. Saving and Reading Files
23.2. User Defaults
23.3. Simple Sharing and Previewing of Files
23.3.1. File Sharing
23.3.2. Document Types and Receiving a Document
23.3.3. Handing Over a Document
23.3.4. Previewing a Document
23.4. Document Architecture
23.5. iCloud
23.6. XML
23.7. SQLite
23.8. Core Data
23.9. Image File Formats
24. Basic Networking
24.1. HTTP Requests
24.1.1. Simple HTTP Request
24.1.2. Formal HTTP Request
24.1.3. Encapsulating the Session, Task, and Delegate
24.1.4. Downloading Table View Data
24.1.5. Background Downloads
24.1.6. Background App Refresh
24.2. On-Demand Resources
24.3. In-App Purchases
25. Threads
25.1. Main Thread
25.2. Why Threading Is Hard
25.3. Blocking the Main Thread
25.4. Manual Threading
25.5. NSOperation
25.6. Grand Central Dispatch
25.7. Threads and App Backgrounding
26. Undo
26.1. Undo Manager
26.1.1. Target–Action Undo
26.1.2. Undo Grouping
26.1.3. Invocation Undo
26.1.4. Functional Undo
26.2. Undo Interface
26.2.1. Shake-To-Edit
26.2.2. Undo Menu
A.1. Application States
A.2. App Delegate Events
A.3. App Lifetime Scenarios
B.1. Delayed Performance
B.2. Center of a CGRect
B.3. Adjust a CGSize
B.4. Dictionary of Views
B.5. Constraint Issues
B.6. Drawing Into an Image Context
B.7. Finite Repetition of an Animation
B.8. Remove Multiple Indexes From Array
B.9. Configure a Value Class At the Point of Use
B.10. Cancelable Closure-Based Timer
B.11. Generic Wrapper
Back to Matt Neuburg’s Home Page
This page prepared
November 3, 2015
by Matt Neuburg, phd = matt at tidbits dot com,
using RubyFrontier.
RubyFrontier is a port, written in the Ruby language,
of the Web-site-creation features of UserLand Frontier.
Works just like Frontier, but written in Ruby!
Download RubyFrontier from
GitHub.