IFang Lee2 min

Swiftly Highlights: Swift Playgrounds 4 & Writing Better Swift Code

EngineeringJan 4, 2022

Engineering

/

Jan 4, 2022

IFang LeeiOS Engineer

Share this article

Happy New Year! Despite global data trends showing that the pandemic isn't over yet, many apps have been helping us through it, keeping us updated and letting the world keep turning.

As an update to the App Store Awards 2021, Apple has added a new Trend of the Year category. Apple identified "Connection" as the top Trend of 2021 and honored five apps and games that brought us together and had a lasting impact on our lives. Among Us, Bumble and Canva were among them.

Congratulations to the 2021 App of the Year winners and their developers on providing these incredible experiences.

Swift Playgrounds 4

The long-awaited Swift Playgrounds 4 was announced earlier this year at Apple’s WWDC and it was officially released in mid-December! This is a milestone release for Swift Playgrounds, as it includes building SwiftUI and UIKit apps right on your iPad, fantastic code completion, comprehensive integration for Swift Package Manager, live App Preview and other cool features.

Swift Playgrounds 4 aims to make life easier for new iPhone and iPad developers by letting them create real apps, ship them directly to the App Store Connect and share them with the world right from their iPad. Swift Playground 4 is available on iPadOS (requires iPadOS 15.2 or later) and macOS.

Can’t wait to get your hands dirty by writing some code in Swift Playgrounds 4? There is an excellent tutorial for you to start with: How to Build Your First SwiftUI App With Swift Playgrounds.

Write Better Swift Code

Is becoming a better iOS developer one of your New Year's Resolutions? If yes, Swift Algorithms undoubtedly helps you to write faster, simpler and safer Swift code. Swift Algorithms is Apple’s open-source package extending the capabilities of sequences and collections — along with their related types — to improve our daily code. You can read more about Swift Algorithms on Apple's website.

Plus, Paul Hudson has written a fantastic article about Writing Better Code With Swift Algorithms. Swift Algorithms will help us overcome our fears of algorithms, embrace them and improve the correctness and performance of our code.  

Would you like to gain some iOS development skills? Rony Fadel shared 30 Tips to Make You a Better iOS Developer, including avoiding code repetition, building UI with SwiftUI faster, improving UIGraphicsImageRenderer performance and so on. Let’s hop into it and make the New Year's resolution come true!

What's More

We can learn about new time-saving enhancements to the localization process introduced in Xcode 13 and iOS 15 from SwiftUI Localization Tutorial for iOS: Getting Started. The Practice of Inclusive Design from WWDC 2021 revealed other ways to make our apps welcoming to people from different cultures.

Have you faced the Mysterious Logout Issues on iOS 15? Liam Nichols shared how to narrow down the case. Also, he found out that the issue is related to the pre-warming behavior in iOS 15 and later.

Last but not least, you might have come across the term Reflection in Swift; it lets us use the Mirror API to inspect and manipulate arbitrary values at runtime. You can hop into it by trying practical examples of using the Mirror API in Reflection in Swift: How Mirror Works.

There will be some fascinating things and exciting news coming in 2022. Stay tuned!

Thank you for reading, and have a great 2022!

Share this article