Xcode fix-it shortcut

2019-03-22 17:18发布

问题:

I am wondering is there any shortcut or hotkey that can apply the fix-it suggestion from Xcode? (Xcode 7)
In Android Studio, we can just use ctrl+enter to apply the correction. Is there anything similar to that in Xcode?
some ref: https://swifteducation.github.io/assets/pdfs/XcodeKeyboardShortcuts.pdf

回答1:

I am aware of two shortcuts.

Ctrl + Cmd + ' - auto fix next error
Ctrl + Cmd + " - auto fix prev error

Enjoy!



回答2:

In Xcode 8, this appears to now be ⌃⌥⌘F or Ctrl + Alt + Cmd + F

If you want to change it, go to Xcode > Preference > Key Bindings and search for Fix all in scope.



回答3:

control - option - command - f

f



回答4:

Here are the default key bindings for XCode 8



回答5:

Unlike Android Studio where you can apply a fix to a single issue, the Xcode are able to fix all issues at time via Editor -> Fix All Issues