1 つの UIVewcontroller があると仮定し、それを A と呼び、その VC の viewdidload に 2 つの UIViewcontrollers( B,C ) を追加します。A の Viewdidload で UI をスムーズにするために、いくつかの GCD 作業を行います。
dispatch_queue_t queue = dispatch_queue_create("CustomQueue", NULL);
dispatch_async(queue, ^{
// Create views, do some setup here, etc etc
// Perform on main thread/queue
dispatch_async(dispatch_get_main_queue(), ^{
// this always has to happen on the main thread
[self.view addSubview:myview1];
[self.view addSubview:myview2];
[self.view addSubview:myview3];
});
});
このコードに基づいて、ビューが同じ順序で追加されることが保証されますか? ビュー 1 、次に 2 、次に 3?
一部のビューが他のビューよりも前に勝手に表示されることに気付きました !!