SwiftEvent
- 授权协议: 未知
- 开发语言: Swift
- 操作系统: iOS
- 软件首页: https://github.com/SwiftBLE/SwiftEvent
- 官方下载: https://github.com/SwiftBLE/SwiftEvent
软件介绍
SwiftEvent 是 iOS 上 Swift 简单的事件机制。
没有参数的事件示例:
var event = Event()
event.on() {
print("regular listener")
}
event.once() {
print("one time listener")
}
event.emit()
event.emit()
一个参数:
var counter = 0var event = EventWith<Int>()
event.on() {
counter += $0}
event.once() {
counter += $0}
event.emitWith(1)
两个参数
var counter = 0var string = ''var event = EventDue<Int, String>()
event.on() { (value, word) in
counter += value
string += word
}
event.emitWith(1, and: 'Hello ')
event.emitWith(1, and: 'World')
多个参数
var text = ''var event = EventWith<[String]>()
event.on() { (words) in
text += " ".join(words)
}
event.emitWith(['Hello', 'World', '!!!'])
The Four
Scott Galloway / Portfolio / 2017-10-3 / USD 28.00
NEW YORK TIMES BESTSELLER USA TODAY BESTSELLER Amazon, Apple, Facebook, and Google are the four most influential companies on the planet. Just about everyone thinks they know how they got there.......一起来看看 《The Four》 这本书的介绍吧!
URL 编码/解码
URL 编码/解码
HEX HSV 转换工具
HEX HSV 互换工具
