Created
October 27, 2015 18:46
-
-
Save nevyn/920d4cddb6ee6ab1ce1f to your computer and use it in GitHub Desktop.
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
class Foo : NSObject { | |
class func shared() -> Foo { | |
return Foo() | |
} | |
func foo() -> String { | |
return "hello" | |
} | |
} | |
let WeakFoo = NSClassFromString("Foo"); | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
let x = WeakFoo?.shared().foo() | |
print("Hello \(x)") | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment