See Also: NSTextStorage
[MonoTouch.ObjCRuntime.Introduced(MonoTouch.ObjCRuntime.PlatformName.iOS, 7, 0, MonoTouch.ObjCRuntime.PlatformArchitecture.None, null)]
public class NSTextStorage : NSMutableAttributedString
iOS 7 introduced "Text Kit," a broad set of APIs and modifications of existing classes, built on MonoTouch.CoreText, that greatly expands the typographical flexibility of iOS.
An NSTextStorage object holds the text that is to be displayed. As with NSMutableAttributedString, application developers can manipulate text styles using NSMutableAttributedString.AddAttribute or NSMutableAttributedString.AddAttributes. The key addition to NSTextStorage is that it maintains references to one or more NSLayoutManagers (NSTextStorage.LayoutManagers) , which are responsible for converting text characters into glyphs and laying them out in accordance with the NSLayoutManagers' associated UITextView and NSTextContainer objects.
If you subclass NSTextStorage, you must override four methods. Two from NSAttributedString (NSAttributedString.LowLevelValue and NSAttributedString.LowLevelGetAttributes) and two from NSMutableAttributedString (AttributedString.LowLevelSetAttributes and NSMutableAttributedString.Replace(NSRange,String)).
The reason why you must override the low-level methods is because NSTextStorage is a very chatty interface that likes to call those methods up to thousands of times for each character that the user enters. So it important to use the low-level interface. You can review some of Xamarin's samples to see how to implement those if you have questions on how to do this.
Since NSTextStorage is a very chatty API,
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0
The members of MonoTouch.UIKit.NSTextStorage are listed below.
See Also: NSMutableAttributedString
|Default constructor, initializes a new instance of this class.|
|A constructor that initializes the object from the data stored in the unarchiver object.|
|Constructor to call on derived classes to skip initialization and merely allocate the object.|
|A constructor used when creating managed representations of unmanaged objects; Called by the runtime.|
|ChangeInLength||Int32. The change in length for the pending changes.|
|ClassHandle||IntPtr. The handle for this class.|
|Delegate||NSTextStorageDelegate. An instance of the MonoTouch.UIKit.NSTextStorageDelegate model class which acts as the class delegate.|
|EditedMask||NSTextStorageEditActions. The kinds of edits pending for this NSTextStorage.|
|EditedRange||NSRange. The range in this NSTextStorage in which pending changes have been made.|
|[read-only]||FixesAttributesLazily||Boolean. Whether this NSTextStorage fixes attributes lazily. Read-only.|
|[read-only]||LayoutManagers||NSObject. The NSLayoutManagers associated with this NSTextStorage. Read-only.|
|WeakDelegate||NSObject. An object that can respond to the delegate protocol for this type|
Adds an NSLayoutManager to this NSTextStorage.
|Edited(NSTextStorageEditActions, NSRange, Int32)|
Indicates a change.
Ensures that attributes have been fixed in the given range.
Invalidates attributes in the specified range.
Activates post-editing operations.
Removes an NSLayoutManager from this NSTextStorage's LayoutManagers collection.