Issue #69
Hi there, welcome to the 69th issue of iOS Code Review. Let's dive into this issue's insights and discoveries together ✨
Secure your spot!
Goodbye GeometryReader, hello containerRelativeFrame
From iOS 17 we can use containerRelativeFrame(_:alignment:)
for giving views size calculated from the size of its parent. containerRelativeFrame(_:count:span:spacing:alignment:)
is to be used when multiple views will be visible in the container.
Refer to official documentation for in-depth explanation, or to a video by Flo for a quick overview:


New Content Margins modifier
Another handy iOS 17 addition in SwiftUI is a view modifier called contentMargins
. It allows to inset the content of some of the system views, without getting additional side effects that come from adjusting the safe area:

Computed property or a function
func name() -> String
or var name: String
, func nearestNeighbour() -> String
or var nearestNeighbour: String
? There are conventions in Swift that will help you decide:

Overrated Swift features
In this article you'll read about a few Swift features that seem cool but do more harm than good when overused: implicit initialisers with .init
, subscripts, and more:

✌️
Alright, that's it for today! Let's spread the good code vibes ✨🧘🌈☀️
Thank you to Pragma Conference for sponsoring this issue ❤️
Member discussion