基本的な考え方は、インターネット データを受信しているときにユーザーの操作をブロックする必要があることです。すべてのデータを取得したら、ユーザー インタラクションのブロックを解除する必要があります。ユーザー インタラクションのブロックを解除した後、私の UIToolBar アイテムには何のタッチもありませんでした。
この動作を示す簡単なコードを作成しました。
まず、UISplitViewController を作成しました。DetailsViewController に、UIToolBar を 1 つの項目で追加しました。
詳細ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
__block UIView *myView = self.view;
dispatch_async(dispatch_get_main_queue(), ^{
[AppDelegate setInteraction:NO onView:myView];
[AppDelegate setInteraction:YES onView:myView];
});
}
AppDelegate
+ (void)setInteraction:(BOOL)allow onView:(UIView *)aView {
dispatch_async(dispatch_get_main_queue(), ^{
[aView setUserInteractionEnabled:allow];
for (UIView * v in [aView subviews]) {
[self setInteraction:allow onView:v];
}
});
}
ユーザー インタラクションのブロックを解除した後、私の UIToolBar アイテムには何のタッチもありませんでした。