Little big improvements in Xcode 14

⋅ 2 min read ⋅ Xcode WWDC22

Table of Contents

Xcode 14 brings a lot of little big improvements. Here are six of them which I found out.

You can easily support sarunw.com by checking out this sponsor.

Sponsor sarunw.com and reach thousands of iOS developers.

Sticky Scope

I don't know the official name of this feature just yet, so I called it "Sticky Scope".

When you scroll through the code, you might get lost in the context and don't know whether you are in a class, extension, or function scope. Xcode 14, pin the current scope you are in at the top of the editor.

Lovely improvement.

Sticky Scope.
Sticky Scope.

Memberwise initializer snippet

In the previous version of Xcode, Xcode could generate a memberwise initializer for us. But the action is hidden deep down in the context menu.

Old way to generate memberwise initializer.
Old way to generate memberwise initializer.

In Xcode 14, Apple surface this up in the form of code snippet.

You can generate a memberwise initializer by typing init.

New snippet to generate memberwise initializer.
New snippet to generate memberwise initializer.

Add Codable implementation snippets

Making your model conform to Codable contain a lot of boilerplate code.

Luckily, in Xcode 14, we have three snippets to generate Codable-related code.

Typing coding, init, and encode should prompt you to generate CodingKeys, Decodable's initializer, and Encodable's encoder, respectively.

Code snippets for Codable.
Code snippets for Codable.

You can also do all of that in one go with action from a context menu.

Add explicit Codable implementation.
Add explicit Codable implementation.

Single asset for App Icon

I think this is one of the most requested features since the dawn of time. Xcode now requires only a single 1024x1024 image that is automatically resized for its target.

Xcode now requires only a single 1024x1024 image for an app icon.
Xcode now requires only a single 1024x1024 image for an app icon.

Better code completion

Code completion always returns all possible parameters, which is quite annoying when you only want some of them.

Xcode 14 improves this by only inserting parameters that match the search term.

In this example, I add a .frame modifier with the maxWidth parameter by typing "framemaxwi".

Code completion only insert parameter which matches the search term.
Code completion only insert parameter which matches the search term.

You can easily support sarunw.com by checking out this sponsor.

Sponsor sarunw.com and reach thousands of iOS developers.

Auto re-indent

Xcode 14 will auto re-indent an inner content when you type closing brace.

Auto re-indent.
Auto re-indent.

Read more article about Xcode, WWDC22, or see all available topic

Enjoy the read?

If you enjoy this article, you can subscribe to the weekly newsletter.
Every Friday, you'll get a quick recap of all articles and tips posted on this site. No strings attached. Unsubscribe anytime.

Feel free to follow me on Twitter and ask your questions related to this post. Thanks for reading and see you next time.

If you enjoy my writing, please check out my Patreon https://www.patreon.com/sarunw and become my supporter. Sharing the article is also greatly appreciated.

Become a patron Buy me a coffee Tweet Share
Previous
First impressions of SwiftUI in WWDC22

An overview of what's new in SwiftUI.

Next
How to add a TextField to Alert in SwiftUI

iOS 16 add the ability to integrate a text field in an alert.

← Home