Xcode is the main IDE for developing software for macOS, iOS, watchOS, and tvOS. It contains a lot of well-known features like Open Quickly (⇧ + ⌘ + O
), the assistant editor and handy shortcuts like ⌘ + U
to run tests quickly. Some other features are less known but just as useful and these Xcode tips will be described.
Edit All in Scope
Use ⌃ + ⌘ + E
to edit All in Scope and change all variables or methods with the same name at the same time.
Jump to definition
Until Xcode 9 it was easy to jump to a definition. Starting with Xcode 9 a new menu would show up.
As the popup hints, a new combination is introduced to quickly jump to the definition. Combine ^ + ⌘ + Click
to directly jump to a definition and skip the popup.
Add documentation
Use ⌥ + ⌘ + /
to quickly add documentation.
Define custom Search Scopes
Often when searching a lot of frameworks are shown inside the search results. This can be quite a mess when searching for code in your personal project or framework.
By defining your own custom search scope you can speed up your workflow and find what you need more quickly.
Show only scheme related or failed tests
In the left-bottom of the Xcode Navigator, you often find useful less-known tools. Two useful filtering methods are available for tests. The Show only tests in the currently selected scheme
hides all unrelated tests for a better overview. The button next to that only shows failed tests if you need focus for fixing tests.
Show Only Errors
Another feature in the Xcode Navigator is the filter option to only show errors. If your project contains a lot of warnings this can be very helpful to focus on errors only.
More Xcode tips
Xcode 10 brings a lot of new useful features, from which some aren’t enabled by default. You can read more about these Xcode tips in my post Enabling newly added opt-in features in Xcode 10.