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', '!!!'])
Foundation Web Standards
Jonathan Lane、Steve Smith / Friends of ED / 21st July 2008 / $34.99
Foundation Web Standards explores the process of constructing a web site from start to finish. There is more to the process than just knowing HTML! Designers and developers must follow a proper proces......一起来看看 《Foundation Web Standards》 这本书的介绍吧!
