From 0777898e8ad7c356cc66c961bc5e9c0f33c88048 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 24 Aug 2023 11:34:22 -0500 Subject: [PATCH] added custom rotor Signed-off-by: Matt Bruce --- VDSSample/ViewControllers/BaseViewController.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/VDSSample/ViewControllers/BaseViewController.swift b/VDSSample/ViewControllers/BaseViewController.swift index 3aadef4..f268703 100644 --- a/VDSSample/ViewControllers/BaseViewController.swift +++ b/VDSSample/ViewControllers/BaseViewController.swift @@ -66,7 +66,7 @@ public class FormSection: UIStackView { } } -public class BaseViewController: UIViewController, Initable { +public class BaseViewController: UIViewController, Initable , CustomRotorable { deinit { print("\(Self.self) deinit") } @@ -81,6 +81,12 @@ public class BaseViewController: UIViewController, Initable { // MARK: - Combine Properties //-------------------------------------------------- public var subscribers = Set() + + 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: UIViewController, Initable { setup() contentTopView.backgroundColor = Surface.light.color } + } public lazy var surfacePickerSelectorView = { @@ -229,6 +236,8 @@ public class BaseViewController: UIViewController, Initable { self?.activeTextField?.resignFirstResponder() self?.activeTextField = nil }.store(in: &subscribers) + + loadCustomRotors() } func isViewHiddenByKeyboard(view: UIView, keyboardFrame: CGRect) -> Bool {