I want to use the singleton pattern in my class which has a private init with parameter. It also has a class function called setup which configures
class Policies{
static let shared = makeShared!();
static var makeShared:(()->Policies)?;
init(_ launchOptions:[UIApplicationLaunchOptionsKey:Any]?) {
super.init();
//initialization
}
}
extension AppDelegate:UIApplicationDelegate{
public func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool{
Policies.makeShared = { Policies(launchOptions) }
}
}