Xcode How To: Naming Your Tests

I noticed something that might be of interest to y’all. At one point I asked my team if the preference was to name test files as MyFileTests or TestMyFile. I’ve noticed that for test files that end with Tests you get this nice output in the Counterparts menu where the test and the …

Xcode How To: Run Tests Without Running All Tests

TIL: if you are running the same test case over and over you can mash ⌃⌥⌘G and Xcode will rerun the last test case you just ran. Importantly this will just run whatever you had run just before. So if it’s a whole test case, it runs that again. If it’s a single test it will run that …

How to fix WatchKit app WeatherKit issues

I made an iOS app that used WeatherKit. Everything was working as expected and recently I wanted to add an WatchOS component. Because I am adding the watch app to an existing iOS app, I added the target in Xcode and made sure to update the capabilities to the watch app so that it could use …

Xcode How To: Edit all instances of a word in a file with a keyboard shortcut

Menu: Editor -> Edit All In Scope (also shows key binding) Keyboard Shortcut: Control-Command-E I have used Xcode’s Refactor command many times and while it’s nice and useful, it is always buggy and really slow. Sometimes I just want to quickly edit something in the file I’m …

UI Bug with Xcode's invisible characters in documentation comments

Feedback number: FB12128126 I like to display invisible characters in my text editors/IDEs because I want to know if the spaces I’m seeing are spaces or tabs. I also like to be able to tell immediately if I’m seeing multiple spaces or not. Here is an example of what that looks like. …