Latest 0.3.0
Homepage https://github.com/xuliang2015/XToast
License MIT
Platforms ios 8.0
Authors

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的遮罩层,显示期间不响应用户交互事件。
  • 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.0'

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

Leo, [email protected]

License

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

Latest podspec

{
    "name": "XToast",
    "version": "0.3.0",
    "summary": "A short description of XToast.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/xuliang2015/XToast",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "xuliang2015": "[email protected]"
    },
    "source": {
        "git": "https://github.com/xuliang2015/XToast.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "XToast/Classes/**/*"
}

Pin It on Pinterest

Share This