You are previewing iOS Drawing: Practical UIKit Solutions.
O'Reilly logo
iOS Drawing: Practical UIKit Solutions

Book Description

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:

  • The basic concepts of Quartz (Core Graphics) and UIKit drawing

  • The coordinate system, paths, masking, and clipping

  • Text drawing

  • Transparency and alpha channels, drawing modes, blending, colors, and spaces

  • Transforms and geometry

  • Patterns, shadows, and gradients

  • Bitmaps and pixels

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.

Table of Contents

  1. About This eBook
  2. Title Page
  3. Copyright Page
  4. Dedication Page
  5. Contents at a Glance
  6. Contents
  7. Acknowledgments
  8. About the Author
  9. Preface
    1. How This Book Is Organized
    2. About the Sample Code
    3. Contacting the Author
  10. Editor’s Note: We Want to Hear from You!
  11. 1. Drawing Contexts
    1. Frameworks
    2. When to Draw
    3. Contexts
    4. Establishing Contexts in UIKit
    5. Building Contexts in Quartz
    6. Drawing into Contexts
    7. Drawing Within a UIKit Context
    8. UIKit and Quartz Colors
    9. The Painter’s Model
    10. Context State
    11. Context Coordinate System
    12. Clipping
    13. Transforms
    14. Setting Line Parameters
    15. Summary
  12. 2. The Language of Geometry
    1. Points Versus Pixels
    2. View Coordinates
    3. Key Structures
    4. Using CGRectDivide()
    5. Rectangle Utilities
    6. Fitting and Filling
    7. Summary
  13. 3. Drawing Images
    1. UIKit Images
    2. Building Thumbnails
    3. Extracting Subimages
    4. Converting an Image to Grayscale
    5. Watermarking Images
    6. Retrieving Image Data
    7. Creating Images from Bytes
    8. Drawing and Auto Layout
    9. Building Stretchable Images
    10. Rendering a PDF
    11. Building a Pattern Image
    12. Summary
  14. 4. Path Basics
    1. Why Bezier
    2. Class Convenience Methods
    3. Building Paths
    4. Retrieving Path Bounds and Centers
    5. Transforming Paths
    6. Fitting Bezier Paths
    7. Creating Bezier Paths from Strings
    8. Adding Dashes
    9. Building a Polygon Path
    10. Line Joins and Caps
    11. Miter Limits
    12. Inflected Shapes
    13. Summary
  15. 5. Paths in Depth
    1. Path Elements
    2. Converting Bezier Paths into Element Arrays
    3. Legal and Illegal Paths
    4. Math Behind the Path
    5. Calculating Path Distance
    6. Interpolating Paths
    7. Retrieving Subpaths
    8. Inverting Paths
    9. Drawing Shadows
    10. Drawing Inner and Outer Glows
    11. Reversing a Path
    12. Visualizing Path Order
    13. Summary
  16. 6. Drawing Gradients
    1. Gradients
    2. Drawing Gradients
    3. Building Gradients
    4. Adding Edge Effects
    5. State and Transparency Layers
    6. Flipping Gradients
    7. Mixing Linear and Radial Gradients
    8. Drawing Gradients on Path Edges
    9. Drawing 3D Letters
    10. Building Indented Graphics
    11. Combining Gradients and Texture
    12. Basic Button Gloss
    13. Adding Bottom Glows
    14. Building an Elliptical Gradient Overlay
    15. Summary
  17. 7. Masks, Blurs, and Animation
    1. Drawing into Images with Blocks
    2. Simple Masking
    3. Complex Masking
    4. Blurring
    5. Drawing Reflections
    6. Creating Display Links for Drawing
    7. Building Marching Ants
    8. Drawing Sampled Data
    9. Applying Core Image Transitions
    10. Summary
  18. 8. Drawing Text
    1. Drawing Strings
    2. iOS 7 Changes
    3. Text Attributes
    4. Kinds of Attributes
    5. Drawing with Core Text
    6. Drawing Columns
    7. Drawing Attributed Text Along a Path
    8. Fitting Text
    9. Summary
  19. A. Blend Modes
  20. B. Miter Threshold Limits