5 Best Xcode Tips & Tricks

Hello everyone! There are so many hidden features of Xcode that could make your code better, faster, and cleaner and save you so much time. Let’s dive into a few.

#1: Auto-Indent

Clean code is good code.

I’m a huge fan of clean and readable code, and a part of that is keeping your code indented to avoid errors like this.

Xcode’s got an awesome shortcut for this kind of issue.

First select your text using command-a. Then use control-i to indent. This is what you get.

And just add a }. So much better.

#2: Multiple Cursors

The more, the merrier.

All of us have had that moment when you need to delete or edit multiple lines of code at the same time, and Find & Replace won’t work. I suffered through lots of those until I found out about this handy tool.

This is one of those cases where I wish I’d known about this tool. To get multiple cursors, use command-shift down arrow or command-shift up arrow.

You can also use command-shift, then click on the places you need more cursors.

#3: Library-In-A-Window

We’ve all used the Library, right? The little window with a bunch of views and code snippets and other handy tools. It’s the most annoying thing when you try to copy and paste something, and then it disappears.

Well, turns out there’s a way to make it an actual window!

Instead of command-shift-l, use command-option-shift-l to get this!


#4: The Minimap

Sometimes, you have a lot of code. It would be really cool if you could get a simple summary of all of it. Well, you can!

Just go to the menu bar, select Editor, then tap Minimap, near the bottom!

#5: Customize Touch Bar

On a Mac with a Touch Bar, you can customize the buttons displayed on it in Xcode.

This is one of the simplest and coolest ones. Just go to View->Customize Touch Bar in the menu bar.




An eleven-year old designer and coder!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Using Audanika with AUM — a workflow.

How to Add Custom Fonts in SwiftUI

Making a Real World Application With SwiftUI

Design a Beautiful Loading Screen for Your iOS App

iPlayground 2020

How to Develop an Image Editing App with Image Kit? — Part 2

An A-to-Z Guide to iOS Activity Indicators

How to Build SimonSez With Notifications, SwiftUI, and Combine — Part 2

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mr. SwiftUI

Mr. SwiftUI

An eleven-year old designer and coder!

More from Medium

Apple Developer Documentation’s Simple, Fundamental Design Flaw

How to create an iOS app without Storyboard

Follow These 5 Rules To Make Amazing Apps

Becoming a Swift Developer (Week 2)