Last active
May 19, 2020 18:20
-
-
Save bestiosdeveloper/1d32c5f21699a56cd48b0cf4a7b616a9 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 Coder { | |
var isCoding = false | |
func perform(_ work: @escaping () -> Void) { | |
work() | |
} | |
func startCoding() { | |
perform { [self] in // <- Fix-it: capture 'self' explicitly to enable implicit 'self' in this closure. Fix-it: insert '[self] in' | |
isCoding = true | |
} | |
} | |
} | |
let newCoder = Coder() | |
newCoder.startCoding() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment