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
Asked
Active
Viewed 1.6k times
36

Yao
- 709
- 2
- 11
- 22
5 Answers
28
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
.

yvette
- 361
- 4
- 6
-
1This can also be found by Editor > Fix All in Scope – AnthonyW Dec 04 '16 at 21:32
-
[Run all of Xcode's “Fix-it”s at once](https://stackoverflow.com/questions/32505307/run-all-of-xcodes-fix-its-at-once) – P i Jul 01 '17 at 14:33
26
I am aware of two shortcuts.
Ctrl + Cmd + '
- auto fix next error
Ctrl + Cmd + "
- auto fix prev error
Enjoy!

scope
- 1,967
- 14
- 15
15
control - option - command - f
⌃
⌥
⌘
f
Then
⌘
enter
To get out of split view.

ScottyBlades
- 12,189
- 5
- 77
- 85
-
3
-
-
1@ScottyBlades it also shows `Assistant editor` of the `Xcode` which splits the code editor you know. kinda annoying – Pei Jul 13 '18 at 01:04
-
1Its not doing that for me. Perhaps you can click `command` `enter` anytime that split view happens. – ScottyBlades Jul 13 '18 at 01:17
8

arcseldon
- 35,523
- 17
- 121
- 125
-
4This solution is awesome... but whenever I press the ctrl alt cmd F while fixing all issues, assistant editor shows up... turns out to be some bug in Xcode since 7... I changed this to ctrl+shift+f and works fine (it overlaps with some text edit function which I do not use) – Dominik Bucher Sep 25 '18 at 12:41
4
Xcode Fix an issue
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


yoAlex5
- 29,217
- 8
- 193
- 205