SlideShare a Scribd company logo
1 of 22
 Text Kit is a high-level, feature-rich set of
classes that has all the characteristics for
fine typography to handle text
 The developers can add different styles and
formatting to the text, such as columns,
multiple fonts, paragraphs, and pages
 It’s responsible for creating, editing,
displaying, and storing text with less code, as
it’s integrated with all UIKit text-based
controls
The developers can make use of the following
classes:
 NSAttributedString
 NSLayoutManager
 NSTextContainer
 NSTextStorage
 The UIKit framework adds methods
to NSAttributedString to support the drawing
of styled strings and to compute the size and
metrics of a string prior to drawing
 The NSAttributedString class has been
extended to support new attributes
 Framework/System/Library/Frameworks/UI
Kit.framework
 Creating an Attributed String
– initWithData:options:documentAttributes:error:
– initWithFileURL:options:documentAttributes:error:
 Drawing the String
– drawAtPoint:
– drawInRect:
– drawWithRect:options:context:
 Getting Metrics for the String
– size
– boundingRectWithSize:options:context:
 Generating Data
– dataFromRange:documentAttributes:error:
– fileWrapperFromRange:documentAttributes:error:
 The NSTextStorage class defines the fundamental
interface for managing text-based content.
 Framework/System/Library/Frameworks/UIKit.f
ramework
 NSTextStorage is a semiconcrete subclass
of NSMutableAttributedString that manages a set
of client NSLayoutManager objects, notifying
them of any changes to its characters or
attributes so that they can relay and redisplay
the text as needed
 NSTextStorage defines the fundamental storage
mechanism of the Text Kit’s extended text-
handling system
 Setting the Delegate
delegate property
 Determining the Nature of Changes
editedMask property
changeInLength property
editedRange property
 Handling Text Edited Messages
fixesAttributesLazily property
 Handling Layout Managers
layoutManagers property
 Handling Text Edited Messages
– edited:range:changeInLength:
– ensureAttributesAreFixedInRange:
– invalidateAttributesInRange:
– processEditing
 Handling Layout Managers
– addLayoutManager:
– removeLayoutManager:
 The NSTextContainer class defines a region where
text is laid out
 Framework/System/Library/Frameworks/UIKit.frame
work
 The NSTextContainer class defines a region in which
text is laid out
 An NSLayoutManager object uses one or
more NSTextContainer objects to determine where to
break lines, lay out portions of text, and so on
 An NSTextContainer object defines rectangular
regions, and you can define exclusion paths inside the
text container's bounding rectangle so that text flows
around the exclusion path as it is laid out
 You can create subclasses that define regions of
nonrectangular shapes, such as circular regions
 Laying Out Text
layoutManager property
 Defining the Container Shape
exclusionPaths property
size property
lineBreakMode property
 Synchronizing with the Text View
heightTracksTextView property
widthTracksTextView property
 Constraining Layout
maximumNumberOfLines property
lineFragmentPadding property
 Creating a Text Container
– initWithSize:
 Laying Out Text
–
lineFragmentRectForProposedRect:atIndex:w
ritingDirection:remainingRect:
 The NSLayoutManager class generates glyphs and lays
out text
 Framework/System/Library/Frameworks/UIKit.frame
work
 An NSLayoutManager object coordinates the layout
and display of characters held in
an NSTextStorage object
 Maps Unicode character codes to glyphs, sets the
glyphs in a series of NSTextContainer objects, and
displays them in a series of text view objects
 coordinates its text view objects, provides services to
those text views to support editing paragraph styles,
and handles the layout and display of text attributes
not inherent in glyphs (such as underline or
strikethrough
 Text Storage
textStorage property
 Text Containers
textContainers property
 Delegate
delegate property
 Global Layout Manager Options
allowsNonContiguousLayout property
hasNonContiguousLayout property
hyphenationFactor property
showsControlCharacters property
showsInvisibleCharacters property
usesFontLeading property
 Getting Glyphs and Glyph Properties
numberOfGlyphs property
 Getting Layout Information
extraLineFragmentRect property
extraLineFragmentTextContainer property
extraLineFragmentUsedRect property
 Text Containers
– addTextContainer:– insertTextContainer:atIndex:
– removeTextContainerAtIndex:
– setTextContainer:forGlyphRange:
– textContainerChangedGeometry:
textContainerForGlyphAtIndex:effectiveRange:
– usedRectForTextContainer:
 Invalidation of Layout and Glyphs
– invalidateDisplayForCharacterRange:
– invalidateDisplayForGlyphRange:
–
invalidateGlyphsForCharacterRange:changeInLength:actualChara
cterRange:
– invalidateLayoutForCharacterRange:actualCharacterRange:
–
processEditingForTextStorage:edited:range:changeInLength:inval
idatedRange:
 Causing Glyph Generation and Layout
– ensureGlyphsForCharacterRange:
– ensureGlyphsForGlyphRange:
ensureLayoutForBoundingRect:inTextContainer:
– ensureLayoutForCharacterRange:
– ensureLayoutForGlyphRange:
– ensureLayoutForTextContainer:
 Setting Glyphs and Glyph Properties
setGlyphs:properties:characterIndexes:font:forGly
phRange:
 Getting Glyphs and Glyph Properties
– characterIndexForGlyphAtIndex:
– getGlyphsInRange:glyphs:properties:characterIndexes:bidiLevels:
– glyphAtIndex:
– glyphAtIndex:isValidIndex:
– glyphIndexForCharacterAtIndex:
– isValidGlyphIndex:
– propertyForGlyphAtIndex:
 Setting Layout Information
– setAttachmentSize:forGlyphRange:
– setDrawsOutsideLineFragment:forGlyphAtIndex:
– setExtraLineFragmentRect:usedRect:textContainer:
– setLineFragmentRect:forGlyphRange:usedRect:
– setLocation:forStartOfGlyphRange:
– setNotShownAttribute:forGlyphAtIndex:
 Getting Layout Information
– attachmentSizeForGlyphAtIndex:
– drawsOutsideLineFragmentForGlyphAtIndex:
– firstUnlaidCharacterIndex
– firstUnlaidGlyphIndex
– getFirstUnlaidCharacterIndex:glyphIndex:
– lineFragmentRectForGlyphAtIndex:effectiveRange:
–
lineFragmentUsedRectForGlyphAtIndex:effectiveRan
ge:
– locationForGlyphAtIndex:
– notShownAttributeForGlyphAtIndex:
– truncatedGlyphRangeInLineFragmentForGlyphAtIndex:
 Advanced Layout Queries
– boundingRectForGlyphRange:inTextContainer:
– characterIndexForPoint:inTextContainer:fractionOfDistanceBetweenInsertionPoints:
– characterRangeForGlyphRange:actualGlyphRange:
–
enumerateEnclosingRectsForGlyphRange:withinSelectedGlyphRange:inTextContainer
:usingBlock:
– enumerateLineFragmentsForGlyphRange:usingBlock:
– fractionOfDistanceThroughGlyphForPoint:inTextContainer:
–
getLineFragmentInsertionPointsForCharacterAtIndex:alternatePositions:inDisplayOr
der:positions:characterIndexes:
– glyphIndexForPoint:inTextContainer:
– glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:
– glyphRangeForBoundingRect:inTextContainer:
– glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer:
– glyphRangeForCharacterRange:actualCharacterRange:
– glyphRangeForTextContainer:
– rangeOfNominallySpacedGlyphsContainingIndex:
 Supporting Drawing
– drawBackgroundForGlyphRange:atPoint:
– drawGlyphsForGlyphRange:atPoint:
–
drawStrikethroughForGlyphRange:strikethroughType:baselineOffs
et:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:
–
drawUnderlineForGlyphRange:underlineType:baselineOffset:line
FragmentRect:lineFragmentGlyphRange:containerOrigin:
– fillBackgroundRectArray:count:forCharacterRange:color:
– showCGGlyphs:positions:count:font:matrix:attributes:inContext:
–
strikethroughGlyphRange:strikethroughType:lineFragmentRect:li
neFragmentGlyphRange:containerOrigin:
–
underlineGlyphRange:underlineType:lineFragmentRect:lineFragm
entGlyphRange:containerOrigin:
 Lesser Build Size due to lesser use of graphics
to display textual images
 Lesser Coding i.e concatenation of two
labels/strings with different layouts is not a
headache now with the release of iOS 7
Text kit ios7

More Related Content

Similar to Text kit ios7

Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad NicheTech Com. Solutions Pvt. Ltd.
 
Groovy component
Groovy componentGroovy component
Groovy componentSindhu VL
 
Serialization in .NET
Serialization in .NETSerialization in .NET
Serialization in .NETAbhi Arya
 
Android Custom views
Android Custom views   Android Custom views
Android Custom views Matej Vukosav
 
Text Layout With Core Text
Text Layout With Core TextText Layout With Core Text
Text Layout With Core TextDavid Ding
 
1. three examples of life-critical software applications area) IS.pdf
1. three examples of life-critical software applications area) IS.pdf1. three examples of life-critical software applications area) IS.pdf
1. three examples of life-critical software applications area) IS.pdfsaahinmanpam
 
Artefactos biz talk 2006
Artefactos biz talk 2006Artefactos biz talk 2006
Artefactos biz talk 2006Sandro Pereira
 
Flexbox, Grid and Sass
Flexbox, Grid and SassFlexbox, Grid and Sass
Flexbox, Grid and SassSeble Nigussie
 
Active server pages
Active server pagesActive server pages
Active server pagesstudent
 
Intro to Core Data
Intro to Core DataIntro to Core Data
Intro to Core DataMake School
 
Adopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuiteAdopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuiteAnswerModules
 
Section 3 api contents
Section 3   api contentsSection 3   api contents
Section 3 api contentsJuarez Junior
 
Pavel_Kravchenko_Mobile Development
Pavel_Kravchenko_Mobile DevelopmentPavel_Kravchenko_Mobile Development
Pavel_Kravchenko_Mobile DevelopmentCiklum
 
Intro To Flex Typography 360|Flex
Intro To Flex Typography 360|FlexIntro To Flex Typography 360|Flex
Intro To Flex Typography 360|FlexMatt Guest
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Shyamala Prayaga
 
Text field and textarea
Text field and textareaText field and textarea
Text field and textareamyrajendra
 

Similar to Text kit ios7 (20)

Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
 
Groovy component
Groovy componentGroovy component
Groovy component
 
CSC PPT 12.pptx
CSC PPT 12.pptxCSC PPT 12.pptx
CSC PPT 12.pptx
 
Serialization in .NET
Serialization in .NETSerialization in .NET
Serialization in .NET
 
Android Custom views
Android Custom views   Android Custom views
Android Custom views
 
Text classification
Text classificationText classification
Text classification
 
Text Layout With Core Text
Text Layout With Core TextText Layout With Core Text
Text Layout With Core Text
 
1. three examples of life-critical software applications area) IS.pdf
1. three examples of life-critical software applications area) IS.pdf1. three examples of life-critical software applications area) IS.pdf
1. three examples of life-critical software applications area) IS.pdf
 
Artefactos biz talk 2006
Artefactos biz talk 2006Artefactos biz talk 2006
Artefactos biz talk 2006
 
Flexbox, Grid and Sass
Flexbox, Grid and SassFlexbox, Grid and Sass
Flexbox, Grid and Sass
 
Active server pages
Active server pagesActive server pages
Active server pages
 
Intro to Core Data
Intro to Core DataIntro to Core Data
Intro to Core Data
 
Adopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuiteAdopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuite
 
Section 3 api contents
Section 3   api contentsSection 3   api contents
Section 3 api contents
 
Pavel_Kravchenko_Mobile Development
Pavel_Kravchenko_Mobile DevelopmentPavel_Kravchenko_Mobile Development
Pavel_Kravchenko_Mobile Development
 
Intro To Flex Typography 360|Flex
Intro To Flex Typography 360|FlexIntro To Flex Typography 360|Flex
Intro To Flex Typography 360|Flex
 
Design patterns-sav
Design patterns-savDesign patterns-sav
Design patterns-sav
 
Orchard
OrchardOrchard
Orchard
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2
 
Text field and textarea
Text field and textareaText field and textarea
Text field and textarea
 

Recently uploaded

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Recently uploaded (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

Text kit ios7

  • 1.
  • 2.  Text Kit is a high-level, feature-rich set of classes that has all the characteristics for fine typography to handle text  The developers can add different styles and formatting to the text, such as columns, multiple fonts, paragraphs, and pages  It’s responsible for creating, editing, displaying, and storing text with less code, as it’s integrated with all UIKit text-based controls
  • 3. The developers can make use of the following classes:  NSAttributedString  NSLayoutManager  NSTextContainer  NSTextStorage
  • 4.  The UIKit framework adds methods to NSAttributedString to support the drawing of styled strings and to compute the size and metrics of a string prior to drawing  The NSAttributedString class has been extended to support new attributes  Framework/System/Library/Frameworks/UI Kit.framework
  • 5.  Creating an Attributed String – initWithData:options:documentAttributes:error: – initWithFileURL:options:documentAttributes:error:  Drawing the String – drawAtPoint: – drawInRect: – drawWithRect:options:context:  Getting Metrics for the String – size – boundingRectWithSize:options:context:  Generating Data – dataFromRange:documentAttributes:error: – fileWrapperFromRange:documentAttributes:error:
  • 6.  The NSTextStorage class defines the fundamental interface for managing text-based content.  Framework/System/Library/Frameworks/UIKit.f ramework  NSTextStorage is a semiconcrete subclass of NSMutableAttributedString that manages a set of client NSLayoutManager objects, notifying them of any changes to its characters or attributes so that they can relay and redisplay the text as needed  NSTextStorage defines the fundamental storage mechanism of the Text Kit’s extended text- handling system
  • 7.  Setting the Delegate delegate property  Determining the Nature of Changes editedMask property changeInLength property editedRange property  Handling Text Edited Messages fixesAttributesLazily property  Handling Layout Managers layoutManagers property
  • 8.  Handling Text Edited Messages – edited:range:changeInLength: – ensureAttributesAreFixedInRange: – invalidateAttributesInRange: – processEditing  Handling Layout Managers – addLayoutManager: – removeLayoutManager:
  • 9.  The NSTextContainer class defines a region where text is laid out  Framework/System/Library/Frameworks/UIKit.frame work  The NSTextContainer class defines a region in which text is laid out  An NSLayoutManager object uses one or more NSTextContainer objects to determine where to break lines, lay out portions of text, and so on  An NSTextContainer object defines rectangular regions, and you can define exclusion paths inside the text container's bounding rectangle so that text flows around the exclusion path as it is laid out  You can create subclasses that define regions of nonrectangular shapes, such as circular regions
  • 10.  Laying Out Text layoutManager property  Defining the Container Shape exclusionPaths property size property lineBreakMode property  Synchronizing with the Text View heightTracksTextView property widthTracksTextView property  Constraining Layout maximumNumberOfLines property lineFragmentPadding property
  • 11.  Creating a Text Container – initWithSize:  Laying Out Text – lineFragmentRectForProposedRect:atIndex:w ritingDirection:remainingRect:
  • 12.  The NSLayoutManager class generates glyphs and lays out text  Framework/System/Library/Frameworks/UIKit.frame work  An NSLayoutManager object coordinates the layout and display of characters held in an NSTextStorage object  Maps Unicode character codes to glyphs, sets the glyphs in a series of NSTextContainer objects, and displays them in a series of text view objects  coordinates its text view objects, provides services to those text views to support editing paragraph styles, and handles the layout and display of text attributes not inherent in glyphs (such as underline or strikethrough
  • 13.  Text Storage textStorage property  Text Containers textContainers property  Delegate delegate property  Global Layout Manager Options allowsNonContiguousLayout property hasNonContiguousLayout property hyphenationFactor property showsControlCharacters property showsInvisibleCharacters property usesFontLeading property
  • 14.  Getting Glyphs and Glyph Properties numberOfGlyphs property  Getting Layout Information extraLineFragmentRect property extraLineFragmentTextContainer property extraLineFragmentUsedRect property
  • 15.  Text Containers – addTextContainer:– insertTextContainer:atIndex: – removeTextContainerAtIndex: – setTextContainer:forGlyphRange: – textContainerChangedGeometry: textContainerForGlyphAtIndex:effectiveRange: – usedRectForTextContainer:  Invalidation of Layout and Glyphs – invalidateDisplayForCharacterRange: – invalidateDisplayForGlyphRange: – invalidateGlyphsForCharacterRange:changeInLength:actualChara cterRange: – invalidateLayoutForCharacterRange:actualCharacterRange: – processEditingForTextStorage:edited:range:changeInLength:inval idatedRange:
  • 16.  Causing Glyph Generation and Layout – ensureGlyphsForCharacterRange: – ensureGlyphsForGlyphRange: ensureLayoutForBoundingRect:inTextContainer: – ensureLayoutForCharacterRange: – ensureLayoutForGlyphRange: – ensureLayoutForTextContainer:  Setting Glyphs and Glyph Properties setGlyphs:properties:characterIndexes:font:forGly phRange:
  • 17.  Getting Glyphs and Glyph Properties – characterIndexForGlyphAtIndex: – getGlyphsInRange:glyphs:properties:characterIndexes:bidiLevels: – glyphAtIndex: – glyphAtIndex:isValidIndex: – glyphIndexForCharacterAtIndex: – isValidGlyphIndex: – propertyForGlyphAtIndex:  Setting Layout Information – setAttachmentSize:forGlyphRange: – setDrawsOutsideLineFragment:forGlyphAtIndex: – setExtraLineFragmentRect:usedRect:textContainer: – setLineFragmentRect:forGlyphRange:usedRect: – setLocation:forStartOfGlyphRange: – setNotShownAttribute:forGlyphAtIndex:
  • 18.  Getting Layout Information – attachmentSizeForGlyphAtIndex: – drawsOutsideLineFragmentForGlyphAtIndex: – firstUnlaidCharacterIndex – firstUnlaidGlyphIndex – getFirstUnlaidCharacterIndex:glyphIndex: – lineFragmentRectForGlyphAtIndex:effectiveRange: – lineFragmentUsedRectForGlyphAtIndex:effectiveRan ge: – locationForGlyphAtIndex: – notShownAttributeForGlyphAtIndex: – truncatedGlyphRangeInLineFragmentForGlyphAtIndex:
  • 19.  Advanced Layout Queries – boundingRectForGlyphRange:inTextContainer: – characterIndexForPoint:inTextContainer:fractionOfDistanceBetweenInsertionPoints: – characterRangeForGlyphRange:actualGlyphRange: – enumerateEnclosingRectsForGlyphRange:withinSelectedGlyphRange:inTextContainer :usingBlock: – enumerateLineFragmentsForGlyphRange:usingBlock: – fractionOfDistanceThroughGlyphForPoint:inTextContainer: – getLineFragmentInsertionPointsForCharacterAtIndex:alternatePositions:inDisplayOr der:positions:characterIndexes: – glyphIndexForPoint:inTextContainer: – glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph: – glyphRangeForBoundingRect:inTextContainer: – glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer: – glyphRangeForCharacterRange:actualCharacterRange: – glyphRangeForTextContainer: – rangeOfNominallySpacedGlyphsContainingIndex:
  • 20.  Supporting Drawing – drawBackgroundForGlyphRange:atPoint: – drawGlyphsForGlyphRange:atPoint: – drawStrikethroughForGlyphRange:strikethroughType:baselineOffs et:lineFragmentRect:lineFragmentGlyphRange:containerOrigin: – drawUnderlineForGlyphRange:underlineType:baselineOffset:line FragmentRect:lineFragmentGlyphRange:containerOrigin: – fillBackgroundRectArray:count:forCharacterRange:color: – showCGGlyphs:positions:count:font:matrix:attributes:inContext: – strikethroughGlyphRange:strikethroughType:lineFragmentRect:li neFragmentGlyphRange:containerOrigin: – underlineGlyphRange:underlineType:lineFragmentRect:lineFragm entGlyphRange:containerOrigin:
  • 21.  Lesser Build Size due to lesser use of graphics to display textual images  Lesser Coding i.e concatenation of two labels/strings with different layouts is not a headache now with the release of iOS 7