implement static method
NSTextStorageObserving
implement({
- required NSTextStorage? textStorage(),
- required void setTextStorage_(),
- required void processEditingForTextStorage_edited_range_changeInLength_invalidatedRange_(),
- required void performEditingTransactionForTextStorage_usingBlock_(
- NSTextStorage,
- ObjCBlock<
Void Function()>
- bool $keepIsolateAlive = true,
Builds an object that implements the NSTextStorageObserving protocol. To implement
multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly.
If $keepIsolateAlive is true, this protocol will keep this isolate
alive until it is garbage collected by both Dart and ObjC.
Implementation
static NSTextStorageObserving implement({
required NSTextStorage? Function() textStorage,
required void Function(NSTextStorage?) setTextStorage_,
required void Function(
NSTextStorage,
NSTextStorageEditActions,
NSRange,
DartNSInteger,
NSRange,
)
processEditingForTextStorage_edited_range_changeInLength_invalidatedRange_,
required void Function(NSTextStorage, objc.ObjCBlock<ffi.Void Function()>)
performEditingTransactionForTextStorage_usingBlock_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSTextStorageObserving',
);
NSTextStorageObserving.textStorage.implement(builder, textStorage);
NSTextStorageObserving.setTextStorage_.implement(builder, setTextStorage_);
NSTextStorageObserving
.processEditingForTextStorage_edited_range_changeInLength_invalidatedRange_
.implement(
builder,
processEditingForTextStorage_edited_range_changeInLength_invalidatedRange_,
);
NSTextStorageObserving.performEditingTransactionForTextStorage_usingBlock_
.implement(
builder,
performEditingTransactionForTextStorage_usingBlock_,
);
builder.addProtocol($protocol);
return NSTextStorageObserving.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}