The Gourmet iOS Developer’s Cookbook offers a fresh banquet of delicious cutting-edge iOS programming recipes for projects both big and small. Renowned iOS programming expert Erica Sadun brings together reliable, proven code for creating today’s richest, most robust apps.
Sadun presents innovative ways to make the most of AVFoundation, Text Kit, animation, adaptive interface programming, and much more. As in all of her iOS best-sellers, this pragmatic guide translates modern best practices into working code, distilling key concepts into recipes you can understand and build on.
This is more than just cut-and-paste; using examples, Sadun offers a deep dive into the “how” and “why” of advanced iOS development. The code reflects iOS’s latest capabilities, and every chapter groups related tasks together, so you can jump straight to your solution.
Coverage includes
Providing advanced speech generation and barcode recognition features through AVFoundation
Automatically updating app text presentation based on user preferences and expectations
Extending rich, flexible text throughout your apps with UIKit and Text Kit
Seamlessly migrating text designs between iOS screens and other destinations
Generating attributed text strings from HTML sources
Integrating real-world physics for exciting animations and interactions
Creating better interfaces with dynamic animators--and overcoming their pitfalls
Achieving greater visual impact with improved user alerts and popovers
Implementing clever and compelling effects with non-rectangular views
Building adaptive apps that gracefully respond to any iOS display, orientation, or screen
Streamlining development with expert methods, functions, and techniques
Exploring the core concepts you’ll need to migrate successfully to Swift
This book’s source code is frequently updated by the author and can be downloaded at https://github.com/erica/iOS-Gourmet-Cookbook.
Author(s): Erica Sadun
Publisher: Addison-Wesley
Year: 2015
Language: English
Tags: iOS
Contents
Preface
1 Media
Speech
Other Options
Delegate Callbacks
Dictation
Creating Barcodes
Filter Parameters
Building Codes
Reading Barcodes
Listening for Metadata Objects
Responding to Metadata
Extracting Bounds
Enhancing Recognition
Detecting Faces
Building AVFoundation Movies
Creating a Pixel Buffer
Drawing into the Pixel Buffer
Expressive Drawing
Building Movies from Frames
Adding Images to Movies
Wrap-up
2 Dynamic Typography
Type Size and User Needs
How Dynamic Type Works
Listening for Type Updates
Handling Dynamic Type with Attributes
Scanning for Text Style Ranges
Applying Text Style Ranges
Attribute-Ready Dynamic Elements
Custom Fonts Faces
Dynamic Text Views
Custom Sizing
Font Descriptors
Descriptor Challenges
Fonts with Multiple Variations
Using String Attributes to Modify Fonts
Dynamic Type Gotchas
Wrap-up
3 Text Kit
Creating Complex Text Layouts
Glyphs
Text Storage
Layout Managers
Text Containers
Adaptive Flow
Insets
Exclusion Paths
Bounding Rectangles
Using Text Kit to Add Touch to Labels
Establishing Text Kit
Synchronizing
Translating Coordinates
Glyphs and Characters
Checking for Links
Adding Visual Feedback
Draggable Exclusion Zones
Building PDFs with Text Kit
Printing Text View Data
Printing PDF Data
Wrap-up
4 Attributed Strings and Document Containers
Class Enhancements
String Attachments
Building Attributed Strings from HTML
Document Type Dictionaries
Converting HTML Source to Attributed Strings
Converting Attributed Strings to Document Representations
Generating HTML from Attributed Strings
Markup Initialization
RTF and RTFD
The RTFD Container
Initializing Attributed Strings from a File
Converting RTFD Text to Data
Writing RTFD Containers from Data
Inspecting Attributes
Establishing Document Attributes
Enhancing Attributed Strings
Returning Copies with New Attributes
Adjusting Attributes
Extending Mutable Attributed Strings
Text Ranges
Calculating Positions
Position Geometry
Updating Selection Points
Hardware Key Support
Wrap-up
5 Animation
Keyframe Animation
Building Physics with Keyframes
Blocking Animators
UIKit Spring-Based Animations
Practical Uses for Spring Animations
System Animations
Motion Effects
Building Planes
Shadow Effects
Custom Transition Animations
Delegation
Building Transitioning Objects
Implicit Animations
Building an Animation-Ready Layer
Building a View Around a Layer
Timing
Coordinating Animations
Building Implicit Completion Blocks
Animating Custom Properties
Intercepting Updates
Drawing Properties
Wrap-up
6 Dynamic Animators
Physics-Based Behaviors
Building Dynamics
Detecting Pauses
Creating a Frame-Watching Dynamic Behavior
Implementing Snap Zones
Leveraging Real-World Physics
Connecting a Gravity Behavior to Device Acceleration
Creating Boundaries
Enhancing View Dynamics
Custom Behaviors
Creating Custom Dynamic Items
Subverting Dynamic Behaviors
Better Custom Dynamic Behaviors
Custom Secondary Behaviors
Collection Views and Dynamic Animators
Custom Flow Layouts
Returning Layout Attributes
Updating Behaviors
Building a Dynamic Alert View
Connecting Up the Jelly
Drawing the View
Deploying Jelly
Wrap-up
7 Presentations
Alerts
Class Deprecations
Building Alerts
Enabling and Disabling Alert Buttons
Adding Text Fields
Mask Views
Shape Layer Masking
Building Mask Views
Building Effect Views
Building a Blur Effect
Adding Vibrancy Effects
Animating Effect Views
Building Popovers
Supporting Bubbles
Presenting Popovers
Wrap-up
8 Shape Magic
How to Shape a View
Expanding Beyond Circles
Resizing Bezier Paths
Building a Bezier-Based Shape Image View
Working with Unclosed Shapes
Adding Borders to Shaped Views
Building Shaped Buttons
Adding Attention-Grabbing Animations to Shaped Views
Wrap-up
9 Adaptive Deployment
Traits
Trait Properties
Defining Traits
Combining Trait Collections
Designing for Traits
UIScreen Properties
Coordinate Spaces
Application Frame
Screen Bounds
Scale
Rotation
Size Classes and Assets
Basic Deployment
UIKit and Image Views
The UIImageAsset Class
Building Images from PDFs
Overriding Trait Collections
Building Side-by-Side iPhone Split Views
A Bit More About iOS 8 Split View Controllers
Wrap-up
10 Development Helpers
All the Lorems
Placeholder Text
Image Ipsums
Generating Random User Data
Bulk Names
Generating Random Feeds
Random Everything
Directives
Converting Comments to Warnings
Warnings
Testing for the Simulator
Errors
Testing for Inclusion
Messages
Wrapping Pragmas
Overriding Diagnostics
Unused Variable Warnings
Marking Non-null and Nullable Items
Developer Tweaks
Saving Files from the Simulator
Tighter Logging
Wrap-up
11 A Taste of Swift
Swift Versus Objective-C
Building iOS Apps in Swift
Optionals
Inferred Types
The Optional Enumeration
Unwrapping Optionals
Assigning Values to Non-optionals
Cocoa Touch Patterns
Hybrid Language Development
Calling Objective-C from Swift
Accessing Classes
Calling Swift from Objective-C
Preparing Swift for Objective-C
Class Descent
Building the Basics
Watching Progress
Learning Swift
Wrap-up
Index
A
B
C
D
E
F
G
H
I
J-K
L
M
N
O
P
Q-R
S
T
U
V
W
X-Y-Z