Little big improvements in Xcode 14
Table of Contents
Xcode 14 brings a lot of little big improvements. Here are six of them which I found out.
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.
You can easily support sarunw.com by checking out this sponsor.
AI Grammar: Correct grammar, spell check, check punctuation, and parphrase.
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.
In Xcode 14, Apple surface this up in the form of code snippet.
You can generate a memberwise initializer by typing init
.
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.
You can also do all of that in one go with action from a context menu.
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.
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".
Auto re-indent
Xcode 14 will auto re-indent an inner content when you type closing brace.
You can easily support sarunw.com by checking out this sponsor.
AI Grammar: Correct grammar, spell check, check punctuation, and parphrase.
New SwiftUI boilerplate
///
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 ShareHow to add a TextField to Alert in SwiftUI
iOS 16 add the ability to integrate a text field in an alert.