I\'m having some trouble accessing a Swift Singleton from Objective-C.
@objc class SingletonTest: NSObject { // swiftSharedInstance is not accessible fr
Swift 5 and above
final class Singleton: NSObject { @objc static let shared = Singleton() @objc var string: String = "Hello World" private override init() {} }
use in Objective-C
Objective-C
NSLog("Singleton String = %@", [Singleton shared].string]);