3 min read

Issue #37

Hi there,
Welcome to the 37th issue ๐Ÿ‘‹

Apologies for sending this issue a day late - I've had a small self-inflicted injury and had to go to the hospital just in case. All is well in the end though ๐Ÿ˜Š

You might have noticed a different sender and layout this time - that's because I've switched from Revue to a content platform called Ghost. It's a really powerful platform, and I will be expanding the site, such as adding the ability to search among all past issues. Stay tuned :)


Structuring SwiftUI views

SwiftUI is relatively new, but there are other declarative UI languages with history. React is a popular web frontend framework, and there's a lot we can learn from there.
One example is a pattern where we break down views that load data into two:
The outer view is a loading component that's aware of the networking, and the inner view is a more "stupid" view with just UI elements.
The inner view then can then be reused - across features, for previews in app settings, and for SwiftUI previews.

Organizing test image assets

Good tip here to avoid cluttering your app with images you only use for testing - saving on both app size and compile time:

Project quality-of-life

Completely agree with the list here. When there's no warnings in the project, the console log isn't cluttered, etc - it's so much easier to spot new issues right when they are introduced:

URLRequest cache policies

Excellent article to understand the various cache policies and how they affect your iOS application when sending HTTP requests with URLRequest:

Understanding different cache policies when working with URLRequest in Swift
Learn how to manage cache when sending HTTP requests in your iOS applications. Learn about the differences between the policies useProtocolCachePolicy, reloadIgnoringLocalCacheData, reloadIgnoringLocalAndRemoteCacheData and more.

Xcode power tips

If you want to become more efficient with Xcode, watch this 17-minute video. I've been using Xcode for over a decade, and I learned so much. The more efficient we are, the more time we have to actually focus on problemsolving and code โ˜บ๏ธ

๐Ÿค˜

๐Ÿ’Ž Sponsor of the week - Codelime

Codelime is a powerful code snippet manager with many dev tools for iOS development. Save and manage your code snippet across iPhone, iPad and Mac with Codelime.

Take advantages of many dev tools available in Codelime (Hash, Text Case, Color Picker, Generate Asset Catalog, Make Pretty Code Snippet, ...) to boost your every day iOS development workflow.

The app is made by indie developers Khoa ๐Ÿ”ฅ and Kenny ๐ŸŒด

Alright, thatโ€™s it for today.

If you enjoyed this issue, you can help grow the newsletter by spreading the word!

Got feedback? Want to see more, or less of certain kinds of tips? Iโ€™d love to hear from you. Reply to this email or reach out on Twitter via @ios_code_review ๐Ÿ™Œ