#import <UIKit/UIKit.h>
@interface UILabel (Attribute)
@property (nonatomic, copy) NSString *newText;
@property (nonatomic, strong) UIFont *newFont;
@end
#import "UILabel+Attribute.h"
#import "objc/Runtime.h"
@implementation UILabel (Attribute)
static NSString * newFontKey = @"newFontKey";
static NSString * newTextKey = @"newTextKey";
#pragma mark - 使用runtime增加newFont属性
-
iOS:使用runtime给Label增加属性
最新推荐文章于 2022-09-06 20:17:07 发布