浏览代码

【VisionPro适配】适配VisionOS

xcbosa mbp16 1 年之前
父节点
当前提交
3c8fc6c81f
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      YYText/YYTextView.m

+ 6 - 1
YYText/YYTextView.m

@@ -3491,7 +3491,12 @@ YYTextDebugTarget, YYTextKeyboardObserver> {
 }
 
 #if TARGET_OS_VISION
-
+- (void)setBaseWritingDirection:(NSInteger)writingDirection forRange:(YYTextRange *)range {
+    if (!range) return;
+    range = [self _correctedTextRange:range];
+    [_innerText yy_setBaseWritingDirection:(NSWritingDirection)writingDirection range:range.asRange];
+    [self _commitUpdate];
+}
 #else
 - (void)setBaseWritingDirection:(UITextWritingDirection)writingDirection forRange:(YYTextRange *)range {
     if (!range) return;