Skip to content

7.7.0

Compare
Choose a tag to compare
@srdanrasic srdanrasic released this 20 Apr 18:22
· 10 commits to master since this release

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")
}