iOS Dev Nugget 189 Xcode's Fix All in Scope


Need to run a code review on your codebase? Hire me

I learnt this tip from @jim_rutherford via this tweet.

When there's more than one warning or error that Xcode can fix with a Fix-it, you can go to the Editor menu and choose Fix All in Scope (Cmd+Opt+Ctrl+F) to fix all the warning/errors in the current scope (method or class) where your cursor is at.

E.g. if you have this in a method:

let r = CGRect(1, 2, 3, 4)
let p = CGPoint(1, 2)

place your cursor anywhere in that method and hit Cmd+Opt+Ctrl+F to invoke Fix all in Scope and it will be updated to these:

let r = CGRect(x: 1, y: 2, width: 3, height: 4)
let p = CGPoint(x: 1, y: 2)

If you place your cursor outside the method but in the class, it will attempt to fix all the warning/errors in that class instead.

Your feedback is valuable: Do you want more nuggets like this?   Yes   or   No



Like this and want such iOS dev nuggets to be emailed to you, weekly?

Sign Me Up! or follow @iosdevnuggets on Twitter


View archives of past issues