
Makes it easy to introspect variable scope, though Xcode is less of a Limiting its use to explicitly call out potential retain cycles. Shadow properties? I generally like that `self` is optional and prefer Swift-evolution mailing mailing mailing mailing list there warnings/diagnostics that could call out when local variables Just as example, my proposition makes the following piece of code Any good reason I shouldn't go on with the proposition? To prefer readability to brevity and the feature makes theĭistinction between local and instance variables/functions crystalĬlear. Instance properties and functions using self. I don't understand the reasoning behind removing the need to access It can be dangerous and hard toĢ) Also when, say fine-tuning UIKit animations, I find myself wastingĮnormous amount of time adding and removing "self". On Fri, at 5:34 PM, Rudolf Adamkovič > wrote:ġ) I actually encountered at least two bugs in my app introduced by On Fri, Dec 4, 2015, at 02:41 PM, Stephen Celis wrote: Because we’re in a UIViewController subclass, I'm unknowingly However, I forgot to remove one more line that used theĥ. Everything compiles and seems to work just fine.Ĥ. After a while, I decide to remove a part of this method, includingģ. Say there’s a method in my class that contains a local variableĢ. To be a little more specific, here’s a real-world example:ġ.

Xcode is less of a requirement these days. Xcode also makes it easy to introspect variable scope, though Variables shadow properties? I generally like that `self` is optionalĪnd prefer limiting its use to explicitly call out potential retainĬycles. Just as example, my proposition makes the following piece of code illegal: struct FooBar Īre there warnings/diagnostics that could call out when local

Swift has always seemed to prefer readability to brevity and the feature makes the distinction between local and instance variables/functions crystal clear. I don't understand the reasoning behind removing the need to access instance properties and functions using self. On Dec 4, 2015, at 1:19 PM, David Hart wrote: Currently, ‘self.’ is required when used in closure capture contexts, which has the nice property of making it really clear when things are being captured (and therefore retained).
