Refactoring Swift code in Xcode 8

It isn’t possible at present:

Can't refactor Swift code

Yes, there are tools like Refactorator I can add to Xcode to provide this, but this goes against my minimalist/cheap approach, and frankly, unless it’s something on the order of JetBrains’ ReSharper, why bother? Well, there *is* JetBrains’ AppCode, and maybe I’ll check it out when I’m past the inflection point on the Swift learning curve, but $200 more into what is at present a hobby is hard to justify.


Ugh, just ran into an ugly bug in my code, and I can’t find a way to have the Swift compiler warn me about it. My class has a property named progressView

 var progressView: UIProgressView!

– and I inadvertently aliased it with a local constant in a function –

let progressView = UIProgressView(progressViewStyle: .default)

– with the net result that I crashed in KVO code because the progressView property was nil.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s