Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Weak self example
create(image: image) { [weak self] key, error in
guard let `self` = self else {
return
}
if let error = error {
self.completion?(nil, error)
self.completion = nil
return
}
guard let key = key else {
self.completion?(nil, self.unknownError)
self.completion = nil
Logging.warn("Unable to upload image")
return
}
self.append(key: key, image: image, toAnnotation: annotation)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment