QMUITips

@interface QMUITips

简单封装了 QMUIToastView,支持弹出纯文本、loading、succeed、error、info 等五种 tips。如果这些接口还满足不了业务的需求,可以通过 QMUITips 的分类自行添加接口。 注意用类方法显示 tips 的话,会导致父类的 willShowBlock 无法正常工作,具体请查看 willShowBlock 的注释。

Warning

使用类方法,除了 showLoading 系列方法不会自动隐藏外,其他方法如果没有 delay 参数,则会自动隐藏

See

[QMUIToastView willShowBlock]
  • 实例方法:需要自己addSubview,hide之后不会自动removeFromSuperView

    Declaration

    Objective-C

    - (void)showLoading;

    Swift

    func showLoading()
  • Undocumented

    Declaration

    Objective-C

    - (void)showLoading:(nullable NSString *)text;

    Swift

    func showLoading(_ text: String?)
  • Undocumented

    Declaration

    Objective-C

    - (void)showLoadingHideAfterDelay:(NSTimeInterval)delay;

    Swift

    func showLoadingHide(afterDelay delay: TimeInterval)
  • Undocumented

    Declaration

    Objective-C

    - (void)showLoading:(nullable NSString *)text hideAfterDelay:(NSTimeInterval)delay;

    Swift

    func showLoading(_ text: String?, hideAfterDelay delay: TimeInterval)
  • Undocumented

    Declaration

    Objective-C

    - (void)showLoading:(nullable NSString *)text detailText:(nullable NSString *)detailText;

    Swift

    func showLoading(_ text: String?, detailText: String?)
  • Undocumented

    Declaration

    Objective-C

    - (void)showLoading:(nullable NSString *)text detailText:(nullable NSString *)detailText hideAfterDelay:(NSTimeInterval)delay;

    Swift

    func showLoading(_ text: String?, detailText: String?, hideAfterDelay delay: TimeInterval)
  • Undocumented

    Declaration

    Objective-C

    - (void)showWithText:(nullable NSString *)text;

    Swift

    func show(withText text: String?)
  • Undocumented

    Declaration

    Objective-C

    - (void)showWithText:(nullable NSString *)text hideAfterDelay:(NSTimeInterval)delay;

    Swift

    func show(withText text: String?, hideAfterDelay delay: TimeInterval)
  • Undocumented

    Declaration

    Objective-C

    - (void)showWithText:(nullable NSString *)text detailText:(nullable NSString *)detailText;

    Swift

    func show(withText text: String?, detailText: String?)
  • Undocumented

    Declaration

    Objective-C

    - (void)showWithText:(nullable NSString *)text detailText:(nullable NSString *)detailText hideAfterDelay:(NSTimeInterval)delay;

    Swift

    func show(withText text: String?, detailText: String?, hideAfterDelay delay: TimeInterval)
  • Undocumented

    Declaration

    Objective-C

    - (void)showSucceed:(nullable NSString *)text;

    Swift

    func showSucceed(_ text: String?)
  • Undocumented

    Declaration

    Objective-C

    - (void)showSucceed:(nullable NSString *)text hideAfterDelay:(NSTimeInterval)delay;

    Swift

    func showSucceed(_ text: String?, hideAfterDelay delay: TimeInterval)
  • Undocumented

    Declaration

    Objective-C

    - (void)showSucceed:(nullable NSString *)text detailText:(nullable NSString *)detailText;

    Swift

    func showSucceed(_ text: String?, detailText: String?)
  • Undocumented

    Declaration

    Objective-C

    - (void)showSucceed:(nullable NSString *)text detailText:(nullable NSString *)detailText hideAfterDelay:(NSTimeInterval)delay;

    Swift

    func showSucceed(_ text: String?, detailText: String?, hideAfterDelay delay: TimeInterval)
  • Undocumented

    Declaration

    Objective-C

    - (void)showError:(nullable NSString *)text;

    Swift

    func showError(_ text: String?)
  • Undocumented

    Declaration

    Objective-C

    - (void)showError:(nullable NSString *)text hideAfterDelay:(NSTimeInterval)delay;

    Swift

    func showError(_ text: String?, hideAfterDelay delay: TimeInterval)
  • Undocumented

    Declaration

    Objective-C

    - (void)showError:(nullable NSString *)text detailText:(nullable NSString *)detailText;

    Swift

    func showError(_ text: String?, detailText: String?)
  • Undocumented

    Declaration

    Objective-C

    - (void)showError:(nullable NSString *)text detailText:(nullable NSString *)detailText hideAfterDelay:(NSTimeInterval)delay;

    Swift

    func showError(_ text: String?, detailText: String?, hideAfterDelay delay: TimeInterval)
  • Undocumented

    Declaration

    Objective-C

    - (void)showInfo:(nullable NSString *)text;

    Swift

    func showInfo(_ text: String?)
  • Undocumented

    Declaration

    Objective-C

    - (void)showInfo:(nullable NSString *)text hideAfterDelay:(NSTimeInterval)delay;

    Swift

    func showInfo(_ text: String?, hideAfterDelay delay: TimeInterval)
  • Undocumented

    Declaration

    Objective-C

    - (void)showInfo:(nullable NSString *)text detailText:(nullable NSString *)detailText;

    Swift

    func showInfo(_ text: String?, detailText: String?)
  • Undocumented

    Declaration

    Objective-C

    - (void)showInfo:(nullable NSString *)text detailText:(nullable NSString *)detailText hideAfterDelay:(NSTimeInterval)delay;

    Swift

    func showInfo(_ text: String?, detailText: String?, hideAfterDelay delay: TimeInterval)
  • 类方法:主要用在局部一次性使用的场景,hide之后会自动removeFromSuperView

    Declaration

    Objective-C

    + (nonnull QMUITips *)createTipsToView:(nonnull UIView *)view;

    Swift

    class func createTips(to view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showLoadingInView:(UIView *)view;

    Swift

    class func showLoading(in view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showLoading:(nullable NSString *)text inView:(UIView *)view;

    Swift

    class func showLoading(_ text: String?, in view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showLoadingInView:(UIView *)view hideAfterDelay:(NSTimeInterval)delay;

    Swift

    class func showLoading(in view: UIView, hideAfterDelay delay: TimeInterval) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showLoading:(nullable NSString *)text inView:(UIView *)view hideAfterDelay:(NSTimeInterval)delay;

    Swift

    class func showLoading(_ text: String?, in view: UIView, hideAfterDelay delay: TimeInterval) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showLoading:(nullable NSString *)text detailText:(nullable NSString *)detailText inView:(UIView *)view;

    Swift

    class func showLoading(_ text: String?, detailText: String?, in view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showLoading:(nullable NSString *)text detailText:(nullable NSString *)detailText inView:(UIView *)view hideAfterDelay:(NSTimeInterval)delay;

    Swift

    class func showLoading(_ text: String?, detailText: String?, in view: UIView, hideAfterDelay delay: TimeInterval) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showWithText:(nullable NSString *)text;

    Swift

    class func show(withText text: String?) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showWithText:(nullable NSString *)text detailText:(nullable NSString *)detailText;

    Swift

    class func show(withText text: String?, detailText: String?) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showWithText:(nullable NSString *)text inView:(UIView *)view;

    Swift

    class func show(withText text: String?, in view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showWithText:(nullable NSString *)text inView:(UIView *)view hideAfterDelay:(NSTimeInterval)delay;

    Swift

    class func show(withText text: String?, in view: UIView, hideAfterDelay delay: TimeInterval) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showWithText:(nullable NSString *)text detailText:(nullable NSString *)detailText inView:(UIView *)view;

    Swift

    class func show(withText text: String?, detailText: String?, in view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showWithText:(nullable NSString *)text detailText:(nullable NSString *)detailText inView:(UIView *)view hideAfterDelay:(NSTimeInterval)delay;

    Swift

    class func show(withText text: String?, detailText: String?, in view: UIView, hideAfterDelay delay: TimeInterval) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showSucceed:(nullable NSString *)text;

    Swift

    class func showSucceed(_ text: String?) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showSucceed:(nullable NSString *)text detailText:(nullable NSString *)detailText;

    Swift

    class func showSucceed(_ text: String?, detailText: String?) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showSucceed:(nullable NSString *)text inView:(UIView *)view;

    Swift

    class func showSucceed(_ text: String?, in view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showSucceed:(nullable NSString *)text inView:(UIView *)view hideAfterDelay:(NSTimeInterval)delay;

    Swift

    class func showSucceed(_ text: String?, in view: UIView, hideAfterDelay delay: TimeInterval) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showSucceed:(nullable NSString *)text detailText:(nullable NSString *)detailText inView:(UIView *)view;

    Swift

    class func showSucceed(_ text: String?, detailText: String?, in view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showSucceed:(nullable NSString *)text detailText:(nullable NSString *)detailText inView:(UIView *)view hideAfterDelay:(NSTimeInterval)delay;

    Swift

    class func showSucceed(_ text: String?, detailText: String?, in view: UIView, hideAfterDelay delay: TimeInterval) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showError:(nullable NSString *)text;

    Swift

    class func showError(_ text: String?) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showError:(nullable NSString *)text detailText:(nullable NSString *)detailText;

    Swift

    class func showError(_ text: String?, detailText: String?) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showError:(nullable NSString *)text inView:(UIView *)view;

    Swift

    class func showError(_ text: String?, in view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showError:(nullable NSString *)text inView:(UIView *)view hideAfterDelay:(NSTimeInterval)delay;

    Swift

    class func showError(_ text: String?, in view: UIView, hideAfterDelay delay: TimeInterval) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showError:(nullable NSString *)text detailText:(nullable NSString *)detailText inView:(UIView *)view;

    Swift

    class func showError(_ text: String?, detailText: String?, in view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showError:(nullable NSString *)text detailText:(nullable NSString *)detailText inView:(UIView *)view hideAfterDelay:(NSTimeInterval)delay;

    Swift

    class func showError(_ text: String?, detailText: String?, in view: UIView, hideAfterDelay delay: TimeInterval) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showInfo:(nullable NSString *)text;

    Swift

    class func showInfo(_ text: String?) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showInfo:(nullable NSString *)text detailText:(nullable NSString *)detailText;

    Swift

    class func showInfo(_ text: String?, detailText: String?) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showInfo:(nullable NSString *)text inView:(UIView *)view;

    Swift

    class func showInfo(_ text: String?, in view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showInfo:(nullable NSString *)text inView:(UIView *)view hideAfterDelay:(NSTimeInterval)delay;

    Swift

    class func showInfo(_ text: String?, in view: UIView, hideAfterDelay delay: TimeInterval) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showInfo:(nullable NSString *)text detailText:(nullable NSString *)detailText inView:(UIView *)view;

    Swift

    class func showInfo(_ text: String?, detailText: String?, in view: UIView) -> QMUITips
  • Undocumented

    Declaration

    Objective-C

    + (QMUITips *)showInfo:(nullable NSString *)text detailText:(nullable NSString *)detailText inView:(UIView *)view hideAfterDelay:(NSTimeInterval)delay;

    Swift

    class func showInfo(_ text: String?, detailText: String?, in view: UIView, hideAfterDelay delay: TimeInterval) -> QMUITips
  • 隐藏 tips

    Declaration

    Objective-C

    + (void)hideAllTipsInView:(nonnull UIView *)view;

    Swift

    class func hideAllTips(in view: UIView)
  • Undocumented

    Declaration

    Objective-C

    + (void)hideAllTips;

    Swift

    class func hideAllTips()
  • 自动隐藏 toast 可以使用这个方法自动计算秒数

    Declaration

    Objective-C

    + (NSTimeInterval)smartDelaySecondsForTipsText:(nonnull NSString *)text;

    Swift

    class func smartDelaySeconds(forTipsText text: String) -> TimeInterval