Abstract: The relentless evolution of iOS development has aligned seamlessly with the contemporary shift toward declarative programming paradigms. In response, Apple has introduced frameworks such as SwiftUI and SwiftData— advancing persistence management through a declarative syntax.This thesis delves into the integration of SwiftData, a persistent framework, within SwiftUI applications. By leveraging Swift’s native types for data modeling, SwiftData elegantly dissolves the boundary between code and data definition. The adoption process unfolds across five key phases: constructing data models, incorporating SwiftData and annotating model classes, defining relationships and property attributes, configuring the model container, and, finally, interacting with the model context object to manipulate stored data.The practical application of this process is illustrated through three demonstrative projects. A book management application exemplifies one-to-one relationships and fundamental SwiftData implementation. A messaging platform explores one-to-many relationships, while a learning diary system navigates many-to-many associations, culminating in a comprehensive exploration of the framework’s capabilities. Furthermore, the thesis examines core persistence operations— CRUD (Create, Read, Update, Delete)—alongside essential functionalities such as filtering, sorting, searching, and migration strategies.Despite its seamless integration with SwiftUI and conveniences like automatic lightweight migrations and custom migration support, SwiftData remains a nascent technology. Its current constraints include exclusivity to iOS 17 and a comparatively limited API relative to Core Data. Nonetheless, its trajectory signals considerable promise as it continues to mature.Ultimately, this thesis underscores the importance of a meticulous evaluation of SwiftData’s suitability based on the specific demands of a given application before committing to its adoption. Future research directions include a comparative analysis between SwiftData and Core Data, as well as an investigation into SwiftData’s potential within networked environments for real-world implementations. These inquiries will further solidify SwiftData’s role as a formidable tool in the development of persistence-enabled SwiftUI applications.
Loading