Updated to get the upcoming view controller navigationBar model

This commit is contained in:
Scott Pfeil 2023-10-13 14:21:22 -04:00
parent f00df65110
commit c8aac2e5d7
2 changed files with 4 additions and 3 deletions

View File

@ -119,7 +119,7 @@ public extension UINavigationController {
setNavigationBarHidden(model.hidden, animated: true)
}
@MainActor
@objc @MainActor
func getViewController() -> UIViewController? {
guard let topViewController = getViewControllers().last,
let viewController = MVMCoreUIUtility.getViewControllerTraversingManagers(topViewController) else { return nil }

View File

@ -57,9 +57,10 @@ public extension MVMCoreUIUtility {
return findViews(by: type, views: queue) + matching
}
@MainActor
static func visibleNavigationBarStlye() -> NavigationItemStyle? {
if let vc = MVMCoreUIUtility.getCurrentVisibleController(),
let navController = NavigationController.navigationController(),
if let navController = NavigationController.navigationController(),
let vc = navController.getViewController(),
let navigationBar = navController.getNavigationModel(from: vc) as? NavigationItemModel {
return navigationBar.style
}