Xcode fix-it shortcut
Asked Answered
A

5

37

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

Airhead answered 22/12, 2015 at 20:13 Comment(0)
C
30

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.

Cargill answered 10/11, 2016 at 7:38 Comment(2)
This can also be found by Editor > Fix All in ScopeIdeology
Run all of Xcode's “Fix-it”s at onceAxis
A
26

I am aware of two shortcuts.

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

Enjoy!

Analyse answered 22/12, 2015 at 20:26 Comment(1)
This shortcut seems to consistently crash xcode 7.3.1Jankell
W
15

control - option - command - f

f

Then

enter

To get out of split view.

Washtub answered 7/9, 2017 at 16:51 Comment(4)
Works but it brings assistant editor together at the same timeMeteorology
@Pei, what do you mean by "brings assistant editor together"?Washtub
@Washtub it also shows Assistant editor of the Xcode which splits the code editor you know. kinda annoyingMeteorology
Its not doing that for me. Perhaps you can click command enter anytime that split view happens.Washtub
B
8

Here are the default key bindings for XCode 8

enter image description here

Benoite answered 3/9, 2017 at 11:3 Comment(1)
This 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)Taxation
S
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

Sufi answered 26/12, 2018 at 12:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.