Created
September 16, 2015 14:28
-
-
Save bsrz/cebc1be2c20b2fa9beea 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
| import Foundation | |
| class R2D2 { | |
| func beep(completion: (() -> ())?) -> Void { | |
| completion?() | |
| } | |
| } | |
| let r2d2 = R2D2() | |
| r2d2.beep { [unowned self] () -> () in | |
| // Do something | |
| } | |
| r2d2.beep { [weak self] () -> () in | |
| // Do something | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment