Created
February 16, 2019 14:47
-
-
Save amichnia/7be82697478ec980cdd19ca6a867bc66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
@objc(Factory) | |
internal class Factory: NSObject { | |
private static var privateClassType: MyPrivateClass.Type! | |
@objc static func registerPrivateClassType(type: MyPrivateClass.Type) { | |
print("REGISTRATION CALLED WITH TYPE = \(type)") | |
privateClassType = type | |
} | |
func createMyPrivateClass() -> MyPrivateClass { | |
print("FACTORY METHOD CALLED TO CREATE INSTANCE OF \(String(describing: Factory.privateClassType))") | |
return Factory.privateClassType.init() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment