美文网首页小斑swift开发技巧iOS-swift
2017-4-10 iOS Swift3全能的消息提示库

2017-4-10 iOS Swift3全能的消息提示库

作者: 工匠良辰 | 来源:发表于2017-04-10 19:56 被阅读203次

    Toast-Swift
    https://github.com/scalessec/Toast-Swift

    Basic Examples

    // basic usage
    self.view.makeToast("This is a piece of toast")
    
    // toast with a specific duration and position
    self.view.makeToast("This is a piece of toast", duration: 3.0, position: .top)
    
    // toast with all possible options
    self.view.makeToast("This is a piece of toast", duration: 2.0, position: CGPoint(x: 110.0, y: 110.0), title: "Toast Title", image: UIImage(named: "toast.png"), style:nil) { (didTap: Bool) -> Void in
        if didTap {
            print("completion from tap")
        } else {
            print("completion without tap")
        }
    }
    
    // display toast with an activity spinner
    self.view.makeToastActivity(.center)
    
    // display any view as toast
    self.view.showToast(myView)
    

    Toast-Swift ScreenshotsToast-Swift Screenshots

    相关文章

      网友评论

        本文标题:2017-4-10 iOS Swift3全能的消息提示库

        本文链接:https://www.haomeiwen.com/subject/oyreattx.html