我试图让CocoaAction调用Action。触发CocoaAction但从未执行Action。任何人都可以看到我在哪里出错吗?
let a = Action<Bool, Void, NoError> { val in
return SignalProducer { sink, _ in
print("I has a value: \(val)")
sink.sendCompleted()
}
}
self.cocoaAction = CocoaAction(a) { _ in
return true
}
self.myButton.addTarget(self.cocoaAction, action: CocoaAction.selector, forControlEvents: .TouchUpInside)
答案 0 :(得分:0)
当从Swift 2.1移动到Swift 2.2时,Reactive Cocoa中出现了一些问题。更新到最新提交,现在它就像一个魅力。