ReactKitSwift 的响应式编程
ReactKit 是 Swift 的响应式编程。
示例代码:
// create signal via KVO self.obj1Signal = KVO.signal(obj1, "value") // bind signal via KVC (<~ as binding operator) (obj2, "value") <~ self.obj1Signal XCTAssertEqual(obj1.value, "initial") XCTAssertEqual(obj2.value, "initial") obj1.value = "REACT" XCTAssertEqual(obj1.value, "REACT") XCTAssertEqual(obj2.value, "REACT")
评论