0

Reactivekit 中是否有等效的 rac_liftSelector 来实现 setTitle 的选择器?

4

1 回答 1

0

通过创建 ReactiveExtension 解决了它。

extension ReactiveExtensions where Base: UIButton {
        var Title: Bond<String?> {
            return bond { button, text in
                let attributedString = NSAttributedString(string: text!)
                button.setAttributedTitle(attributedString, for: UIControlState.normal)
            }
        }
    }
于 2017-04-04T12:33:02.073 回答