HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This eBook includes the following formats, accessible from your Account page after purchase:
EPUB The open industry format known for its reflowable content and usability on supported mobile devices.
PDF The popular standard, used most often with the free Acrobat® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
Covers iOS 7 and Xcode 5
Apple lavished iOS with a rich and evolving library of resolution-independent 2D drawing utilities. Its APIs include powerful features such as transparency, path-based drawing, anti-aliasing, and more. Harness these low-level, lightweight drawing routines in your apps to build images, to create PDFs, to display views, and to print.
In this guide, Erica Sadun, bestselling author of The Core iOS 6 Developer's Cookbook and The Advanced iOS 6 Developer's Cookbook, helps readers explore iOS drawing through an abundance of examples alongside plenty of explanations and tips. This short work provides the basic how-to developers need to get started. You will learn about these specific topics:
Approximately 311 pages.
For related content by author Erica Sadun, see iOS Auto Layout Demystified, The Core iOS 6 Developer’s Cookbook, and The Advanced iOS 6 Developer’s Cookbook.
informit.com/sadun
To access the code samples, visit https://github.com/erica/iOS-Drawing.
iOS Drawing: Learning Contexts and Basic UIKit Fundamentals
Download the sample pages (includes Chapter 1)
Preface
How This Book Is Organized
About the Sample Code
Contacting the Author
1 Drawing Contexts
Frameworks
When to Draw
Contexts
Establishing Contexts in UIKit
Building Contexts in Quartz
Drawing into Contexts
Drawing Within a UIKit Context
UIKit and Quartz Colors
The Painter’s Model
Context State
Context Coordinate System
Clipping
Transforms
Setting Line Parameters
Summary
2 The Language of Geometry
Points Versus Pixels
View Coordinates
Key Structures
Using CGRectDivide()
Rectangle Utilities
Fitting and Filling
Summary
3 Drawing Images
UIKit Images
Building Thumbnails
Extracting Subimages
Converting an Image to Grayscale
Watermarking Images
Retrieving Image Data
Creating Images from Bytes
Drawing and Auto Layout
Building Stretchable Images
Rendering a PDF
Building a Pattern Image
Summary
4 Path Basics
Why Bezier
Class Convenience Methods
Building Paths
Retrieving Path Bounds and Centers
Transforming Paths
Fitting Bezier Paths
Creating Bezier Paths from Strings
Adding Dashes
Building a Polygon Path
Line Joins and Caps
Miter Limits
Inflected Shapes
Summary
5 Paths in Depth
Path Elements
Converting Bezier Paths into Element Arrays
Legal and Illegal Paths
Math Behind the Path
Calculating Path Distance
Interpolating Paths
Retrieving Subpaths
Inverting Paths
Drawing Shadows
Drawing Inner and Outer Glows
Reversing a Path
Visualizing Path Order
Summary
6 Drawing GradientsGradients
Drawing Gradients
Building Gradients
Adding Edge Effects
State and Transparency Layers
Flipping Gradients
Mixing Linear and Radial Gradients
Drawing Gradients on Path Edges
Drawing 3D Letters
Building Indented Graphics
Combining Gradients and Texture
Basic Button Gloss
Adding Bottom Glows
Building an Elliptical Gradient Overlay
Summary
7 Masks, Blurs, and Animation
Drawing into Images with Blocks
Simple Masking
Complex Masking
Blurring
Drawing Reflections
Creating Display Links for Drawing
Building Marching Ants
Drawing Sampled Data
Applying Core Image Transitions
Summary
8 Drawing TextDrawing Strings
iOS 7 Changes
Text Attributes
Kinds of Attributes
Drawing with Core Text
Drawing Columns
Drawing Attributed Text Along a Path
Fitting Text
Summary
A Blend Modes
B Miter Threshold Limits