Post

Replies

Boosts

Views

Activity

SwiftData erors in Swift Playground
Hi, I want to add a SwiftData model to my Swift Playground in Xcode 15.2, but I get errors related to iOS version, has anyone encountered this? Thanks import Foundation import SwiftData struct testStruct: Identifiable { let id = UUID() var question: String var answer: String } @Model class testClass: Identifiable { let id = UUID() var question1: testStruct var question2: testStruct var question3: testStruct var question4: testStruct var question5: testStruct init(question1: testStruct, question2: testStruct, question3: testStruct, question4: testStruct, question5: testStruct) { self.question1 = question1 self.question2 = question2 self.question3 = question3 self.question4 = question4 self.question5 = question5 } }
1
0
843
Feb ’24