Tag: SwiftData

SwiftData by Example: iOS 17 & SwiftUI 5 — Part 11

The Query macro holds a pivotal position within the SwiftData ecosystem, primarily serving as a cornerstone for data retrieval and processing. While we’ve utilized this macro to access books from the persistence store, our usage has been limited to basic scenarios thus far. Let’s dive de...

SwiftData by Example: iOS 17 & SwiftUI 5 — Part 12

The Query macro simplifies the process of filtering and sorting data within SwiftData, operating directly at the database level. In the earlier stages of the project, we implemented search functionality for the book list view, but it relied on in-memory searching. While this approach is efficient fo...

SwiftData vs CoreData?

SwiftData and Core Data are both object-relational mapping (ORM) frameworks that allow you to store and manage data in your iOS apps. However, there are some key differences between the two frameworks. SwiftData is a newer framework that was introduced in Xcode 14. It is built on top of Core Data...

SwiftData in SwiftUI (Part 1)

Model Container An object that manages an app’s schema and model storage configuration. Model Container is set in WindowGroup. We can pass multiple data models over there. @main struct SwiftData_ExampleApp: App { var body: some Scene { WindowGroup { ...