diff --git a/MVMCoreUI.xcodeproj/xcshareddata/xcschemes/MVMCoreUI.xcscheme b/MVMCoreUI.xcodeproj/xcshareddata/xcschemes/MVMCoreUI.xcscheme
new file mode 100644
index 00000000..9e236f99
--- /dev/null
+++ b/MVMCoreUI.xcodeproj/xcshareddata/xcschemes/MVMCoreUI.xcscheme
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MVMCoreUI/Alerts/AlertOperation.swift b/MVMCoreUI/Alerts/AlertOperation.swift
index 088a6ff5..50b71e46 100644
--- a/MVMCoreUI/Alerts/AlertOperation.swift
+++ b/MVMCoreUI/Alerts/AlertOperation.swift
@@ -73,7 +73,7 @@ public class AlertOperation: MVMCoreOperation {
if await !self.properties.getIsDisplayed() {
self.markAsFinished()
} else {
- (CoreUIObject.sharedInstance()?.loggingDelegate as? MVMCoreUILoggingDelegateProtocol)?.logAlert(with: self.alertObject)
+ (MVMCoreObject.sharedInstance()?.loggingDelegate as? MVMCoreUILoggingDelegateProtocol)?.logAlert(with: self.alertObject)
if self.isCancelled {
await self.dismissAlertView()
}
diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift
index ea7d89b8..6b360120 100644
--- a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift
+++ b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift
@@ -384,7 +384,7 @@ open class Carousel: View {
extension Carousel: UICollectionViewDelegateFlowLayout {
open func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
- let itemWidth = collectionView.bounds.width * itemWidthPercent
+ let itemWidth = (collectionView.bounds.width - collectionView.contentInset.left - collectionView.contentInset.right) * itemWidthPercent
return CGSize(width: itemWidth, height: collectionView.bounds.height)
}
diff --git a/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift b/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift
index 625f0a25..3372c1ab 100644
--- a/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift
+++ b/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift
@@ -12,6 +12,7 @@ import MVMCore
public extension UINavigationController {
/// Convenience function for setting the navigation item.
+ @MainActor
func setNavigationItem(with model: NavigationItemModelProtocol, for viewController: UIViewController, coordinatingWith pageBehaviorController: PageBehaviorHandlerProtocol? = nil) {
let behaviorHandler = pageBehaviorController ?? viewController as? PageBehaviorHandlerProtocol;
@@ -33,6 +34,7 @@ public extension UINavigationController {
}
/// Convenience function for setting the navigation buttons.
+ @MainActor
func setNavigationButtons(with model: NavigationItemModelProtocol, for viewController: UIViewController) {
let delegate = (viewController as? MVMCoreViewControllerProtocol)?.delegateObject?() as? MVMCoreUIDelegateObject
var leftItems: [UIBarButtonItem] = []
@@ -60,6 +62,7 @@ public extension UINavigationController {
}
/// Convenience function for setting the navigation titleView.
+ @MainActor
func setNavigationTitleView(with model: NavigationItemModelProtocol, for viewController: UIViewController, coordinatingWith pageBehaviorController: PageBehaviorHandlerProtocol? = nil) {
guard let titleViewModel = model.titleView else { return }
@@ -87,6 +90,7 @@ public extension UINavigationController {
}
/// Convenience function for setting the navigation bar ui
+ @MainActor
func setNavigationBarUI(with model: NavigationItemModelProtocol) {
let navigationBar = navigationBar
let font = Styler.Font.BoldTitleSmall.getFont(false)
diff --git a/MVMCoreUI/OtherHandlers/CoreUIObject.swift b/MVMCoreUI/OtherHandlers/CoreUIObject.swift
index b96e9b93..d1fd18f9 100644
--- a/MVMCoreUI/OtherHandlers/CoreUIObject.swift
+++ b/MVMCoreUI/OtherHandlers/CoreUIObject.swift
@@ -9,19 +9,22 @@
import UIKit
import MVMCore
-@objcMembers open class CoreUIObject: MVMCoreObject {
+@objcMembers
+public class CoreUIObject: NSObject {
+ private static var singleton = CoreUIObject()
+ public static func sharedInstance() -> CoreUIObject? { singleton }
+ private override init() {}
+
public var alertHandler: AlertHandler?
public var topNotificationHandler: NotificationHandler?
- open override func defaultInitialSetup() {
+ public func defaultInitialSetup() {
+ MVMCoreObject.sharedInstance()?.defaultInitialSetup()
CoreUIModelMapping.registerObjects()
- loadHandler = MVMCoreLoadHandler()
- cache = MVMCoreCache()
- session = MVMCoreUISession()
- sessionHandler = MVMCoreSessionTimeHandler()
- actionHandler = MVMCoreUIActionHandler()
- viewControllerMapping = MVMCoreUIViewControllerMappingObject()
- loggingDelegate = MVMCoreUILoggingHandler()
+ MVMCoreObject.sharedInstance()?.session = MVMCoreUISession()
+ MVMCoreObject.sharedInstance()?.actionHandler = MVMCoreUIActionHandler()
+ MVMCoreObject.sharedInstance()?.viewControllerMapping = MVMCoreUIViewControllerMappingObject()
+ MVMCoreObject.sharedInstance()?.loggingDelegate = MVMCoreUILoggingHandler()
alertHandler = AlertHandler()
}
}
diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUISession.m b/MVMCoreUI/OtherHandlers/MVMCoreUISession.m
index 42a3e769..3b1d5913 100644
--- a/MVMCoreUI/OtherHandlers/MVMCoreUISession.m
+++ b/MVMCoreUI/OtherHandlers/MVMCoreUISession.m
@@ -9,7 +9,8 @@
#import "MVMCoreUISession.h"
#import "MFLoadingViewController.h"
#import "NSLayoutConstraint+MFConvenience.h"
-@import MVMCore.MVMCoreObject;
+@import MVMCore.MVMCoreLoadingOverlayDelegateProtocol;
+@import MVMCore.Swift;
@interface MVMCoreUISession ()