Learn useful Xcode features with short videos.
This is part three of a series on Xcode tips and tricks, this time covering vector artwork, sorting your project, code coverage, and more!
If you have some favorite Xcode tips of your own, let me know on Twitter!
SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!
Sponsor Hacking with Swift and reach the world's largest Swift community!
Use parallel testing to make Xcode run multiple tests simultaneously to save time, and use random order testing to make Xcode run tests in a different order each time – a simple way to stop you making one test dependent on another.
Documentation comments are shown inside Xcode’s Quick Help, its code completion, and other places. To add one, press ⌥⌘/ then type in the comment you want to use.
If you’ve used Interface Builder to design a view exactly how you want it, set its Lock option to All Properties to avoid accidental changes in the future.
If you add PDFs to your asset catalog, you can ask Xcode to embed the vector data into your app bundle so your images can be drawn at any size at runtime.
You can customize the layout Xcode adopts when debugging – make it show the paused code in a new tab, show or hide variables, show or hide inspectors, and more. Best of all, closing that tab puts you back to the previous layout!
Xcode can help keep your project organized by sorting any group by either name or type. Sorting by type also sorts by name, so try that one first.
If you’ve moved some code around and messed up your indenting a little, select the code and press Ctrl+I to have Xcode fix it.
Xcode’s Open Quickly shortcut can take you straight to a specific line number in your file – type part of your filename, then a colon, then the line number you want to jump to.
If you ask Xcode to gather code coverage information, it will tell you exactly which parts of your app’s code were executed by your tests.
You can add multiple Auto Layout constraints in Interface Builder by holding down Shift as you’re clicking.
SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.