TWilly
TWilly

Reputation: 4943

Quick way to fix Xcode warnings

I've been switching between versions of Swift in Xcode 6 and my project now has 220 warnings. Mostly minor code suggestions.

Is there an easy way in Xcode to run through all the warnings and use the "Fix-it" tool to auto correct it?

I would like to review each warning, then click a button to fix the warning, and then skip to next warning. Otherwise it's going to take me a few hours to manually get through each warning.

Upvotes: 9

Views: 6494

Answers (2)

ScottyBlades
ScottyBlades

Reputation: 14063

control - option - command - f

f

Just type

Enter

afterward to adjust back to normal screens view.

Upvotes: 1

rob mayoff
rob mayoff

Reputation: 385970

Your best bet is to use keyboard shortcuts. The default keyboard shortcut for Navigate > Jump to Next Issue is ⌘' (command-single-quote). If you press it, Xcode will jump to the next issue it knows about. If that issue has a Fix-it available, the Fix-it popover will appear automatically and you can press return to execute the Fix-it, or press ⌘' to leave the code unchanged and go to the next issue, or press escape to leave the code unchanged and stay on that issue.

You can also open the Issue Navigator (default shortcut: ⌘4). Then you can click on issues one-by-one. If you click on an issue with a Fix-it, Xcode will show the Fix-it popover and you can press return to execute the Fix-it.

Upvotes: 12

Related Questions