SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
Introducing
The Great
CALayer Tour
Presented by Scott Gardner
About Me
Scott Gardner
iOS developer for 4+ years
Author of Transitioning to Swift
Speaking at CocoaConf Chicago ,
March 2015
LinkedIn: scotteg.com
Twitter: @scotteg
Tech Talk Overview
Things to Know
CALayer and Subclasses
Demos
Getting Started
Layer Player Tour
Layer Player Code
Things to Know: CALayer & Subclasses
CALayer CAScrollLayer CATextLayer CAGradientLayer CAReplicatorLayer
CATiledLayer CAShapeLayer CAEAGLLayer CATransformLayer CAEmitterLayer
AVPLayerLayer
Things to Know: CALayer
Base Layer Class
Manage and animate visual content
All views have a backing layer
Better performance than UIViews
Many helpful properties
Most automatically animated
Can add additional animations
Can be hit tested*
Things to Know: CAScrollLayer
Display portion of a scrollable layer
Can lock horizontal and/or vertical
UIScrollView doesn’t use it
Cannot directly react to touch or bounds check
Use UIScrollView when scrolling is touch-based
Use CATiledLayer when scrolling large images
Things to Know: CATextLayer
Render plain text or attributed strings
Similar capabilities as UILabel
Can change text, font, size, color, wrapping,
alignment, and truncation
Things to Know: AVPlayerLayer
Display an AV player
Can change player and videoGravity and videoRect
AVPlayer includes play(), pause(), rate, and seeking
AVPlayerItem has many useful properties and
callbacks
Things to Know: CAGradientLayer
Apply a color gradient over the
background
Faster than using Core Graphics
Can change colors, locations*, and start/end points
Things to Know: CAReplicatorLayer
Duplicate a source layer
Creates specified number of copies
Applies a transform to each copy
Can delay drawing of each copy
Can preserve depth
Things to Know: CATiledLayer
Asynchronously draw layer content in
tiles
Can be used to asynchronously draw a large image
Layer Player project includes tile cutter*
Can change tile size, resolution, and fade duration
Things to Know: CAShapeLayer
Draw using scalable vector paths
Faster than layer.contents = UIImage(named: …)
No pixelation, no clipping, and preserves aspect ratio
Can change line thickness and dashing, how lines end
or join other lines, and line and fill color
Tip: use PaintCode to create image path code
Save $20 on PaintCode: bit.ly/PaintCodeRocks
Things to Know: CAEAGLLayer
Draw OpenGL content
Should make layer opaque and match bounds
Should not transform
Avoid drawing additional layers on top
Optionally override UIView.layerClass()
Use GLKView or CAMetalLayer instead
Things to Know: CATransformLayer
Draw 3D structures
Does not flatten its sublayers
Each sublayer has its own opacity
Transform is applied to sublayers
Transform ignores changes to rendered layer
properties
Cannot directly hit test
…but can hit test sublayers
Things to Know: CAEmitterLayer
Render animated particles
Particles are instances of CAEmitterCell
Draws particles above backgroundColor and border
Can change render mode and emitter position, shape, size,
spin, velocity, birth rate, and lifetime
Can preserve depth to render in 3D
Can change cell contents, color, speed of color change,
scale, emission latitude/longitude, initial velocity,
acceleration, birth rate, lifetime, and magnification/
minification filters
Introducing
The Great
CALayer Tour
Demos
Where To Go From Here?
Download Layer Player from App Store
Read 10 Ways To Score Wins With Layers
tutorial on raywenderlich.com
Practice, practice, practice!
Drop me a note anytime! :]
@scotteg
fin

Contenu connexe

Similaire à The Great CALayer Tour

Implementing CATiledLayer
Implementing CATiledLayerImplementing CATiledLayer
Implementing CATiledLayerJesse Collis
 
CATiled Layer - Melbourne Cocoheads February 2012
CATiled Layer - Melbourne Cocoheads February 2012CATiled Layer - Melbourne Cocoheads February 2012
CATiled Layer - Melbourne Cocoheads February 2012Jesse Collis
 
Degrafa Beta 3 - 360|MAX
Degrafa Beta 3 - 360|MAXDegrafa Beta 3 - 360|MAX
Degrafa Beta 3 - 360|MAXJuan Sanchez
 
Blender for ArchViz.pdf
Blender for ArchViz.pdfBlender for ArchViz.pdf
Blender for ArchViz.pdfshan_1900
 
AutoCAD Tips, Tricks, and Delightful Drafting Techniques
AutoCAD Tips, Tricks, and Delightful Drafting TechniquesAutoCAD Tips, Tricks, and Delightful Drafting Techniques
AutoCAD Tips, Tricks, and Delightful Drafting TechniquesDonnie Gladfelter
 
Civil 3D Visualization
Civil 3D VisualizationCivil 3D Visualization
Civil 3D VisualizationLarry Young
 
Utilizing Layers in AutoCAD Prototype Package
Utilizing Layers in AutoCAD Prototype PackageUtilizing Layers in AutoCAD Prototype Package
Utilizing Layers in AutoCAD Prototype PackageBrian Mitchell
 
Front end workflow Presentation at Coffee@DBG by Praveen Vijayan
Front end workflow Presentation at Coffee@DBG by Praveen VijayanFront end workflow Presentation at Coffee@DBG by Praveen Vijayan
Front end workflow Presentation at Coffee@DBG by Praveen VijayanDeepu S Nath
 
Svcc Java2D And Groovy
Svcc Java2D And GroovySvcc Java2D And Groovy
Svcc Java2D And GroovyAndres Almiray
 
Hi performance table views with QuartzCore and CoreText
Hi performance table views with QuartzCore and CoreTextHi performance table views with QuartzCore and CoreText
Hi performance table views with QuartzCore and CoreTextMugunth Kumar
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryAndrea Verlicchi
 
Professional JavaScript: AntiPatterns
Professional JavaScript: AntiPatternsProfessional JavaScript: AntiPatterns
Professional JavaScript: AntiPatternsMike Wilcox
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsBinary Studio
 
blockdiag - a simple diagram generator
blockdiag - a simple diagram generatorblockdiag - a simple diagram generator
blockdiag - a simple diagram generatorTakeshi Komiya
 

Similaire à The Great CALayer Tour (20)

Implementing CATiledLayer
Implementing CATiledLayerImplementing CATiledLayer
Implementing CATiledLayer
 
CATiled Layer - Melbourne Cocoheads February 2012
CATiled Layer - Melbourne Cocoheads February 2012CATiled Layer - Melbourne Cocoheads February 2012
CATiled Layer - Melbourne Cocoheads February 2012
 
Degrafa Beta 3 - 360|MAX
Degrafa Beta 3 - 360|MAXDegrafa Beta 3 - 360|MAX
Degrafa Beta 3 - 360|MAX
 
Blender for ArchViz.pdf
Blender for ArchViz.pdfBlender for ArchViz.pdf
Blender for ArchViz.pdf
 
AutoCAD Tips, Tricks, and Delightful Drafting Techniques
AutoCAD Tips, Tricks, and Delightful Drafting TechniquesAutoCAD Tips, Tricks, and Delightful Drafting Techniques
AutoCAD Tips, Tricks, and Delightful Drafting Techniques
 
Solidworks
SolidworksSolidworks
Solidworks
 
Civil 3D Visualization
Civil 3D VisualizationCivil 3D Visualization
Civil 3D Visualization
 
Utilizing Layers in AutoCAD Prototype Package
Utilizing Layers in AutoCAD Prototype PackageUtilizing Layers in AutoCAD Prototype Package
Utilizing Layers in AutoCAD Prototype Package
 
a3.pdf
a3.pdfa3.pdf
a3.pdf
 
Front end workflow Presentation at Coffee@DBG by Praveen Vijayan
Front end workflow Presentation at Coffee@DBG by Praveen VijayanFront end workflow Presentation at Coffee@DBG by Praveen Vijayan
Front end workflow Presentation at Coffee@DBG by Praveen Vijayan
 
Svcc Java2D And Groovy
Svcc Java2D And GroovySvcc Java2D And Groovy
Svcc Java2D And Groovy
 
IOS Storyboards
IOS StoryboardsIOS Storyboards
IOS Storyboards
 
Reveal
RevealReveal
Reveal
 
CSS and CSS3
CSS and CSS3CSS and CSS3
CSS and CSS3
 
Hi performance table views with QuartzCore and CoreText
Hi performance table views with QuartzCore and CoreTextHi performance table views with QuartzCore and CoreText
Hi performance table views with QuartzCore and CoreText
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQuery
 
Professional JavaScript: AntiPatterns
Professional JavaScript: AntiPatternsProfessional JavaScript: AntiPatterns
Professional JavaScript: AntiPatterns
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphics
 
Material Design Android
Material Design AndroidMaterial Design Android
Material Design Android
 
blockdiag - a simple diagram generator
blockdiag - a simple diagram generatorblockdiag - a simple diagram generator
blockdiag - a simple diagram generator
 

Plus de Scott Gardner

Getting Started with Combine And SwiftUI
Getting Started with Combine And SwiftUIGetting Started with Combine And SwiftUI
Getting Started with Combine And SwiftUIScott Gardner
 
SwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsSwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsScott Gardner
 
Reactive Programming with RxSwift
Reactive Programming with RxSwiftReactive Programming with RxSwift
Reactive Programming with RxSwiftScott Gardner
 
Reactive programming with RxSwift
Reactive programming with RxSwiftReactive programming with RxSwift
Reactive programming with RxSwiftScott Gardner
 
To Swift 2...and Beyond!
To Swift 2...and Beyond!To Swift 2...and Beyond!
To Swift 2...and Beyond!Scott Gardner
 
4 Ways To Improve User Interface Development
4 Ways To Improve User Interface Development4 Ways To Improve User Interface Development
4 Ways To Improve User Interface DevelopmentScott Gardner
 

Plus de Scott Gardner (6)

Getting Started with Combine And SwiftUI
Getting Started with Combine And SwiftUIGetting Started with Combine And SwiftUI
Getting Started with Combine And SwiftUI
 
SwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsSwiftUI and Combine All the Things
SwiftUI and Combine All the Things
 
Reactive Programming with RxSwift
Reactive Programming with RxSwiftReactive Programming with RxSwift
Reactive Programming with RxSwift
 
Reactive programming with RxSwift
Reactive programming with RxSwiftReactive programming with RxSwift
Reactive programming with RxSwift
 
To Swift 2...and Beyond!
To Swift 2...and Beyond!To Swift 2...and Beyond!
To Swift 2...and Beyond!
 
4 Ways To Improve User Interface Development
4 Ways To Improve User Interface Development4 Ways To Improve User Interface Development
4 Ways To Improve User Interface Development
 

Dernier

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 

Dernier (20)

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

The Great CALayer Tour

  • 2. About Me Scott Gardner iOS developer for 4+ years Author of Transitioning to Swift Speaking at CocoaConf Chicago , March 2015 LinkedIn: scotteg.com Twitter: @scotteg
  • 3. Tech Talk Overview Things to Know CALayer and Subclasses Demos Getting Started Layer Player Tour Layer Player Code
  • 4. Things to Know: CALayer & Subclasses CALayer CAScrollLayer CATextLayer CAGradientLayer CAReplicatorLayer CATiledLayer CAShapeLayer CAEAGLLayer CATransformLayer CAEmitterLayer AVPLayerLayer
  • 5. Things to Know: CALayer Base Layer Class Manage and animate visual content All views have a backing layer Better performance than UIViews Many helpful properties Most automatically animated Can add additional animations Can be hit tested*
  • 6. Things to Know: CAScrollLayer Display portion of a scrollable layer Can lock horizontal and/or vertical UIScrollView doesn’t use it Cannot directly react to touch or bounds check Use UIScrollView when scrolling is touch-based Use CATiledLayer when scrolling large images
  • 7. Things to Know: CATextLayer Render plain text or attributed strings Similar capabilities as UILabel Can change text, font, size, color, wrapping, alignment, and truncation
  • 8. Things to Know: AVPlayerLayer Display an AV player Can change player and videoGravity and videoRect AVPlayer includes play(), pause(), rate, and seeking AVPlayerItem has many useful properties and callbacks
  • 9. Things to Know: CAGradientLayer Apply a color gradient over the background Faster than using Core Graphics Can change colors, locations*, and start/end points
  • 10. Things to Know: CAReplicatorLayer Duplicate a source layer Creates specified number of copies Applies a transform to each copy Can delay drawing of each copy Can preserve depth
  • 11. Things to Know: CATiledLayer Asynchronously draw layer content in tiles Can be used to asynchronously draw a large image Layer Player project includes tile cutter* Can change tile size, resolution, and fade duration
  • 12. Things to Know: CAShapeLayer Draw using scalable vector paths Faster than layer.contents = UIImage(named: …) No pixelation, no clipping, and preserves aspect ratio Can change line thickness and dashing, how lines end or join other lines, and line and fill color Tip: use PaintCode to create image path code Save $20 on PaintCode: bit.ly/PaintCodeRocks
  • 13. Things to Know: CAEAGLLayer Draw OpenGL content Should make layer opaque and match bounds Should not transform Avoid drawing additional layers on top Optionally override UIView.layerClass() Use GLKView or CAMetalLayer instead
  • 14. Things to Know: CATransformLayer Draw 3D structures Does not flatten its sublayers Each sublayer has its own opacity Transform is applied to sublayers Transform ignores changes to rendered layer properties Cannot directly hit test …but can hit test sublayers
  • 15. Things to Know: CAEmitterLayer Render animated particles Particles are instances of CAEmitterCell Draws particles above backgroundColor and border Can change render mode and emitter position, shape, size, spin, velocity, birth rate, and lifetime Can preserve depth to render in 3D Can change cell contents, color, speed of color change, scale, emission latitude/longitude, initial velocity, acceleration, birth rate, lifetime, and magnification/ minification filters
  • 17. Where To Go From Here? Download Layer Player from App Store Read 10 Ways To Score Wins With Layers tutorial on raywenderlich.com Practice, practice, practice! Drop me a note anytime! :] @scotteg
  • 18. fin