Table of Contents
Xcode 14 brings a lot of little big improvements. Here are six of them which I found out.
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.
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.
In Xcode 14, Apple surface this up in the form of code snippet.
You can generate a memberwise initializer by typing
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.
encode should prompt you to generate
Decodable's initializer, and
Encodable's encoder, respectively.
You can also do all of that in one go with action from a context menu.
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.
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".
Xcode 14 will auto re-indent an inner content when you type closing brace.
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
First impressions of SwiftUI in WWDC22
An overview of what's new in SwiftUI.
How to add a TextField to Alert in SwiftUI
iOS 16 add the ability to integrate a text field in an alert.