Skip to content

Shows how to instantiate classes by name in Swift.

License

Notifications You must be signed in to change notification settings

kglee79/swift-factory

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swift-factory

This simple repository shows how to instantiate classes by class name in Swift. It uses Objective-C interop to perform the actual object creation. A generic utility Swift class named ObjectFactory provides a convenience API.

This code was tested against the first beta of iOS 8. The sample project is an OS X command line for the sake of simplicity.

Refer to main.swift to see how to use ObjectFactory.

For more information about the project refer to this blog post: http://ijoshsmith.com/2014/06/05/instantiating-classes-by-name-in-swift/

About

Shows how to instantiate classes by name in Swift.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 59.0%
  • Objective-C 41.0%