Git Hub
коротко

RxSwift

1 июня 2017, 0:04

RxGesture

labelView.rx
            .anyGesture(.longPress())
            .when(.began)
            .subscribe(onNext: {_ in
            //react to long Press
                UIView.animate(withDuration: 1, animations: {
                    self.labelView.bounds.size.width = 200
                }, completion: { ok in
                    self.labelView.bounds.size = self.sizeOfButton
                })
                print("long press")
        }).addDisposableTo(disposeBag)

UISwitch

var uiDone = UISwitch()

        uiDone.rx.isOn
            .subscribe(onNext: { isOn in
                print( isOn ? "it's ON" : "it's OFF" )
                
                try! self.uiRealm.write { ()->Void in
                    self.taskModel.isCompleted = isOn
                }
                
            }).addDisposableTo(disposeBag)
Поделиться
Популярное