Kaynağa Gözat

swift api compatibility

ibireme 9 yıl önce
ebeveyn
işleme
ba724ff855

+ 3 - 1
YYText/Component/YYTextLayout.h

@@ -545,7 +545,9 @@ extern const CGSize YYTextContainerMaxSize;
  @param size    The context size.
  @param debug   The debug option. Pass nil to avoid debug drawing.
  */
-- (void)drawInContext:(nullable CGContextRef)context size:(CGSize)size debug:(nullable YYTextDebugOption *)debug;
+- (void)drawInContext:(nullable CGContextRef)context
+                 size:(CGSize)size
+                debug:(nullable YYTextDebugOption *)debug;
 
 /**
  Show view and layer attachments.

+ 0 - 1
YYText/Component/YYTextMagnifier.h

@@ -47,7 +47,6 @@ typedef NS_ENUM(NSInteger, YYTextMagnifierType) {
 @property (nonatomic) BOOL hostVerticalForm;              ///< The host view is vertical form.
 @property (nonatomic) BOOL captureDisabled;               ///< A hint for `YYTextEffectWindow` to disable capture.
 @property (nonatomic) BOOL captureFadeAnimation;          ///< Show fade animation when the snapshot image changed.
-
 @end
 
 NS_ASSUME_NONNULL_END

+ 4 - 4
YYText/String/YYTextAttribute.h

@@ -158,8 +158,8 @@ UIKIT_EXTERN NSString *const YYTextTruncationToken; ///< Horizontal ellipsis (U+
  
  @param containerView The text container view (such as YYLabel/YYTextView).
  @param text          The whole text.
- @param range         The text range in `text`.
- @param rect          The text frame in `containerView`.
+ @param range         The text range in `text` (if no range, the range.location is NSNotFound).
+ @param rect          The text frame in `containerView` (if no data, the rect is CGRectNull).
  */
 typedef void(^YYTextAction)(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect);
 
@@ -332,13 +332,13 @@ typedef void(^YYTextAction)(UIView *containerView, NSAttributedString *text, NSR
 
 /**
  Tap action when user tap the highlight, default is nil.
- If the value is nil, YYTextView or YYLabel will ask it's delegate to deal with tap action.
+ If the value is nil, YYTextView or YYLabel will ask it's delegate to handle the tap action.
  */
 @property (nullable, nonatomic, copy) YYTextAction tapAction;
 
 /**
  Long press action when user long press the highlight, default is nil.
- If the value is nil, YYTextView or YYLabel will ask it's delegate to deal with long press action.
+ If the value is nil, YYTextView or YYLabel will ask it's delegate to handle the long press action.
  */
 @property (nullable, nonatomic, copy) YYTextAction longPressAction;
 

+ 2 - 2
YYText/Utility/YYTextUtilities.h

@@ -57,7 +57,7 @@ static inline BOOL YYTextIsLinebreakChar(unichar c) {
  @param str A string
  @return YES or NO.
  */
-static inline BOOL YYTextIsLinebreakString( NSString * _Nullable str) {
+static inline BOOL YYTextIsLinebreakString(NSString * _Nullable str) {
     if (str.length > 2 || str.length == 0) return NO;
     if (str.length == 1) {
         unichar c = [str characterAtIndex:0];
@@ -520,7 +520,7 @@ static inline UIEdgeInsets YYTextUIEdgeInsetPixelCeil(UIEdgeInsets insets) {
 
 
 
-static inline  UIFont * _Nullable YYTextFontWithBold(UIFont *font) {
+static inline UIFont * _Nullable YYTextFontWithBold(UIFont *font) {
     if (![font respondsToSelector:@selector(fontDescriptor)]) return font;
     return [UIFont fontWithDescriptor:[font.fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold] size:font.pointSize];
 }