-
List
A fundamental element of mobile applications is the list. If you think about it, almost every app includes some form of a list. Declaring a list is very simple: To have: In this way, we have a scrollable list with fixed elements. However, we can also create the list dynamically using a data set: To…
-
AnyLayout
Sometimes it can be beneficial to change the layout depending on the device’s portrait or landscape orientation. To do this, we can use AnyLayout, which allows us to make the choice at runtime. Let’s look at the code: The Environment is a property wrapper that reads values from a view’s environment. In this case, we…
-
State And Binding
Two fundamental concepts in SwiftUI are State and Binding. Following the official documentation, we can say:• State is a property wrapper type that can read and write a value managed by SwiftUI.• Binding is a property wrapper type that can read and write a value owned by another view. Let’s explain with an example. Imagine…