convenience functions
This commit is contained in:
parent
6762082b7c
commit
677c352b9e
@ -36,7 +36,7 @@ public extension PageBehaviorHandlerProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Executes all behaviors of type.
|
/// Executes all behaviors of type.
|
||||||
public func executeBehaviors<T>(_ behaviorBlock: (_ behavior: T) -> Void) {
|
func executeBehaviors<T>(_ behaviorBlock: (_ behavior: T) -> Void) {
|
||||||
behaviors?.compactMap { $0 as? T }.forEach { behaviorBlock($0) }
|
behaviors?.compactMap { $0 as? T }.forEach { behaviorBlock($0) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,8 +50,11 @@ public protocol PageCustomActionHandlerBehavior: PageBehaviorProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public extension MVMCoreUIDelegateObject {
|
public extension MVMCoreUIDelegateObject {
|
||||||
|
var behaviorModelDelegate: PageBehaviorHandlerModelProtocol? {
|
||||||
|
(moleculeDelegate as? PageProtocol)?.pageModel as? PageBehaviorHandlerModelProtocol
|
||||||
|
}
|
||||||
|
|
||||||
weak var behaviorTemplateDelegate: (PageBehaviorHandlerProtocol & NSObjectProtocol)? {
|
weak var behaviorTemplateDelegate: (PageBehaviorHandlerProtocol & NSObjectProtocol)? {
|
||||||
(moleculeDelegate as? PageProtocol)?.pageModel as? (PageBehaviorHandlerProtocol & NSObjectProtocol)
|
moleculeDelegate as? (PageBehaviorHandlerProtocol & NSObjectProtocol)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user