will show and will hide
This commit is contained in:
parent
157c5c574b
commit
926ee41277
@ -385,6 +385,14 @@ import UIKit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open override func viewWillAppear(_ animated: Bool) {
|
||||||
|
super.viewWillAppear(animated)
|
||||||
|
|
||||||
|
executeBehaviors { [weak self] (behavior: PageVisibilityBehavior) in
|
||||||
|
behavior.willShowPage(self?.delegateObjectIVar)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
open override func viewDidAppear(_ animated: Bool) {
|
open override func viewDidAppear(_ animated: Bool) {
|
||||||
super.viewDidAppear(animated)
|
super.viewDidAppear(animated)
|
||||||
|
|
||||||
@ -393,6 +401,14 @@ import UIKit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open override func viewWillDisappear(_ animated: Bool) {
|
||||||
|
super.viewWillDisappear(animated)
|
||||||
|
|
||||||
|
executeBehaviors { [weak self] (behavior: PageVisibilityBehavior) in
|
||||||
|
behavior.willHidePage(self?.delegateObjectIVar)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
open override func viewDidDisappear(_ animated: Bool) {
|
open override func viewDidDisappear(_ animated: Bool) {
|
||||||
super.viewDidDisappear(animated)
|
super.viewDidDisappear(animated)
|
||||||
|
|
||||||
|
|||||||
@ -33,10 +33,20 @@ public extension PageMoleculeTransformationBehavior {
|
|||||||
|
|
||||||
public protocol PageVisibilityBehavior: PageBehaviorProtocol {
|
public protocol PageVisibilityBehavior: PageBehaviorProtocol {
|
||||||
|
|
||||||
|
func willShowPage(_ delegateObject: MVMCoreUIDelegateObject?)
|
||||||
func onPageShown(_ delegateObject: MVMCoreUIDelegateObject?)
|
func onPageShown(_ delegateObject: MVMCoreUIDelegateObject?)
|
||||||
|
func willHidePage(_ delegateObject: MVMCoreUIDelegateObject?)
|
||||||
func onPageHidden(_ delegateObject: MVMCoreUIDelegateObject?)
|
func onPageHidden(_ delegateObject: MVMCoreUIDelegateObject?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public extension PageVisibilityBehavior {
|
||||||
|
// All optional.
|
||||||
|
func willShowPage(_ delegateObject: MVMCoreUIDelegateObject?) {}
|
||||||
|
func onPageShown(_ delegateObject: MVMCoreUIDelegateObject?) {}
|
||||||
|
func willHidePage(_ delegateObject: MVMCoreUIDelegateObject?) {}
|
||||||
|
func onPageHidden(_ delegateObject: MVMCoreUIDelegateObject?) {}
|
||||||
|
}
|
||||||
|
|
||||||
public protocol PageScrolledBehavior: PageBehaviorProtocol {
|
public protocol PageScrolledBehavior: PageBehaviorProtocol {
|
||||||
|
|
||||||
func pageScrolled(scrollView: UIScrollView, _ delegateObject: MVMCoreUIDelegateObject?)
|
func pageScrolled(scrollView: UIScrollView, _ delegateObject: MVMCoreUIDelegateObject?)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user