0
点赞
收藏
分享

微信扫一扫

iOS Property getter

一ke大白菜 2023-05-23 阅读 43


@property (nonatomic, assign, getter=isPlaying)BOOL playing;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    _playView = [PlayView new];
    _playView.frame = CGRectMake(30, 40, 40, 40);
    _playView.backgroundColor = [UIColor redColor];
    [self.view addSubview:_playView];
    
//    UILabel *label = [UILabel new];
//    label.attributedText
//    label.attributedText
    
//    _playView pl
    
//    self.isPlaying = YES;
    
    self.playing = YES;
    
    
//    BOOL on = self.playing; //都可以使用
    
    BOOL on = self.isPlaying; <span style="font-family: Arial, Helvetica, sans-serif;">//都可以使用</span>
    
    NSLog(@"the on is %@", on ? @"YES" : @"ON");
    
    
}




举报

相关推荐

【IOS】oc中property属性值详解

0 条评论