Tag Archives: Swift, SwiftUI

Swift – How to save a list into UserDefaults

By | 22/06/2022

In this post, we will see how to save a list of objects into UserDefaults. First of all, we create a new Swift project and we add a Struct called Person: [PERSON.SWIFT] Then, we define a Class called People, used to save and load data from UserDefaults: [PEOPLE.SWIFT] Now, we create a SwiftUI View file… Read More: Swift – How to save a list into UserDefaults »

Swift – Class (Part II)

By | 30/03/2022

Swift – Class (Part I) MULTIPLE INITIALIZERS If we run this code, these will be the results: DEINITIALIZERDeinitialization is a process used to deallocate the memory space before a class instance deallocated. The ‘deinit’ keyword is used to deallocate the memory spaces occupied by the system resources. If we run this code, these will be… Read More: Swift – Class (Part II) »

Design Patterns – MVVM in SwiftUI

By | 14/07/2021

In this post, we will see how to implement MVVM pattern in SwiftUI.But, what is MVVM pattern?From wikipedia:“Model–view–viewmodel (MVVM) is a software architectural pattern that facilitates the separation of the development of the graphical user interface (the view) – be it via a markup language or GUI code – from the development of the business logic or back-end logic (the model) so that the view is not dependent on any… Read More: Design Patterns – MVVM in SwiftUI »