setNeedsLayout

2020-09-03  本文已影响0人  Silence_xl
// 是一个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);
    
}
上一篇下一篇

猜你喜欢

热点阅读