Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning iOS UI Development

You're reading from   Learning iOS UI Development Implement complex iOS user interfaces with ease using Swift

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781785288197
Length 196 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Exploring layers


Layers are behind almost all the views you encounter in iOS, and they are the very base of anything you do with core animation.

The CALayer class represents layers, and their main role is presenting content in a lightweight mode. The content is almost never drawn by the layer itself, but it is received as a bitmap, cached in a backing store, and then presented. You should look at layers as model objects rather than drawing elements; if there are any exceptions, it's probably because layers store the information needed to present some content generated somewhere else.

Layers and views

When a UIView class is instantiated, it sets its layer property with an instance of CALayer that, under the hood, contains a backed bitmap version of the view. This method ensures an efficient and lightweight solution to draw and animate contents.

A relationship between the layer and view is immediately created during initialization, and the view becomes the delegate of the layer. From now on, a...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime