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.5k times
34
Yao
- 679
- 2
- 9
- 21
5 Answers
26
I am aware of two shortcuts.
Ctrl + Cmd + ' - auto fix next error
Ctrl + Cmd + " - auto fix prev error
Enjoy!
scope
- 1,897
- 13
- 15
-
3This shortcut seems to consistently crash xcode 7.3.1 – Michael Jul 21 '16 at 21:11
25
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
- 331
- 4
- 6
-
1
-
[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
15
control - option - command - f
⌃ ⌥ ⌘ f
Then
⌘ enter
To get out of split view.
ScottyBlades
- 9,795
- 4
- 62
- 71
-
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
- 32,803
- 15
- 115
- 119
-
3This 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
3
Xcode fix 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
- 21,739
- 5
- 148
- 151