XToast 0.3.2

XToast 0.3.2

Maintained by Leo.



XToast 0.3.2

  • By
  • papfish

XToast

CI Status Version License Platform

Description

XToast是基于 https://github.com/scalessec/Toast 的4.0.0版本调整及封装。

根据项目实际的需求,封装了以下功能:

功能

  • 支持显示在View或者Window上,使用默认的配置信息。
  • 添加超时自动消失的Loading View,支持添加小段文字。
  • 添加Loading View的遮罩层,并阻止页面的用户交互。
  • ToastLoading方法都在主线程执行,避免UI线程问题。

Toast库的调整

  • Toast添加makeToastActivity: withText:方法,给Activity添加小段文字。
  • Toast添加Activity的遮罩层,可设置setCoverEnabled是否阻止用户交互事件。
  • Toast添加类名及方法名前缀,避免重名问题。

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

XToast is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'XToast', '~> 0.3.1'

Usage

Step 1:

#import <XToast/XToast.h>

Step 2:

// Show in the window
+ (void)showToastWithText:(NSString *)text;

+ (void)hideToast;

+ (void)showLoading;

+ (void)showLoadingAndHideAfter:(NSTimeInterval)interval;

+ (void)showLoadingWithText:(NSString *)text;

+ (void)showLoadingWithText:(NSString *)text hideAfter:(NSTimeInterval)interval;

+ (void)hideLoading;

// Show in the view
+ (void)showToastWithText:(NSString *)text inView:(UIView *)view;

+ (void)hideToastInView:(UIView *)view;

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

+ (void)showLoadingInView:(UIView *)view hideAfter:(NSTimeInterval)interval;

+ (void)showLoadingWithText:(NSString *)text inView:(UIView *)view;

+ (void)showLoadingWithText:(NSString *)text inView:(UIView *)view hideAfter:(NSTimeInterval)interval;

+ (void)hideLoadingInView:(UIView *)view;

// You can set the "XCSToastManager" to customize it if you needed, use by #import <XToast/UIView+XToast.h>

Author

[email protected]

License

XToast is available under the MIT license. See the LICENSE file for more info.