How to save time with Xcode snippets

Photo by Alexandar Todov on Unsplash

Original Post

Do you feel that you are sometimes needed to create the same parts of code? Code snippets can easily help you.

For example, we need to create a Singleton class.

1. Create a code that you want to reuse.

2. Highlight Singleton code and press Editor -> Create Code Snippet.

3. Name it and write a completion shortcut.

You can easily add <# and #> from the start and end of any part of code, and it will create a placeholder part of the snippet. And that’s it. We are ready to use our shortcut. You can just type singleton_code.

--

--

--

iOS Software Developer

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

Recommended from Medium

QuickShortcutMaker Mod Apk 2.4.0 Latest Version 2022

Static vs Dynamic Dispatch in Swift: A decisive choice

Fonts made easy in iOS — Swift

Your first iOS Application Using Xcode

Building a SwiftUI app using MVVM architecture —Part 1: Building the UI

How to Structure Your Folders in Xcode

How to Create a Simple Frame Filter in Spark AR Studio for Facebook and Instagram

Create a UITableViewCell Programmatically

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
Almost Engineer

Almost Engineer

iOS Software Developer

More from Medium

Dynamic table view footer with animations.

Converting an App to use Swift Package Manager

Supporting Accessibility in your iOS app

Getting your code crashed inside a Swift loop