Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should look at <a href="https://github.com/matej/MBProgressHUD" rel="nofollow"><code>MBProgressHUD</code></a>. My solution to this exact problem using <code>MBProgressHUD</code>.</p> <pre><code>+ (void)showMessage:(NSString *)message forDuration:(NSTimeInterval)duration withTitle:(NSString *)title { UIWindow *window = [UIApplication sharedApplication].keyWindow; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:window animated:YES]; hud.mode = MBProgressHUDModeText; hud.labelText = title; hud.detailsLabelText = message; hud.removeFromSuperViewOnHide = YES; [hud hide:YES afterDelay:duration]; } </code></pre> <p>After some user testing, it was decided that users didn't like a long duration message which they couldn't dismiss.</p> <pre><code>+ (void)showMessage:(NSString *)message forDuration:(NSTimeInterval)duration withTitle:(NSString *)title { if (duration &lt; 3.0) { UIWindow *window = [UIApplication sharedApplication].keyWindow; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:window animated:YES]; hud.mode = MBProgressHUDModeText; hud.labelText = title; hud.detailsLabelText = message; hud.removeFromSuperViewOnHide = YES; [hud hide:YES afterDelay:duration]; } else { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; int64_t delayInSeconds = duration; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ [alertView dismissWithClickedButtonIndex:alertView.cancelButtonIndex animated:YES]; }); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload