美文网首页
setNeedsLayout

setNeedsLayout

作者: Silence_xl | 来源:发表于2020-09-03 23:46 被阅读0次
// 是一个sel,可以看作是sourece0,执行完这个资源才会往下执行下一个
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    NSLog(@"before==%d", _testview.count);
    _testview.count = 33;
    [_testview setNeedsLayout]; // setNeedDisplay //layoutSubviews runloop
    NSLog(@"1==%d", _testview.count);
    
    while (1) {
        static int count = 0;
        count++;
        if (count > 5) {
            break;
        }
        sleep(1);
    }
    NSLog(@"2==%d", _testview.count);
    
}

相关文章

网友评论

      本文标题:setNeedsLayout

      本文链接:https://www.haomeiwen.com/subject/goyasktx.html