Learn useful Xcode features with short videos.
This is part two of a series on Xcode tips and tricks, this time covering project filtering, issue fixing, caller finding, and more!
If you have some favorite Xcode tips of your own, let me know on Twitter!
When you’re using the assistant editor, Xcode opens files in the primary editor by default. If you’d rather use your selected editor, activate Uses Focused Editor instead – files will now open in whichever editor is active.
Storyboards can show you the distance between one view and another: select a view, hold down Option, then hover over other views to see their distance.
The two buttons at the bottom-right of the project navigator filter the files it shows. Use the left-hand button to show files you've opened recently, and the right-hand button to show files with source control status.
You can rename variables and more using Xcode’s refactoring system. To try it out first select a variable, then go to the Editor menu and choose Refactor then Rename. Now type your name and press Return to have it changed everywhere.
If you’re updating your Swift version, or bringing some older Swift code into your project, Xcode can apply all its fix-its on a file-by-file basis.
Xcode’s Related Items button can you help you find all places where a method is called. First, click in your method, now go to Related Items, Callers, then select an item.
In Interface Builder, if you hold down the Command key while dragging one view over another, it will be placed over the view rather than inside it.
You can see detailed information about classes, variables, and more by using Quick Help – just hold down Option and click whatever you want to explore.
Xcode can show you who last modified each part of your code, along with their source control commit message. To activate this view, long press on the Comparison view button, then choose Authors.
After using the Open Quickly shortcut (⇧⌘O) to jump to a file, type, or method in your project, use ⇧⌘J to reveal that file in the project navigator.
SPONSORED Instabug helps you identify and resolve severe crashes quickly. You can retrace in-app events and know exactly which line of code caused the crash along with environment details, network logs, repro steps, and the session profiler. Ask more questions or keep users up-to-date with in-app replies straight from your dashboard. Instabug takes data privacy seriously, so no one sees your data but you! See more detailed features comparison and try Instabug's crash reporting SDK for free.
Paul Hudson is the creator of Hacking with Swift, the most comprehensive series of Swift books in the world. He's also the editor of Swift Developer News, the maintainer of the Swift Knowledge Base, and a speaker at Swift events around the world. If you're curious you can learn more here.