I wrote a function that displays a toast on UIVIewController. Toast function below
-(void)showToast:(NSString*)string
{
MBProgressHUD *hud;
hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeText;
hud.labelText = string;
hud.margin = 10.f;
hud.yOffset = 150.f;
hud.removeFromSuperViewOnHide = YES;
hud.userInteractionEnabled = NO;
[hud hide:YES afterDelay:2];
}
Now the problem is that my toast message is hiding behind the keyboard. Can someone tell me how to show a toast above the height of the keyboard?
source
share