added custom rotor

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-24 11:34:22 -05:00
parent 0a4560cffc
commit 0777898e8a

View File

@ -66,7 +66,7 @@ public class FormSection: UIStackView {
}
}
public class BaseViewController<Component: UIView>: UIViewController, Initable {
public class BaseViewController<Component: UIView>: UIViewController, Initable , CustomRotorable {
deinit {
print("\(Self.self) deinit")
}
@ -81,6 +81,12 @@ public class BaseViewController<Component: UIView>: UIViewController, Initable {
// MARK: - Combine Properties
//--------------------------------------------------
public var subscribers = Set<AnyCancellable>()
public var customRotorCache: [String: [UIView]] = [:]
public var customRotors: [CustomRotorType] = [
CustomRotorType(name: "Links", trait: .link),
CustomRotorType(name: "Buttons", trait: .button)
]
//--------------------------------------------------
// MARK: - Properties
@ -117,6 +123,7 @@ public class BaseViewController<Component: UIView>: UIViewController, Initable {
setup()
contentTopView.backgroundColor = Surface.light.color
}
}
public lazy var surfacePickerSelectorView = {
@ -229,6 +236,8 @@ public class BaseViewController<Component: UIView>: UIViewController, Initable {
self?.activeTextField?.resignFirstResponder()
self?.activeTextField = nil
}.store(in: &subscribers)
loadCustomRotors()
}
func isViewHiddenByKeyboard(view: UIView, keyboardFrame: CGRect) -> Bool {