WWDC24 SALE: Save 50% on all my Swift books and bundles! >>

Xcode tips and tricks – part two

Learn useful Xcode features with short videos.

Paul Hudson       @twostraws

This is part two of a series on Xcode tips and tricks, this time covering project filtering, issue fixing, caller finding, and more!

  1. Xcode tips and tricks – part one
  2. Xcode tips and tricks – part two
  3. Xcode tips and tricks – part three
  4. Xcode tips and tricks – part four

If you have some favorite Xcode tips of your own, let me know on Twitter!

Save 50% in my WWDC sale.

SAVE 50% To celebrate WWDC24, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

11. Focused navigation

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.

12. Measuring distances

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.

13. Project filtering

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.

14. Renaming code

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.

15. Fixing issues

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.

16. Finding callers

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.

17. Layering views

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.

18. Quick Help

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.

19. Authors view

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.

20. Find in project

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.

Save 50% in my WWDC sale.

SAVE 50% To celebrate WWDC24, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

BUY OUR BOOKS
Buy Pro Swift Buy Pro SwiftUI Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Beyond Code

Was this page useful? Let us know!

Average rating: 4.9/5

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.