How about [weak(guard) self]? It would only work with closures returning -> ()
as if you are weakly capturing something you are likely to be messaging that
not returning some, so they can be ignored.
networkRequest.fetchData() { [weak(guard) self] result in
switch result {
case .succeeded(let data):
self.processData(data)
case .failed(let err):
self.handleError(err)
}
}
Patrick
> On 13 May 2016, at 2:10 AM, Hoon H. via swift-evolution
> <[email protected]> wrote:
>
> I am replying months lately, but anyway, I just read your proposal, and I
> think this is cool.
>
> [guard self]
>
> I am in doubt about another stuffs such as `[guard self else …]`. I hope your
> proposal to be accepted. I am getting a bit tired of writing `guard let S =
> self else { … }`.
>
> I am still not sure how to use mailing list… but I hope this to be a correct
> way.
> …Sending again because I mistyped Evan’s address.
>
> — Hoon H.
>
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution