Skip to content

Instantly share code, notes, and snippets.

@efremidze
Created January 31, 2017 04:08
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 efremidze/3a9e38f19224e38d3dc785ba9fe01a0d to your computer and use it in GitHub Desktop.
Save efremidze/3a9e38f19224e38d3dc785ba9fe01a0d to your computer and use it in GitHub Desktop.
class Messenger {
func log(_ message: String) {
print(message)
}
func logThis() {
DispatchQueue.main.async { [weak self] in
guard let this = self else { return }
this.log("1")
DispatchQueue.main.async { [weak this] in
this?.log("2")
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment