From 058e762d0b36ced8cf6d235187fdaeb930025a6e Mon Sep 17 00:00:00 2001 From: "yin.yan" Date: Wed, 8 Jan 2020 14:41:28 +0900 Subject: [PATCH] Fix yy_setBaselineOffset not work issue. Ref: https://github.com/ibireme/YYText/pull/914 --- YYText/Utility/NSAttributedString+YYText.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/YYText/Utility/NSAttributedString+YYText.m b/YYText/Utility/NSAttributedString+YYText.m index 63f95799..0c702bbd 100755 --- a/YYText/Utility/NSAttributedString+YYText.m +++ b/YYText/Utility/NSAttributedString+YYText.m @@ -1056,7 +1056,11 @@ - (void)yy_setExpansion:(NSNumber *)expansion range:(NSRange)range { - (void)yy_setBaselineOffset:(NSNumber *)baselineOffset range:(NSRange)range { if (kSystemVersion >= 7) { +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0 + [self yy_setAttribute:(NSString *)kCTBaselineOffsetAttributeName value:baselineOffset range:range]; +#else [self yy_setAttribute:NSBaselineOffsetAttributeName value:baselineOffset range:range]; +#endif } }