Merge branch 'release/11_5_0' into 'develop'
release/11_5_0 hotfix merge Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com> Co-authored-by: Bruce, Matt R <matt.bruce@one.verizon.com> See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1093
This commit is contained in:
commit
0cb04e3700
@ -74,7 +74,7 @@ public class HeadersH2ButtonsModel: HeaderModel, MoleculeModelProtocol, ParentMo
|
|||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
titleLockup = try typeContainer.decodeMolecule(codingKey: .titleLockup)
|
titleLockup = try helper.deprecatedCreate(from: decoder) ?? typeContainer.decodeMolecule(codingKey: .titleLockup)
|
||||||
buttons = try typeContainer.decode(TwoButtonViewModel.self, forKey: .buttons)
|
buttons = try typeContainer.decode(TwoButtonViewModel.self, forKey: .buttons)
|
||||||
try super.init(from: decoder)
|
try super.init(from: decoder)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,7 @@ public class HeadersH2CaretLinkModel: HeaderModel, MoleculeModelProtocol, Parent
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
titleLockup = try typeContainer.decodeMolecule(codingKey: .titleLockup)
|
titleLockup = try helper.deprecatedCreate(from: decoder) ?? typeContainer.decodeMolecule(codingKey: .titleLockup)
|
||||||
caretLink = try typeContainer.decode(CaretLinkModel.self, forKey: .caretLink)
|
caretLink = try typeContainer.decode(CaretLinkModel.self, forKey: .caretLink)
|
||||||
try super.init(from: decoder)
|
try super.init(from: decoder)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,7 +73,7 @@ public class HeadersH2LinkModel: HeaderModel, MoleculeModelProtocol, ParentMolec
|
|||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
titleLockup = try typeContainer.decodeMolecule(codingKey: .titleLockup)
|
titleLockup = try helper.deprecatedCreate(from: decoder) ?? typeContainer.decodeMolecule(codingKey: .titleLockup)
|
||||||
link = try typeContainer.decode(LinkModel.self, forKey: .link)
|
link = try typeContainer.decode(LinkModel.self, forKey: .link)
|
||||||
try super.init(from: decoder)
|
try super.init(from: decoder)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,7 +76,7 @@ public class HeadersH2TinyButtonModel: HeaderModel, MoleculeModelProtocol, Paren
|
|||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
titleLockup = try typeContainer.decodeMolecule(codingKey: .titleLockup)
|
titleLockup = try helper.deprecatedCreate(from: decoder) ?? typeContainer.decodeMolecule(codingKey: .titleLockup)
|
||||||
button = try typeContainer.decode(ButtonModel.self, forKey: .button)
|
button = try typeContainer.decode(ButtonModel.self, forKey: .button)
|
||||||
try super.init(from: decoder)
|
try super.init(from: decoder)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,6 +34,7 @@ import Combine
|
|||||||
public static func setupNavigationControllerAsMainController() -> Self? {
|
public static func setupNavigationControllerAsMainController() -> Self? {
|
||||||
guard let navigationController = setupNavigationController() else { return nil }
|
guard let navigationController = setupNavigationController() else { return nil }
|
||||||
MVMCoreUISession.sharedGlobal()?.setup(asStandardLoadViewDelegate: navigationController)
|
MVMCoreUISession.sharedGlobal()?.setup(asStandardLoadViewDelegate: navigationController)
|
||||||
|
MVMCoreObject.sharedInstance()?.viewControllerManager = navigationController
|
||||||
return navigationController
|
return navigationController
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,6 +137,31 @@ extension NavigationController: MVMCoreViewManagerProtocol {
|
|||||||
public func displayedViewController(_ viewController: UIViewController) {
|
public func displayedViewController(_ viewController: UIViewController) {
|
||||||
manager?.displayedViewController?(viewController)
|
manager?.displayedViewController?(viewController)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func go(to index: Int) async {
|
||||||
|
guard index != viewControllers.count - 1 else { return }
|
||||||
|
await NavigationHandler.shared().set(viewControllers: Array(viewControllers[0...index]), navigationController: self)
|
||||||
|
}
|
||||||
|
|
||||||
|
public func navigate(toViewControllerOfPageType pageType: String, controllerType: AnyClass?) async -> UIViewController? {
|
||||||
|
for (index, controller) in viewControllers.enumerated() {
|
||||||
|
if let manager = controller as? MVMCoreViewManagerProtocol,
|
||||||
|
let viewController = await manager.navigate(toViewControllerOfPageType: pageType, controllerType: controllerType) {
|
||||||
|
await go(to: index)
|
||||||
|
return viewController
|
||||||
|
} else if let controller = controller as? MVMCoreViewControllerProtocol & UIViewController,
|
||||||
|
controller.pageType == pageType {
|
||||||
|
guard let controllerType = controllerType else {
|
||||||
|
await go(to: index)
|
||||||
|
return controller
|
||||||
|
}
|
||||||
|
guard (type(of: controller) == controllerType) else { continue }
|
||||||
|
await go(to: index)
|
||||||
|
return controller
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension UIColor {
|
extension UIColor {
|
||||||
|
|||||||
@ -102,7 +102,7 @@ public extension UINavigationController {
|
|||||||
navigationBar.standardAppearance = appearance
|
navigationBar.standardAppearance = appearance
|
||||||
navigationBar.scrollEdgeAppearance = appearance
|
navigationBar.scrollEdgeAppearance = appearance
|
||||||
|
|
||||||
setNavigationBarHidden(model.hidden, animated: true)
|
setNavigationBarHidden(model.hidden, animated: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc @MainActor
|
@objc @MainActor
|
||||||
|
|||||||
@ -269,6 +269,10 @@ extension MVMCoreUISplitViewController: MVMCoreViewManagerProtocol {
|
|||||||
public func newDataReceived(in viewController: UIViewController) {
|
public func newDataReceived(in viewController: UIViewController) {
|
||||||
updateState(with: viewController)
|
updateState(with: viewController)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func navigate(toViewControllerOfPageType pageType: String, controllerType: AnyClass?) async -> UIViewController? {
|
||||||
|
return await navigationController?.navigate(toViewControllerOfPageType: pageType, controllerType: controllerType)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc public extension MVMCoreUISplitViewController {
|
@objc public extension MVMCoreUISplitViewController {
|
||||||
|
|||||||
@ -95,6 +95,7 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
if (topAlertView) {
|
if (topAlertView) {
|
||||||
[splitViewController subscribeForNotifications];
|
[splitViewController subscribeForNotifications];
|
||||||
}
|
}
|
||||||
|
[MVMCoreObject sharedInstance].viewControllerManager = splitViewController;
|
||||||
return splitViewController;
|
return splitViewController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -362,6 +362,35 @@ open class SubNavManagerController: ViewController, MVMCoreViewManagerProtocol,
|
|||||||
manager?.displayedViewController?(viewController)
|
manager?.displayedViewController?(viewController)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func go(to index: Int) async {
|
||||||
|
// Load controller from the cache
|
||||||
|
guard index != self.index,
|
||||||
|
let controller = viewControllers[index] else { return }
|
||||||
|
needToTrackTabSelect = true
|
||||||
|
self.index = index
|
||||||
|
await NavigationHandler.shared().replace(viewController: controller, navigationController:subNavigationController, delegateObject:delegateObject(), tryToReplace: false, animated: true)
|
||||||
|
}
|
||||||
|
|
||||||
|
public func navigate(toViewControllerOfPageType pageType: String, controllerType: AnyClass?) async -> UIViewController? {
|
||||||
|
for (index, controller) in viewControllers.enumerated() {
|
||||||
|
if let manager = controller as? MVMCoreViewManagerProtocol,
|
||||||
|
let viewController = await manager.navigate(toViewControllerOfPageType: pageType, controllerType: controllerType) {
|
||||||
|
await go(to: index)
|
||||||
|
return viewController
|
||||||
|
} else if let controller = controller as? MVMCoreViewControllerProtocol & UIViewController,
|
||||||
|
controller.pageType == pageType {
|
||||||
|
guard let controllerType = controllerType else {
|
||||||
|
await go(to: index)
|
||||||
|
return controller
|
||||||
|
}
|
||||||
|
guard (type(of: controller) == controllerType) else { continue }
|
||||||
|
await go(to: index)
|
||||||
|
return controller
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - MVMCoreUISwipeNavigationProtocol
|
// MARK: - MVMCoreUISwipeNavigationProtocol
|
||||||
|
|
||||||
public func swipeLeft() {
|
public func swipeLeft() {
|
||||||
|
|||||||
@ -73,6 +73,7 @@ public extension MVMCoreUIUtility {
|
|||||||
|
|
||||||
@objc
|
@objc
|
||||||
public extension MVMCoreUIUtility {
|
public extension MVMCoreUIUtility {
|
||||||
|
/// Returns the current visible viewcontroller.
|
||||||
@objc @MainActor
|
@objc @MainActor
|
||||||
static func getVisibleViewController() -> UIViewController? {
|
static func getVisibleViewController() -> UIViewController? {
|
||||||
var viewController = NavigationHandler.shared().getViewControllerToPresentOn()
|
var viewController = NavigationHandler.shared().getViewControllerToPresentOn()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user