Closed fulldecent closed 8 years ago
Related to #329
Here is the code I use to flash an NSError to the screen. Perhaps this may be added as a class function.
extension MBProgressHUD { func flashError(error: NSError) { let window = UIApplication.sharedApplication().keyWindow MBProgressHUD.hideAllHUDsForView(window, animated: false) let hud = MBProgressHUD(forView: window) hud.mode = .CustomView hud.removeFromSuperViewOnHide = true let view: UITextView = UITextView(frame: CGRectMake(0, 0, 200, 200)) view.text = error.localizedDescription view.font = hud.labelFont view.textColor = UIColor.whiteColor() view.backgroundColor = UIColor.clearColor() view.sizeToFit() hud.customView = view hud.show(true) hud.hide(true, afterDelay: 1.2) } }
Related to #329
Here is the code I use to flash an NSError to the screen. Perhaps this may be added as a class function.