Keeping a UIButton selected after a touch

后端 未结 9 1436
后悔当初
后悔当初 2020-11-27 11:41

After my user clicks a button, I\'d like that button to stay pushed during the time that I perform a network operation. When the network operation is complete, I want the bu

9条回答
  •  眼角桃花
    2020-11-27 12:21

    Try using NSOperationQueue to achieve this. Try out code as follows:

    [[NSOperationQueue mainQueue] addOperationWithBlock:^{
        theButton.highlighted = YES;
    }];
    

    Hope this helps.

提交回复
热议问题