Giter VIP home page Giter VIP logo

xhtoastswift's Introduction

XHToastSwift

简洁轻便提示工具,一行代码,既可完成提示信息显示.

####OC版本请戳此处>>>

技术交流群(群号:537476189)

效果

image

使用方法

1.普通调用

    /*
    您只需要调用一行代码,既可完成提示信息显示
    */
 
    /*
    中间显示
    */
    XHToast.showCenterWithText("您要显示的提示信息")

    /*
    上方显示
    */
    XHToast.showTopWithText("您要显示的提示信息")

    /*
    下方显示
    */
    XHToast.showBottomWithText("您要显示的提示信息")

2.自定义Toast停留时间+到屏幕上端/下端距离(见如下方法)

    // MARK:-中间显示

    /**
     中间显示+自定义时间
     
     - parameter text:     文字
     - parameter duration: 自定义停留时间
     */
    public class func showCenterWithText(text:String, duration:CGFloat)

    // MARK:-上方显示

    /**
     上方显示+自定义停留时间
     
     - parameter text:     文字
     - parameter duration: 自定义停留时间
     */
    public class func showTopWithText(text:String, duration:CGFloat)

    /**
     上方显示+自定义到顶部距离
     
     - parameter text:      文字
     - parameter topOffset: 自定义到顶部距离
     */
    public class func showTopWithText(text:String,topOffset:CGFloat)

    /**
     上方显示+自定义到顶部距离+自定义停留时间
     
     - parameter text:      文字
     - parameter topOffset: 自定义到顶部距离
     - parameter duration:  自定义停留时间
     */
    public class func showTopWithText(text:String, topOffset:CGFloat,duration:CGFloat)

    // MARK:-下方显示

    /**
     下方显示+自定义停留时间
     
     - parameter text:     文字
     - parameter duration: 自定义停留时间
     */
    public class func showBottomWithText(text:String,duration:CGFloat)

    /**
     下方显示+自定义到底部距离
     
     - parameter text:         文字
     - parameter bottomOffset: 自定义到底部距离
     */
    public class func showBottomWithText(text:String,bottomOffset:CGFloat)

    /**
     下方显示+自定义到底部距离+自定义停留时间
     
     - parameter text:         文字
     - parameter bottomOffset: 自定义到底部距离
     - parameter duration:     自定义停留时间
     */
    public class func showBottomWithText(text:String,bottomOffset:CGFloat,duration:CGFloat)

安装

1.手动添加:

  • 1.将 XHToastSwift文件夹添加到工程目录中即可

2.CocoaPods:

  • 1.在 Podfile 中添加 pod 'XHToastSwift'
  • 2.执行 pod install 或 pod update
  • 3.导入 import XHToastSwift

3.Tips

  • 如果你发现你执行pod install后,导入的不是最新的,请删除Podfile.lock文件,在执行一次 pod install

系统要求

  • 该项目最低支持 iOS 8.0 和 Xcode 7.3

许可证

XHToast 使用 MIT 许可证,详情见 LICENSE 文件

xhtoastswift's People

Contributors

coderzhuxh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.