Skip to content

Instantly share code, notes, and snippets.

@krzyzanowskim
Created February 25, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krzyzanowskim/bcd81fc0e86495b78253 to your computer and use it in GitHub Desktop.
Save krzyzanowskim/bcd81fc0e86495b78253 to your computer and use it in GitHub Desktop.
Swift nested function and variable reference
class Foo {
var some:String = "string"
func One() {
func Nested(weakSelf:Foo) {
if (weakSelf.some == "integer") { // no error
}
}
unowned var unownedSelf = self
Nested(unownedSelf)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment