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

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

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