Last active
March 15, 2017 23:55
-
-
Save kostiakoval/945f70af0cfcc4270807 to your computer and use it in GitHub Desktop.
NSClassFromString in playground!
This file contains hidden or 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
import Foundation | |
class Playground : NSObject { | |
static var bundleVersion: String { | |
let s = self.description().stringByReplacingOccurrencesOfString(".Playground", withString:"") | |
return s | |
} | |
} | |
let version = Playground.bundleVersion | |
class AA { | |
} | |
let a = NSClassFromString("\(version).AA") | |
a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment