Screenshot 2023-06-06 at 9 52 24 PM

Apple just unveiled SwiftData, the all new framework for Apple Platforms, at WWDC 2023!

Here’s an iOS note taking application built to demonstrate various operations and persistance of data in SwiftData and SwiftUI!

Working of the Application

I’ve tried to demonstrate CRUD operations using this app:

Creating a new note and Reading it:

Updating an existing note:

Deleting an existing note:

Model of a Note:

class Note {
    var title: String
    var content: String

    init(title: String, content: String) {
        self.title = title
        self.content = content

Setting up this model as a model container in the SDNotesApp.swift file so as to extract context out of it in our views and controllers:

```swift #8 import SwiftUI

@main struct SDNotesApp: App { var body: some Scene { WindowGroup { ContentView() .modelContainer(for: [Note.self]) } } }


SwiftData docs:



PS: The Icon

I generated this super cool icon for this app in less than 10 seconds, oh boy, DALL-E is so good!