Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage...
Transcript of Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage...
![Page 1: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/1.jpg)
These are confidential sessions—please refrain from streaming, blogging, or taking pictures
Session 210
Introducing Text Kit
Ian BairdiOS Text Kit Lead Engineer
![Page 2: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/2.jpg)
Agenda
•Motivation
![Page 3: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/3.jpg)
Agenda
•Motivation•What is Text Kit?
![Page 4: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/4.jpg)
Agenda
•Motivation•What is Text Kit?• Feature set
![Page 5: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/5.jpg)
Agenda
•Motivation•What is Text Kit?• Feature set• Rich Text
![Page 6: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/6.jpg)
Motivation
![Page 7: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/7.jpg)
MotivationIn the beginning…
![Page 8: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/8.jpg)
MotivationIn the beginning…
String DrawingCore Text
Core Graphics
WebKit
![Page 9: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/9.jpg)
MotivationIn the beginning…
String DrawingCore Text
Core Graphics
WebKit
UILabel UITextField UITextView UIWebView
UITextInputProtocol
![Page 10: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/10.jpg)
Core Text is very advancedMotivation
•Mastering Core Text considered to be a “rite of passage”
![Page 11: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/11.jpg)
Core Text is very advancedMotivation
•Mastering Core Text considered to be a “rite of passage”•Advanced Unicode layout engine
![Page 12: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/12.jpg)
Core Text is very advancedMotivation
•Mastering Core Text considered to be a “rite of passage”•Advanced Unicode layout engine•Many concepts Toll-Free Bridged with Text Kit now
![Page 13: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/13.jpg)
UIWebViewMotivation
•Great for embedding web content
![Page 14: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/14.jpg)
UIWebViewMotivation
•Great for embedding web content•WebKit is a great HTML rendering engine
![Page 15: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/15.jpg)
UIWebViewMotivation
•Great for embedding web content•WebKit is a great HTML rendering engine•Unexpected behavior with scroll view objects
![Page 16: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/16.jpg)
![Page 17: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/17.jpg)
Text Kit
![Page 18: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/18.jpg)
What Is Text Kit?
![Page 19: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/19.jpg)
IntroductionWhat Is Text Kit?
• Fast modern text layout and rendering engine
![Page 20: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/20.jpg)
IntroductionWhat Is Text Kit?
• Fast modern text layout and rendering engine• Built on Core Text
![Page 21: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/21.jpg)
IntroductionWhat Is Text Kit?
• Fast modern text layout and rendering engine• Built on Core Text•Great integration with UIKit
![Page 22: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/22.jpg)
What Is Text Kit?
![Page 23: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/23.jpg)
What Is Text Kit?
Text Kit WebKit
Core Text
Core Graphics
![Page 24: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/24.jpg)
What Is Text Kit?
Text Kit WebKit
Core Text
Core Graphics
UITextInputProtocol
UILabel UITextField UITextView UIWebView
![Page 25: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/25.jpg)
Text Kit is a “first-class citizen” in UIKitWhat Is Text Kit?
• Complete control over text rendering in UI elements
![Page 26: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/26.jpg)
Text Kit is a “first-class citizen” in UIKitWhat Is Text Kit?
• Complete control over text rendering in UI elements•UITextView, UITextField, and UILabel rebuilt on Text Kit
![Page 27: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/27.jpg)
Text Kit is a “first-class citizen” in UIKitWhat Is Text Kit?
• Complete control over text rendering in UI elements•UITextView, UITextField, and UILabel rebuilt on Text Kit• Seamlessly integrates with animations, UICollectionView, and UITableView
![Page 28: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/28.jpg)
Extensible object-oriented architectureWhat Is Text Kit?
• Subclassing•Delegation•NotificationsNSTextStorageWillProcessEditingNotificationNSTextStorageDidProcessEditingNotification
![Page 29: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/29.jpg)
Extensible object-oriented architectureWhat Is Text Kit?
• Subclassing•Delegation•NotificationsNSTextStorageWillProcessEditingNotificationNSTextStorageDidProcessEditingNotification
MyTextStorage
NSTextStorage
![Page 30: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/30.jpg)
Extensible object-oriented architectureWhat Is Text Kit?
• Subclassing•Delegation
Layout ManagerDelegateNSLayoutManager
![Page 31: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/31.jpg)
Extensible object-oriented architectureWhat Is Text Kit?
• Subclassing•Delegation•NotificationsNSTextStorageWillProcessEditingNotificationNSTextStorageDidProcessEditingNotification
![Page 32: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/32.jpg)
A tour of Text KitFeature Set
![Page 33: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/33.jpg)
Feature SetPaginated text
![Page 34: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/34.jpg)
Feature SetText in columns
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Phasellus lacinia pretium diam non tempor. Aenean mollis
pellentesque lectus, vitae ultrices urna tincidunt eu. Mauris
ullamcorper elementum pharetra. Donec imperdiet lacinia
porttitor. Pellentesque habitant morbi tristique senectus et
netus et malesuada fames ac turpis egestas. Nulla lobortis
tortor libero. Donec fringilla placerat lectus sed commodo.
Nulla nisl nulla, feugiat eu sodales nec, semper non nibh.
Nunc porta lacinia cursus. Vestibulum ultrices euismod
euismod. Class aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos himenaeos. Quisque nec
lectus id diam molestie consectetur sed sed ligula. Nulla
non luctus nibh. Integer viverra posuere urna, vel volutpat
eros eleifend in. Donec pharetra tincidunt lectus vitae
luctus.
Ut semper vulputate quam in dictum. Maecenas lobortis
porttitor lorem vel molestie. Nam eros orci, mattis ac
placerat nec, blandit sed orci. In consequat convallis risus
eu fermentum. Mauris accumsan lobortis porta. Nunc
feugiat, leo et consequat varius, velit metus consectetur
ante, in bibendum neque felis vel sapien. Fusce vel risus in
tellus convallis facilisis. Nunc consectetur fringilla sem vel
varius. Etiam cursus auctor tortor vitae dictum. Sed
interdum fringilla orci, sed commodo magna ultricies
fringilla. Donec eget convallis lacus.
Etiam nec mauris lacus. Cras mattis lobortis dignissim. Sed
lorem turpis, feugiat at sodales eget, porta vel purus. Sed
ullamcorper diam ac justo hendrerit porta. Aliquam sed erat
ut lorem facilisis sollicitudin quis eget mi. Sed vitae massa
id magna sagittis commodo. Ut feugiat tincidunt purus, et
imperdiet diam convallis vitae. Donec augue libero, blandit
ut dapibus id, vulputate at velit. Morbi condimentum
bibendum turpis, sed fermentum turpis ornare non.
In hac habitasse platea dictumst. Nulla facilisi. Proin vel
nibh mi, quis congue lectus. Etiam sit amet est nec quam
iaculis lobortis sit amet eu leo. Nulla mollis feugiat quam, a
interdum sapien pellentesque sed. Pellentesque eu sem ut
elit fringilla scelerisque a vel leo. Aenean quis lacus eget
massa condimentum adipiscing ac vitae sapien. Vivamus id
nibh aliquet ante blandit varius ac lobortis nisl. Pellentesque
turpis ante, consectetur egestas semper eget, sodales non
tellus. Pellentesque ullamcorper felis non nibh vehicula in
mollis mi eleifend. Integer eget interdum velit.
Nulla scelerisque nibh non neque tincidunt semper. Integer
lorem est, consequat eu convallis in, egestas quis purus.
Phasellus egestas mi risus. Phasellus a quam nec sapien
vulputate cursus. Maecenas mattis congue placerat.
Pellentesque et euismod massa. Morbi rhoncus euismod
luctus.
![Page 35: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/35.jpg)
Feature SetText wrapping
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Phasellus lacinia pretium diam non tempor. Aenean mollis
pellentesque lectus, vitae ultrices urna tincidunt eu. Mauris
ullamcorper elementum pharetra. Donec imperdiet lacinia
porttitor. Pellentesque habitant morbi tristique senectus et
netus et malesuada fames ac turpis egestas. Nulla lobortis
tortor libero. Donec fringilla placerat lectus sed commodo.
Nulla nisl nulla, feugiat eu sodales nec, semper non nibh.
Nunc porta lacinia cursus. Vestibulum ultrices euismod
euismod. Class aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos himenaeos. Quisque nec
lectus id diam molestie
consectetur sed sed ligula.
Nulla non luctus nibh.
Integer viverra posuere urna,
vel volutpat eros eleifend in.
Donec pharetra tincidunt lectus
vitae luctus.
Ut semper vulputate quam in dictum.
Maecenas lobortis porttitor lorem vel molestie. Nam
eros orci, mattis ac placerat nec, blandit sed orci. In
consequat convallis risus eu fermentum. Mauris accumsan
lobortis porta. Nunc feugiat, leo et consequat varius, velit
metus consectetur ante, in bibendum neque felis vel
sapien. Fusce vel risus in tellus convallis facilisis. Nunc
consectetur fringilla sem vel varius. Etiam cursus auctor
tortor vitae dictum. Sed interdum fringilla orci, sed
commodo magna ultricies fringilla. Donec eget convallis
lacus.
Etiam nec mauris lacus. Cras mattis lobortis
dignissim. Sed lorem turpis, feugiat at sodales
eget, porta vel purus. Sed ullamcorper diam ac
justo hendrerit porta. Aliquam sed erat ut
lorem facilisis sollicitudin quis eget mi. Sed
vitae massa id magna sagittis commodo.
Ut feugiat tincidunt purus, et imperdiet
diam convallis vitae. Donec augue
libero, blandit ut dapibus id,
vulputate at velit. Morbi
condimentum bibendum turpis,
sed fermentum turpis ornare non.
In hac habitasse platea dictumst.
Nulla facilisi. Proin vel nibh mi, quis
congue lectus. Etiam sit amet est nec quam iaculis
lobortis sit amet eu leo. Nulla mollis feugiat quam,
a interdum sapien pellentesque sed. Pellentesque eu
sem ut elit fringilla scelerisque a vel leo. Aenean quis lacus
eget massa condimentum adipiscing ac vitae sapien.
Vivamus id nibh aliquet ante blandit varius ac lobortis nisl.
Pellentesque turpis ante, consectetur egestas semper eget,
![Page 36: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/36.jpg)
Feature SetRich Text editing
Heading One
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus lacinia
pretium diam non tempor. Aenean mollis pellentesque lectus, vitae ultrices
urna tincidunt eu. Mauris ullamcorper elementum pharetra. Donec imperdiet
lacinia porttitor. Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas. Nulla lobortis tortor libero. Donec fringilla
placerat lectus sed commodo. Nulla nisl nulla, feugiat eu sodales nec, semper
non nibh. Nunc porta lacinia cursus. Vestibulum ultrices euismod euismod.
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
inceptos himenaeos. Quisque nec lectus id diam molestie consectetur sed
sed ligula. Nulla non luctus nibh. Integer viverra posuere urna, vel volutpat
eros eleifend in. Donec pharetra tincidunt lectus vitae luctus.
Ut semper vulputate quam in dictum. Maecenas lobortis porttitor lorem vel
molestie. Nam eros orci, mattis ac placerat nec, blandit sed orci. In
consequat convallis risus eu fermentum. Mauris accumsan lobortis porta.
Nunc feugiat, leo et consequat varius, velit metus consectetur ante, in
bibendum neque felis vel sapien. Fusce vel risus in tellus convallis facilisis.
Nunc consectetur fringilla sem vel varius. Etiam cursus auctor tortor vitae
dictum. Sed interdum fringilla orci, sed commodo magna ultricies fringilla.
Donec eget convallis lacus.
Etiam nec mauris lacus. Cras mattis lobortis dignissim. Sed lorem turpis,
feugiat at sodales eget, porta vel purus. Sed ullamcorper diam ac justo
hendrerit porta. Aliquam sed erat ut lorem facilisis sollicitudin quis eget mi.
Sed vitae massa id magna sagittis commodo. Ut feugiat tincidunt purus, et
imperdiet diam convallis vitae. Donec augue libero, blandit ut dapibus id,
vulputate at velit. Morbi condimentum bibendum turpis, sed fermentum turpis
ornare non.
![Page 37: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/37.jpg)
Interactive text coloringFeature Set
![Page 38: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/38.jpg)
Interactive text coloringFeature Set
@somebody
![Page 39: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/39.jpg)
Interactive text coloringFeature Set
@somebody@somebody: nice layout!@somebody
![Page 40: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/40.jpg)
Text foldingFeature Set
Heading 1This is a snippet of text we’d like to hide.
Heading 2This is a range of text we’d like to keep visible.
![Page 41: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/41.jpg)
Text foldingFeature Set
Heading 1Heading 2
This is a range of text we’d like to keep visible.
![Page 42: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/42.jpg)
Custom truncationFeature Set
Mary had a little lamb its fleecewas white as snow.
![Page 43: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/43.jpg)
Custom truncationFeature Set
Mary had … fleece … was white.
![Page 44: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/44.jpg)
Enhanced in iOS 7Feature Set
•Advanced techniques work in stock components
![Page 45: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/45.jpg)
Enhanced in iOS 7Feature Set
•Advanced techniques work in stock components•UITextView and UITextField support all text attributes
![Page 46: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/46.jpg)
Enhanced in iOS 7Feature Set
•Advanced techniques work in stock components•UITextView and UITextField support all text attributes• Kerning and ligatures everywhere
KERNING
TruffleLIGATURE
![Page 47: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/47.jpg)
Enhanced in iOS 7Feature Set
•Advanced techniques work in stock components•UITextView and UITextField support all text attributes• Kerning and ligatures everywhere• Letterpress
![Page 48: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/48.jpg)
Advanced Text Layouts and Effects with Text Kit MissionThursday 2:00PM
![Page 49: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/49.jpg)
•Designed type styles
Dynamic TypeFeature Set
![Page 50: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/50.jpg)
•Designed type styles•Optimized for legibility
Dynamic TypeFeature Set
![Page 51: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/51.jpg)
•Designed type styles•Optimized for legibility•User picks size
Dynamic TypeFeature Set
![Page 52: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/52.jpg)
•Designed type styles•Optimized for legibility•User picks size
Dynamic TypeFeature Set
![Page 53: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/53.jpg)
•Designed type styles•Optimized for legibility•User picks size
Dynamic TypeFeature Set
![Page 54: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/54.jpg)
•Designed type styles•Optimized for legibility•User picks size•Accessibility
Dynamic TypeFeature Set
![Page 55: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/55.jpg)
•Designed type styles•Optimized for legibility•User picks size•Accessibility• Xcode 5
Dynamic TypeFeature Set
![Page 56: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/56.jpg)
Font descriptorsFeature Set
• Specifies a font
![Page 57: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/57.jpg)
Font descriptorsFeature Set
• Specifies a font•Queries fonts (and supplies the result)
![Page 58: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/58.jpg)
Font descriptorsFeature Set
• Specifies a font•Queries fonts (and supplies the result)• Can be archived
![Page 59: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/59.jpg)
Using Fonts with Text Kit PresidioFriday 9:00AM
![Page 60: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/60.jpg)
Feature Set
Headline 1Headline 2
Body
Subheadline 1Subheadline 2
FootnoteCaption 1Caption 2
Symbolic traits
![Page 61: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/61.jpg)
Feature SetSymbolic traits
Headline 1Headline 2
Body
Subheadline 1Subheadline 2
FootnoteCaption 1Caption 2
![Page 62: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/62.jpg)
Feature SetSymbolic traits
Regular
Headline 1Headline 2
Body
Subheadline 1Subheadline 2
FootnoteCaption 1Caption 2
![Page 63: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/63.jpg)
Feature Set
Headline 1Headline 2
Body
Subheadline 1Subheadline 2
FootnoteCaption 1Caption 2
Bold
Headline 1Headline 2
Body
Subheadline 1Subheadline 2
FootnoteCaption 1Caption 2
Italic
Symbolic traits
Regular
Headline 1Headline 2
Body
Subheadline 1Subheadline 2
FootnoteCaption 1Caption 2
![Page 64: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/64.jpg)
Feature SetSymbolic traits
Regular
Headline 1Headline 2
Body
Subheadline 1Subheadline 2
FootnoteCaption 1Caption 2
![Page 65: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/65.jpg)
Feature Set
Headline 1Headline 2
Body
Subheadline 1Subheadline 2
FootnoteCaption 1Caption 2
Expanded
Headline 1Headline 2
Body
Subheadline 1Subheadline 2
FootnoteCaption 1Caption 2
Condensed
Symbolic traits
Regular
Headline 1Headline 2
Body
Subheadline 1Subheadline 2
FootnoteCaption 1Caption 2
![Page 66: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/66.jpg)
Feature Set
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod
Regular
Line spacing
![Page 67: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/67.jpg)
Feature Set
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
Loose
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut
Tight
Line spacing
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod
Regular
![Page 68: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/68.jpg)
CSS font valuesFont Enhancements
![Page 69: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/69.jpg)
CSS font values
-apple-system-headline1-apple-system-headline2-apple-system-body-apple-system-subheadline1-apple-system-subheadline2-apple-system-footnote-apple-system-caption1-apple-system-caption2-apple-system-short-headline1-apple-system-short-headline2-apple-system-short-body-apple-system-short-subheadline1-apple-system-short-subheadline2-apple-system-short-footnote-apple-system-short-caption1-apple-system-tall-body
Font Enhancements
![Page 70: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/70.jpg)
What’s New in Safari and WebKit for Web Developers MissionTuesday 9:00AM
![Page 71: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/71.jpg)
Feature SetUITextView composition
![Page 72: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/72.jpg)
Feature SetUITextView composition
![Page 73: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/73.jpg)
Feature SetUITextView composition
![Page 74: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/74.jpg)
Feature SetUITextView composition
![Page 75: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/75.jpg)
NSTextStorage
Feature SetUITextView composition
![Page 76: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/76.jpg)
Exclusion pathsFeature Set
• Simple figures and cutouts
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Phasellus lacinia pretium diam non tempor. Aenean mollis
pellentesque lectus, vitae ultrices urna tincidunt eu. Mauris
ullamcorper elementum pharetra. Donec imperdiet lacinia
porttitor. Pellentesque habitant morbi tristique senectus et
netus et malesuada fames ac turpis egestas. Nulla lobortis
tortor libero. Donec fringilla placerat lectus sed commodo.
Nulla nisl nulla, feugiat eu sodales nec, semper non nibh.
Nunc porta lacinia cursus. Vestibulum ultrices euismod
euismod. Class aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos himenaeos. Quisque nec
lectus id diam molestie consectetur sed sed ligula. Nulla
non luctus nibh. Integer viverra posuere urna, vel volutpat
eros eleifend in. Donec pharetra tincidunt lectus vitae
luctus.
Ut semper vulputate quam in dictum. Maecenas lobortis
porttitor lorem vel molestie. Nam eros orci, mattis ac
placerat nec, blandit sed orci. In consequat convallis risus
eu fermentum. Mauris accumsan lobortis porta. Nunc
feugiat, leo et consequat varius, velit metus consectetur
ante, in bibendum neque felis vel sapien. Fusce vel risus in
tellus convallis facilisis. Nunc consectetur fringilla sem vel
varius. Etiam cursus auctor tortor vitae dictum. Sed
interdum fringilla orci, sed commodo magna ultricies
fringilla. Donec eget convallis lacus.
Etiam nec mauris lacus. Cras mattis lobortis dignissim. Sed
lorem turpis, feugiat at sodales eget, porta vel purus. Sed
ullamcorper diam ac justo hendrerit porta. Aliquam sed erat
ut lorem facilisis sollicitudin quis eget mi. Sed vitae massa
id magna sagittis commodo. Ut feugiat tincidunt purus, et
imperdiet diam convallis vitae. Donec augue libero, blandit
ut dapibus id, vulputate at velit. Morbi condimentum
bibendum turpis, sed fermentum turpis ornare non.
In hac habitasse platea dictumst. Nulla facilisi. Proin vel
nibh mi, quis congue lectus. Etiam sit amet est nec quam
iaculis lobortis sit amet eu leo. Nulla mollis feugiat quam, a
interdum sapien pellentesque sed. Pellentesque eu sem ut
elit fringilla scelerisque a vel leo. Aenean quis lacus eget
massa condimentum adipiscing ac vitae sapien. Vivamus id
nibh aliquet ante blandit varius ac lobortis nisl. Pellentesque
turpis ante, consectetur egestas semper eget, sodales non
tellus. Pellentesque ullamcorper felis non nibh vehicula in
mollis mi eleifend. Integer eget interdum velit.
Nulla scelerisque nibh non neque tincidunt semper. Integer
lorem est, consequat eu convallis in, egestas quis purus.
Phasellus egestas mi risus. Phasellus a quam nec sapien
vulputate cursus. Maecenas mattis congue placerat.
Pellentesque et euismod massa. Morbi rhoncus euismod
luctus.
![Page 77: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/77.jpg)
Exclusion pathsFeature Set
• Simple figures and cutoutsUIBezierPath *exclusion = ButterflyBezierPath;
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Phasellus lacinia pretium diam non tempor. Aenean mollis
pellentesque lectus, vitae ultrices urna tincidunt eu. Mauris
ullamcorper elementum pharetra. Donec imperdiet lacinia
porttitor. Pellentesque habitant morbi tristique senectus et
netus et malesuada fames ac turpis egestas. Nulla lobortis
tortor libero. Donec fringilla placerat lectus sed commodo.
Nulla nisl nulla, feugiat eu sodales nec, semper non nibh.
Nunc porta lacinia cursus. Vestibulum ultrices euismod
euismod. Class aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos himenaeos. Quisque nec
lectus id diam molestie consectetur sed sed ligula. Nulla
non luctus nibh. Integer viverra posuere urna, vel volutpat
eros eleifend in. Donec pharetra tincidunt lectus vitae
luctus.
Ut semper vulputate quam in dictum. Maecenas lobortis
porttitor lorem vel molestie. Nam eros orci, mattis ac
placerat nec, blandit sed orci. In consequat convallis risus
eu fermentum. Mauris accumsan lobortis porta. Nunc
feugiat, leo et consequat varius, velit metus consectetur
ante, in bibendum neque felis vel sapien. Fusce vel risus in
tellus convallis facilisis. Nunc consectetur fringilla sem vel
varius. Etiam cursus auctor tortor vitae dictum. Sed
interdum fringilla orci, sed commodo magna ultricies
fringilla. Donec eget convallis lacus.
Etiam nec mauris lacus. Cras mattis lobortis dignissim. Sed
lorem turpis, feugiat at sodales eget, porta vel purus. Sed
ullamcorper diam ac justo hendrerit porta. Aliquam sed erat
ut lorem facilisis sollicitudin quis eget mi. Sed vitae massa
id magna sagittis commodo. Ut feugiat tincidunt purus, et
imperdiet diam convallis vitae. Donec augue libero, blandit
ut dapibus id, vulputate at velit. Morbi condimentum
bibendum turpis, sed fermentum turpis ornare non.
In hac habitasse platea dictumst. Nulla facilisi. Proin vel
nibh mi, quis congue lectus. Etiam sit amet est nec quam
iaculis lobortis sit amet eu leo. Nulla mollis feugiat quam, a
interdum sapien pellentesque sed. Pellentesque eu sem ut
elit fringilla scelerisque a vel leo. Aenean quis lacus eget
massa condimentum adipiscing ac vitae sapien. Vivamus id
nibh aliquet ante blandit varius ac lobortis nisl. Pellentesque
turpis ante, consectetur egestas semper eget, sodales non
tellus. Pellentesque ullamcorper felis non nibh vehicula in
mollis mi eleifend. Integer eget interdum velit.
Nulla scelerisque nibh non neque tincidunt semper. Integer
lorem est, consequat eu convallis in, egestas quis purus.
Phasellus egestas mi risus. Phasellus a quam nec sapien
vulputate cursus. Maecenas mattis congue placerat.
Pellentesque et euismod massa. Morbi rhoncus euismod
luctus.
![Page 78: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/78.jpg)
Exclusion pathsFeature Set
• Simple figures and cutoutsUIBezierPath *exclusion = ButterflyBezierPath;textContainer.exclusionPaths = @[exclusion];
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Phasellus lacinia pretium diam non tempor. Aenean mollis
pellentesque lectus, vitae ultrices urna tincidunt eu. Mauris
ullamcorper elementum pharetra. Donec imperdiet lacinia
porttitor. Pellentesque habitant morbi tristique senectus et
netus et malesuada fames ac turpis egestas. Nulla lobortis
tortor libero. Donec fringilla placerat lectus sed commodo.
Nulla nisl nulla, feugiat eu sodales nec, semper non nibh.
Nunc porta lacinia cursus. Vestibulum ultrices euismod
euismod. Class aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos himenaeos. Quisque nec
lectus id diam molestie
consectetur sed sed ligula.
Nulla non luctus nibh.
Integer viverra posuere urna,
vel volutpat eros eleifend in.
Donec pharetra tincidunt lectus
vitae luctus.
Ut semper vulputate quam in dictum.
Maecenas lobortis porttitor lorem vel molestie. Nam
eros orci, mattis ac placerat nec, blandit sed orci. In
consequat convallis risus eu fermentum. Mauris accumsan
lobortis porta. Nunc feugiat, leo et consequat varius, velit
metus consectetur ante, in bibendum neque felis vel
sapien. Fusce vel risus in tellus convallis facilisis. Nunc
consectetur fringilla sem vel varius. Etiam cursus auctor
tortor vitae dictum. Sed interdum fringilla orci, sed
commodo magna ultricies fringilla. Donec eget convallis
lacus.
Etiam nec mauris lacus. Cras mattis lobortis
dignissim. Sed lorem turpis, feugiat at sodales
eget, porta vel purus. Sed ullamcorper diam ac
justo hendrerit porta. Aliquam sed erat ut
lorem facilisis sollicitudin quis eget mi. Sed
vitae massa id magna sagittis commodo.
Ut feugiat tincidunt purus, et imperdiet
diam convallis vitae. Donec augue
libero, blandit ut dapibus id,
vulputate at velit. Morbi
condimentum bibendum turpis,
sed fermentum turpis ornare non.
In hac habitasse platea dictumst.
Nulla facilisi. Proin vel nibh mi, quis
congue lectus. Etiam sit amet est nec quam iaculis
lobortis sit amet eu leo. Nulla mollis feugiat quam,
a interdum sapien pellentesque sed. Pellentesque eu
sem ut elit fringilla scelerisque a vel leo. Aenean quis lacus
eget massa condimentum adipiscing ac vitae sapien.
Vivamus id nibh aliquet ante blandit varius ac lobortis nisl.
Pellentesque turpis ante, consectetur egestas semper eget,
![Page 79: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/79.jpg)
Exclusion pathsFeature Set
• Easy, declarative model
![Page 80: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/80.jpg)
Exclusion pathsFeature Set
• Easy, declarative model•No subclassing or delegation needed
![Page 81: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/81.jpg)
NSTextContainer
NSTextContainerFeature Set
•Defines coordinate system and geometry for NSLayoutManager• Exclusion paths live in NSTextContainer’s coordinates•Hit-testing done in NSTextContainer’s coordinates
![Page 82: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/82.jpg)
NSTextContainer
NSTextContainerFeature Set
•Defines coordinate system and geometry for NSLayoutManager• Exclusion paths live in NSTextContainer’s coordinates•Hit-testing done in NSTextContainer’s coordinates
![Page 83: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/83.jpg)
NSTextContainerFeature Set
•Defines coordinate system and geometry for NSLayoutManager• Exclusion paths live in NSTextContainer’s coordinates
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Phasellus lacinia pretium diam non tempor. Aenean mollis
pellentesque lectus, vitae ultrices urna tincidunt eu. Mauris
ullamcorper elementum pharetra. Donec imperdiet lacinia
porttitor. Pellentesque habitant morbi tristique senectus et
netus et malesuada fames ac turpis egestas. Nulla lobortis
tortor libero. Donec fringilla placerat lectus sed commodo.
Nulla nisl nulla, feugiat eu sodales nec, semper non nibh.
Nunc porta lacinia cursus. Vestibulum ultrices euismod
euismod. Class aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos himenaeos. Quisque nec
lectus id diam molestie
consectetur sed sed ligula.
Nulla non luctus nibh.
Integer viverra posuere urna,
vel volutpat eros eleifend in.
Donec pharetra tincidunt lectus
vitae luctus.
Ut semper vulputate quam in dictum.
Maecenas lobortis porttitor lorem vel molestie. Nam
eros orci, mattis ac placerat nec, blandit sed orci. In
consequat convallis risus eu fermentum. Mauris accumsan
lobortis porta. Nunc feugiat, leo et consequat varius, velit
metus consectetur ante, in bibendum neque felis vel
sapien. Fusce vel risus in tellus convallis facilisis. Nunc
consectetur fringilla sem vel varius. Etiam cursus auctor
tortor vitae dictum. Sed interdum fringilla orci, sed
commodo magna ultricies fringilla. Donec eget convallis
lacus.
Etiam nec mauris lacus. Cras mattis lobortis
dignissim. Sed lorem turpis, feugiat at sodales
eget, porta vel purus. Sed ullamcorper diam ac
justo hendrerit porta. Aliquam sed erat ut
lorem facilisis sollicitudin quis eget mi. Sed
vitae massa id magna sagittis commodo.
Ut feugiat tincidunt purus, et imperdiet
diam convallis vitae. Donec augue
libero, blandit ut dapibus id,
vulputate at velit. Morbi
condimentum bibendum turpis,
sed fermentum turpis ornare non.
In hac habitasse platea dictumst.
Nulla facilisi. Proin vel nibh mi, quis
congue lectus. Etiam sit amet est nec quam iaculis
lobortis sit amet eu leo. Nulla mollis feugiat quam,
a interdum sapien pellentesque sed. Pellentesque eu
sem ut elit fringilla scelerisque a vel leo. Aenean quis lacus
eget massa condimentum adipiscing ac vitae sapien.
Vivamus id nibh aliquet ante blandit varius ac lobortis nisl.
Pellentesque turpis ante, consectetur egestas semper eget,
![Page 84: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/84.jpg)
NSTextContainerFeature Set
•Defines coordinate system and geometry for NSLayoutManager• Exclusion paths live in NSTextContainer’s coordinates•Hit-testing done in NSTextContainer’s coordinates
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Phasellus lacinia pretium diam non tempor. Aenean mollis
pellentesque lectus, vitae ultrices urna tincidunt eu. Mauris
ullamcorper elementum pharetra. Donec imperdiet lacinia
porttitor. Pellentesque habitant morbi tristique senectus et
netus et malesuada fames ac turpis egestas. Nulla lobortis
tortor libero. Donec fringilla placerat lectus sed commodo.
Nulla nisl nulla, feugiat eu sodales nec, semper non nibh.
Nunc porta lacinia cursus. Vestibulum ultrices euismod
euismod. Class aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos himenaeos. Quisque nec
lectus id diam molestie
consectetur sed sed ligula.
Nulla non luctus nibh.
Integer viverra posuere urna,
vel volutpat eros eleifend in.
Donec pharetra tincidunt lectus
vitae luctus.
Ut semper vulputate quam in dictum.
Maecenas lobortis porttitor lorem vel molestie. Nam
eros orci, mattis ac placerat nec, blandit sed orci. In
consequat convallis risus eu fermentum. Mauris accumsan
lobortis porta. Nunc feugiat, leo et consequat varius, velit
metus consectetur ante, in bibendum neque felis vel
sapien. Fusce vel risus in tellus convallis facilisis. Nunc
consectetur fringilla sem vel varius. Etiam cursus auctor
tortor vitae dictum. Sed interdum fringilla orci, sed
commodo magna ultricies fringilla. Donec eget convallis
lacus.
Etiam nec mauris lacus. Cras mattis lobortis
dignissim. Sed lorem turpis, feugiat at sodales
eget, porta vel purus. Sed ullamcorper diam ac
justo hendrerit porta. Aliquam sed erat ut
lorem facilisis sollicitudin quis eget mi. Sed
vitae massa id magna sagittis commodo.
Ut feugiat tincidunt purus, et imperdiet
diam convallis vitae. Donec augue
libero, blandit ut dapibus id,
vulputate at velit. Morbi
condimentum bibendum turpis,
sed fermentum turpis ornare non.
In hac habitasse platea dictumst.
Nulla facilisi. Proin vel nibh mi, quis
congue lectus. Etiam sit amet est nec quam iaculis
lobortis sit amet eu leo. Nulla mollis feugiat quam,
a interdum sapien pellentesque sed. Pellentesque eu
sem ut elit fringilla scelerisque a vel leo. Aenean quis lacus
eget massa condimentum adipiscing ac vitae sapien.
Vivamus id nibh aliquet ante blandit varius ac lobortis nisl.
Pellentesque turpis ante, consectetur egestas semper eget,
![Page 85: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/85.jpg)
• Resolving tap to a character index -(NSUInteger)characterIndexForPoint:(CGPoint)point inTextContainer:(NSTextContainer *)containerfractionOfDistanceBetweenInsertionPoints:(CGFloat *)partialFraction;
Hit-testing with NSLayoutManagerFeature Set
![Page 86: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/86.jpg)
• Resolving tap to a character index -(NSUInteger)characterIndexForPoint:(CGPoint)point inTextContainer:(NSTextContainer *)containerfractionOfDistanceBetweenInsertionPoints:(CGFloat *)partialFraction;
Hit-testing with NSLayoutManagerFeature Set
“a”
![Page 87: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/87.jpg)
GlyphsFeature Set
•What’s a glyph?
![Page 88: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/88.jpg)
GlyphsFeature Set
•What’s a glyph?• Represents one or more characters
ffi
![Page 89: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/89.jpg)
GlyphsFeature Set
•What’s a glyph?• Represents one or more characters•No 1:1 mapping from glyph(s) to character(s) or vice-versa
ffiffi
![Page 90: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/90.jpg)
Hit-testing with NSLayoutManagerFeature Set
•Glyph range to character range
ffi ffi
![Page 91: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/91.jpg)
Hit-testing with NSLayoutManagerFeature Set
•Glyph range to character range- (NSRange)characterRangeForGlyphRange:(NSRange)glyphRange actualGlyphRange:(NSRangePointer)actualGlyphRange;
{0,3}{0,1}ffi ffi
![Page 92: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/92.jpg)
Feature SetInteracting with links
![Page 93: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/93.jpg)
Feature SetInteracting with links
![Page 94: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/94.jpg)
Feature SetData Detectors
![Page 95: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/95.jpg)
Feature SetData Detectors
![Page 96: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/96.jpg)
Feature SetText attachments
![Page 97: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/97.jpg)
Feature SetText attachments
Attachment
![Page 98: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/98.jpg)
Feature SetText attachments
ExclusionAttachment
![Page 99: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/99.jpg)
•Usually used for inline images
Text attachmentsFeature Set
![Page 100: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/100.jpg)
•Usually used for inline images•Affects text layout
Text attachmentsFeature Set
![Page 101: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/101.jpg)
•Usually used for inline images•Affects text layout•Geometry for the contained data
Text attachmentsFeature Set
![Page 102: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/102.jpg)
Feature SetInteracting with attachments
![Page 103: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/103.jpg)
Feature SetInteracting with attachments
![Page 104: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/104.jpg)
DemoInteraction and layout
Jordan BreedingUIKit Engineer
![Page 105: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/105.jpg)
Demo summaryText Kit Tour
•Data Detectors for basic interaction
![Page 106: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/106.jpg)
Demo summaryText Kit Tour
•Data Detectors for basic interaction • Text views in collection view cells
![Page 107: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/107.jpg)
Demo summaryText Kit Tour
•Data Detectors for basic interaction • Text views in collection view cells• Text Styles
![Page 108: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/108.jpg)
Demo summaryText Kit Tour
•Data Detectors for basic interaction • Text views in collection view cells• Text Styles• Exclusion paths
![Page 109: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/109.jpg)
Realizing amazing designs with Text KitText Kit Design
Ian BairdiOS Text Kit Lead Engineer
![Page 110: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/110.jpg)
Layout and positioning techniquesText Kit Design
![Page 111: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/111.jpg)
Layout and positioning techniquesText Kit Design
![Page 112: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/112.jpg)
Layout and positioning techniquesText Kit Design
![Page 113: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/113.jpg)
Layout and positioningText Kit Design
Hey John:
![Page 114: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/114.jpg)
Layout and positioningText Kit Design
Hey John:
![Page 115: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/115.jpg)
Layout and positioningText Kit Design
Hey John:.8 * Cap height
![Page 116: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/116.jpg)
Font metricsText Kit Design
• If you have a detailed spec (like Mail) you’ll need to become familiar with the following font metrics
AbcdefgAbcdefg
![Page 117: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/117.jpg)
Font metricsText Kit Design
• If you have a detailed spec (like Mail) you’ll need to become familiar with the following font metrics• Line height[myFont lineHeight] Abcdefg
Abcdefg
![Page 118: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/118.jpg)
Font metricsText Kit Design
• If you have a detailed spec (like Mail) you’ll need to become familiar with the following font metrics• Line height[myFont lineHeight]
• Cap height[myFont capHeight] Abcdefg
Abcdefg
![Page 119: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/119.jpg)
Font metricsText Kit Design
• If you have a detailed spec (like Mail) you’ll need to become familiar with the following font metrics• Line height[myFont lineHeight]
• Cap height[myFont capHeight]
• Leading: space between lines of text[myFont leading]
AbcdefgAbcdefg
![Page 120: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/120.jpg)
Font metricsText Kit Design
• If you have a detailed spec (like Mail) you’ll need to become familiar with the following font metrics• Line height[myFont lineHeight]
• Cap height[myFont capHeight]
• Leading: space between lines of text[myFont leading]
• Can be negative to move lines closer together!
AbcdefgAbcdefg
![Page 121: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/121.jpg)
Changing sizeText Kit Design
• UIContentSizeCategoryDidChangeNotification emitted when user selects a new size
![Page 122: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/122.jpg)
Changing sizeText Kit Design
• UIContentSizeCategoryDidChangeNotification emitted when user selects a new size•Observe UIContentSizeCategoryDidChangeNotification and re-layout your UI when received
![Page 123: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/123.jpg)
Changing sizeText Kit Design
• UIContentSizeCategoryDidChangeNotification emitted when user selects a new size•Observe UIContentSizeCategoryDidChangeNotification and re-layout your UI when received■ Invalidate intrinsic content size on UIKit views positioned by Auto Layout
![Page 124: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/124.jpg)
Changing sizeText Kit Design
• UIContentSizeCategoryDidChangeNotification emitted when user selects a new size•Observe UIContentSizeCategoryDidChangeNotification and re-layout your UI when received■ Invalidate intrinsic content size on UIKit views positioned by Auto Layout
■ Call setNeedsLayout to re-layout your UI if positioning manually
![Page 125: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/125.jpg)
Changing sizeText Kit Design
• UIContentSizeCategoryDidChangeNotification emitted when user selects a new size•Observe UIContentSizeCategoryDidChangeNotification and re-layout your UI when received■ Invalidate intrinsic content size on UIKit views positioned by Auto Layout
■ Call setNeedsLayout to re-layout your UI if positioning manually■ Invalidate cached preferred fonts or font descriptors
![Page 126: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/126.jpg)
DemoText Kit and design
Jordan BreedingUIKit Engineer
![Page 127: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/127.jpg)
It’s dynamic!Text Kit and Design
• Realize complex designs
![Page 128: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/128.jpg)
It’s dynamic!Text Kit and Design
• Realize complex designs• Respond to the change notification
![Page 129: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/129.jpg)
It’s dynamic!Text Kit and Design
• Realize complex designs• Respond to the change notification• Customize text container line break mode
![Page 130: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/130.jpg)
Content modification during user inputInteractive Rich Text
Johannes FortmannUIKit Engineer
![Page 131: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/131.jpg)
Interactive content updatesText Kit and Rich Text
![Page 132: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/132.jpg)
Interactive content updatesText Kit and Rich Text
• iOS 6: -attributedText property
![Page 133: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/133.jpg)
Interactive content updatesText Kit and Rich Text
• iOS 6: -attributedText property• iOS 7: direct access to -textStorage
![Page 134: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/134.jpg)
Interactive content updatesText Kit and Rich Text
• iOS 6: -attributedText property• iOS 7: direct access to -textStorage• Selective editing messages with change notifications
![Page 135: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/135.jpg)
Anatomy of an updateText Kit and Rich Text
![Page 136: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/136.jpg)
Anatomy of an updateText Kit and Rich Text
•Use attributed string methods to modify
![Page 137: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/137.jpg)
Anatomy of an updateText Kit and Rich Text
•Use attributed string methods to modify
![Page 138: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/138.jpg)
Anatomy of an updateText Kit and Rich Text
•Use attributed string methods to modify• Bracket edits to batch updates
![Page 139: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/139.jpg)
Anatomy of an updateText Kit and Rich Text
•Use attributed string methods to modify• Bracket edits to batch updates[tv.textStorage beginEditing];
![Page 140: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/140.jpg)
Anatomy of an updateText Kit and Rich Text
•Use attributed string methods to modify• Bracket edits to batch updates[tv.textStorage beginEditing];[self markWord:@”Alice” inTextStorage:tv];
![Page 141: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/141.jpg)
Anatomy of an updateText Kit and Rich Text
•Use attributed string methods to modify• Bracket edits to batch updates[tv.textStorage beginEditing];[self markWord:@”Alice” inTextStorage:tv];[tv.textStorage endEditing];
![Page 142: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/142.jpg)
Anatomy of an updateText Kit and Rich Text
•Use attributed string methods to modify• Bracket edits to batch updates[tv.textStorage beginEditing];[self markWord:@”Alice” inTextStorage:tv];[tv.textStorage endEditing];…Text Kit processes changes…
![Page 143: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/143.jpg)
Anatomy of an updateText Kit and Rich Text
•Use attributed string methods to modify• Bracket edits to batch updates[tv.textStorage beginEditing];[self markWord:@”Alice” inTextStorage:tv];[tv.textStorage endEditing];…Text Kit processes changes…
![Page 144: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/144.jpg)
Subclassing NSTextStorageRich Text Editing
•Why?
![Page 145: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/145.jpg)
Subclassing NSTextStorageRich Text Editing
•Why?• Example: Change text attributes while typing
![Page 146: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/146.jpg)
Subclassing NSTextStorageRich Text Editing
•Why?• Example: Change text attributes while typing
@somebody
![Page 147: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/147.jpg)
Subclassing NSTextStorageRich Text Editing
•Why?• Example: Change text attributes while typing
@somebody@somebody: nice layout!@somebody
![Page 148: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/148.jpg)
Subclassing NSTextStorageRich Text Editing
![Page 149: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/149.jpg)
• Class cluster
Subclassing NSTextStorageRich Text Editing
![Page 150: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/150.jpg)
• Class cluster
Subclassing NSTextStorageRich Text Editing
NSTextStorage
![Page 151: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/151.jpg)
• Class cluster
Subclassing NSTextStorageRich Text Editing
Concrete text storage
NSTextStorage
![Page 152: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/152.jpg)
• Class cluster
Subclassing NSTextStorageRich Text Editing
Concrete text storage
NSTextStorage
Your subclass
![Page 153: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/153.jpg)
• Class cluster•Override primitive methods
Subclassing NSTextStorageRich Text Editing
Concrete text storage
NSTextStorage
-string-attributesAtIndex:effectiveRange:-replaceCharactersInRange:withString:-setAttributes:range:
Your subclass
![Page 154: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/154.jpg)
• Class cluster•Override primitive methods
Subclassing NSTextStorageRich Text Editing
Concrete text storage
NSTextStorage
-string-attributesAtIndex:effectiveRange:-replaceCharactersInRange:withString:-setAttributes:range:
Your subclass
![Page 155: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/155.jpg)
• Class cluster•Override primitive methods
Subclassing NSTextStorageRich Text Editing
Concrete text storage
NSTextStorage
-string-attributesAtIndex:effectiveRange:-replaceCharactersInRange:withString:-setAttributes:range:
Your subclass
![Page 156: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/156.jpg)
DemoDynamic attributes and interaction
![Page 157: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/157.jpg)
DemoText Kit and Data
![Page 158: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/158.jpg)
DemoText Kit and Data
•Assembling the text system
![Page 159: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/159.jpg)
DemoText Kit and Data
•Assembling the text system• Subclassing NSTextStorage
![Page 160: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/160.jpg)
DemoText Kit and Data
•Assembling the text system• Subclassing NSTextStorage• Interactive content modification
![Page 161: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/161.jpg)
Knowledge absorptionWrapping It Up
![Page 162: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/162.jpg)
Text Kit
![Page 163: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/163.jpg)
Text Kit
•Highly capable first-class citizen of UIKit
![Page 164: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/164.jpg)
Text Kit
•Highly capable first-class citizen of UIKit• Powerful
![Page 165: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/165.jpg)
Text Kit
•Highly capable first-class citizen of UIKit• Powerful• Customizable and extensible
![Page 166: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/166.jpg)
More Information
Jake BehrensApp Frameworks [email protected]
DocumentationiOS Human Interface Guidelineshttp://developer.apple.com/library/ios/#documentation/userexperience
Apple Developer Forumshttp://devforums.apple.com
![Page 167: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/167.jpg)
Related Sessions
Advanced Text Layouts and Effects with Text Kit MissionThursday 2:00PM
Using Fonts with Text Kit PresidioFriday 9:00AM
What’s New in Safari and WebKit for Web Developers MissionTuesday 9:00AM
![Page 168: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/168.jpg)
Labs
Text Kit and Core Text Lab Frameworks Lab BWednesday 4:30PM
Text Kit and Core Text Lab Frameworks Lab AThursday 4:30PM
![Page 169: Introducing Text Kit - Apple Inc. · •Mastering Core Text considered to be a “rite of passage ... •Seamlessly integrates with animations, UICollectionView, and UITableView.](https://reader035.fdocuments.in/reader035/viewer/2022081613/5fb31f72b7a489679515f4bc/html5/thumbnails/169.jpg)