diff --git a/Blog/EditorViewController.m b/Blog/EditorViewController.m index da7836b..6198eba 100644 --- a/Blog/EditorViewController.m +++ b/Blog/EditorViewController.m @@ -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; diff --git a/Blog/PostsViewController.m b/Blog/PostsViewController.m index 846356f..2bda2a5 100644 --- a/Blog/PostsViewController.m +++ b/Blog/PostsViewController.m @@ -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(^{