move function behavior for scoping
This commit is contained in:
parent
48388343ef
commit
6762082b7c
@ -34,4 +34,9 @@ public extension PageBehaviorHandlerProtocol {
|
||||
}
|
||||
self.behaviors = behaviors.count > 0 ? behaviors : nil
|
||||
}
|
||||
|
||||
/// Executes all behaviors of type.
|
||||
public func executeBehaviors<T>(_ behaviorBlock: (_ behavior: T) -> Void) {
|
||||
behaviors?.compactMap { $0 as? T }.forEach { behaviorBlock($0) }
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user