Created
January 31, 2017 04:08
-
-
Save efremidze/3a9e38f19224e38d3dc785ba9fe01a0d to your computer and use it in GitHub Desktop.
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
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