Change file name
This commit is contained in:
parent
bc39332b17
commit
f0b5e74839
@ -1,63 +0,0 @@
|
||||
//
|
||||
// PageBehaviors.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Kyle on 5/8/20.
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public protocol PageBehaviorProtocol: ModelProtocol {
|
||||
|
||||
/// The type of rule
|
||||
var behaviorName: String { get }
|
||||
}
|
||||
|
||||
public extension PageBehaviorProtocol {
|
||||
|
||||
var behaviorName: String {
|
||||
get { Self.identifier }
|
||||
}
|
||||
|
||||
static var categoryCodingKey: String {
|
||||
"behaviorName"
|
||||
}
|
||||
|
||||
static var categoryName: String {
|
||||
"\(PageBehaviorProtocol.self)"
|
||||
}
|
||||
}
|
||||
|
||||
public protocol PageVisibilityBehavior: PageBehaviorProtocol {
|
||||
|
||||
func onPageShown()
|
||||
func onPageHidden()
|
||||
}
|
||||
|
||||
public protocol PageScrolledBehavior: PageBehaviorProtocol {
|
||||
|
||||
func pageScrolled(scrollView: UIScrollView)
|
||||
}
|
||||
|
||||
public protocol PageBehaviorsTemplateProtocol {
|
||||
|
||||
var behaviors: [PageBehaviorProtocol]? { get set }
|
||||
|
||||
}
|
||||
|
||||
public extension PageBehaviorsTemplateProtocol {
|
||||
mutating func add(behavior: PageBehaviorProtocol) {
|
||||
var newBehaviors = behaviors ?? []
|
||||
newBehaviors.append(behavior)
|
||||
self.behaviors = newBehaviors
|
||||
}
|
||||
}
|
||||
|
||||
public extension MVMCoreUIDelegateObject {
|
||||
weak var behaviorTemplateDelegate: (PageBehaviorsTemplateProtocol & NSObjectProtocol)? {
|
||||
get {
|
||||
return (moleculeDelegate as? PageProtocol)?.pageModel as? (PageBehaviorsTemplateProtocol & NSObjectProtocol)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user