Created
March 23, 2016 10:02
-
-
Save johanhar/33823c396e8bfa697fb5 to your computer and use it in GitHub Desktop.
Meta types
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
func getType<T>(type: T.Type) -> T.Type { | |
return type.self | |
} | |
class Foo { | |
required init() { } | |
} | |
let MyType = getType(Foo) | |
let myFoo = MyType.init() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment