During development in SwiftUI, it is an often question to arise - how to size each element on the screen? The Problem There are basically two choices: keep the dimensions of the element within itselfset the dimensions during initialisation of the element Here's an example of how two approaches look like separately: Hardcoded Size struct … Continue reading SwiftUI Weekly Observations #2
Category: SwiftUI
SwiftUI Weekly Observations #1
Easy Testing Whenever I am creating a new View, I always create a data model struct that I'd use to instantiate that View. I mark it with @State attribute and the View becomes stateful, meaning that whenever the data model changes, View will get updated by the underlying system. struct ScreenModel { var title : … Continue reading SwiftUI Weekly Observations #1