//
//  CoreUIObject.swift
//  MVMCoreUI
//
//  Created by Scott Pfeil on 10/24/19.
//  Copyright © 2019 Verizon Wireless. All rights reserved.
//

import UIKit
import MVMCore

@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? {
        didSet {
            accessibilityHandler?.registerForTopNotificationsChanges()
        }
    }
    public var accessibilityHandler: AccessibilityHandler?

    public func defaultInitialSetup() {
        MVMCoreObject.sharedInstance()?.defaultInitialSetup()
        CoreUIModelMapping.registerObjects()
        MVMCoreObject.sharedInstance()?.session = MVMCoreUISession()
        MVMCoreObject.sharedInstance()?.actionHandler = MVMCoreUIActionHandler()
        MVMCoreObject.sharedInstance()?.viewControllerMapping = MVMCoreUIViewControllerMappingObject()
        MVMCoreObject.sharedInstance()?.loggingDelegate = MVMCoreUILoggingHandler()
        alertHandler = AlertHandler()
        accessibilityHandler = AccessibilityHandler()
    }
}
