Created
December 16, 2016 15:41
-
-
Save dodikk/201ceae6eeafc817edab5338510c257e to your computer and use it in GitHub Desktop.
example of weak usage for swift closures
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
| FriendsProvider.shared.getFriendList(){ success in | |
| print("users Fetched \(success)") | |
| dispatch_async(dispatch_get_main_queue(), { | |
| self.delegate?.hideProgressHUD() | |
| }) | |
| } |
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
| dispatch_async(dispatch_get_main_queue(), { | |
| [weak self] in | |
| if let strongSelf = self | |
| { | |
| strongSelf.delegate?.hideProgressHUD() | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment