好奇心のために、次のコードを書き直そうとしています
// show HUD (with animation)
[SVProgressHUD showWithStatus:@"loading..."];
// wait for HUD to safely finish showing its animation
// (loading HUD will be visible for 1 sec)
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]]
// dismiss HUD
// (dismiss HUD will be visible for 2 sec)
[SVProgressHUD dismissWithSuccess:@"finished!" afterDelay:2];
Grand Central Dispatch を使用してコードに挿入します。
私はdispatch_source_t、dispatch_semaphore_t、およびdispatch_afterを使用してみましたが、うまく機能しません:(そして私はあなたの助けが必要です!
SVProgressHUD のメソッドをブロックでラップしたくないことに注意してください。