Fix text format menu on iOS 13.2

This commit is contained in:
Ali
2019-11-02 22:55:46 +04:00
parent da67ea139c
commit 636e66b048
4 changed files with 27 additions and 4 deletions

View File

@@ -71,6 +71,8 @@ NS_ASSUME_NONNULL_BEGIN
//! @abstract The range of text currently selected. If length is zero, the range is the cursor location.
@property NSRange selectedRange;
@property (readonly) CGRect selectionRect;
#pragma mark - Placeholder
/**
@abstract Indicates if the receiver is displaying the placeholder text.

View File

@@ -566,6 +566,15 @@
_textKitComponents.textView.selectedRange = selectedRange;
}
- (CGRect)selectionRect {
UITextRange *range = [_textKitComponents.textView selectedTextRange];
if (range != nil) {
return [_textKitComponents.textView firstRectForRange:range];
} else {
return [_textKitComponents.textView bounds];
}
}
#pragma mark - Placeholder
- (BOOL)isDisplayingPlaceholder
{