这个弹窗swift4之后会报错,自己根据提示修改才能引用成功
最简单使用
Toast.init(text: "hhdsd").show()
Toast.init(text: "测试数据", delay: 1, duration: 2).show()
自己控制消失
// let toast = Toast.init(text: "测试s数据")
// toast.show()
// toast.cancel()
//通过患者管理中心获得当前窗口然后调用窗口的取消方法,关闭窗口
// if let currentToast = ToastCenter.default.currentToast {
// currentToast.cancel()
// }
//关闭所有窗口
// ToastCenter.default.cancelAll()
//设置窗口背景为橙色
ToastView.appearance().backgroundColor = UIColor.red
//设置文字颜色
ToastView.appearance().textColor = UIColor.blue
//设置字体及字号
ToastView.appearance().font = UIFont.init(name: "Arial", size: 12)
//设置文字距离边框距离
ToastView.appearance().textInsets = UIEdgeInsets.init(top: 16, left: 20, bottom: 16, right: 20)
//设置边框圆角弧度
ToastView.appearance().cornerRadius = 0