7.7.0
Thanks to @ibrahimkteish's awesome contribution, Bond 7.7 introduces the ability to observe view controller lifecycle events! π π
Example usage:
let viewController = UIViewController()
viewController.reactive.lifecycleEvents.observeNext { (event) in
print(event)
}
viewController.reactive.lifecycleEvent(.viewDidLoad).observeNext {
print("view did load")
}
viewController.reactive.lifecycleEvent(.viewWillAppear).observeNext {
print("view will appear")
}
viewController.reactive.lifecycleEvent(.viewDidAppear).observeNext {
print("view did appear")
}
viewController.reactive.lifecycleEvent(.viewWillDisappear).observeNext {
print("view will disappear")
}
viewController.reactive.lifecycleEvent(.viewDidDisappear).observeNext {
print("view did disappear")
}