mirror of
https://github.com/samsonjs/samhuri.net-ios.git
synced 2026-03-25 09:25:47 +00:00
make HUDs block the UI
This commit is contained in:
parent
04a763cd6e
commit
781903775b
2 changed files with 4 additions and 3 deletions
|
|
@ -393,7 +393,8 @@ static NSString *const StateRestorationModifiedPostKey = @"modifiedPost";
|
|||
}
|
||||
|
||||
- (IBAction)publishOrUnpublish:(id)sender {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES];
|
||||
hud.dimBackground = YES;
|
||||
BOOL isPublish = self.modifiedPost.draft;
|
||||
hud.labelText = isPublish ? @"Publishing" : @"Unpublishing";
|
||||
__weak typeof(self) welf = self;
|
||||
|
|
|
|||
|
|
@ -305,10 +305,10 @@ static const NSUInteger SectionPublished = 1;
|
|||
}
|
||||
|
||||
- (IBAction)publish:(id)sender {
|
||||
// TODO: activity indicator
|
||||
__weak typeof(self) welf = self;
|
||||
void (^publish)(NSString *, PMKPromise *) = ^(NSString *message, PMKPromise *promise) {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES];
|
||||
hud.dimBackground = YES;
|
||||
hud.labelText = message;
|
||||
typeof(self) self = welf;
|
||||
promise.then(^{
|
||||
|
|
|
|||
Loading…
Reference in a new issue