Skip to content

Instantly share code, notes, and snippets.

@bestiosdeveloper
Last active May 19, 2020 18:20
Show Gist options
  • Save bestiosdeveloper/1d32c5f21699a56cd48b0cf4a7b616a9 to your computer and use it in GitHub Desktop.
Save bestiosdeveloper/1d32c5f21699a56cd48b0cf4a7b616a9 to your computer and use it in GitHub Desktop.
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