I have a view with @Bindable property. (It's a model)
I can use TextField("Name", text: $chore.name), but not Picker(selection: $chore.choreFrequency, label: EmptyView())
The auto-complete doesn't even show choreFrequency as an option
enum ChoreFrequency: String, CaseIterable, Identifiable, Codable {
case daily, weekly, monthly, seasonal
var id: ChoreFrequency { self }
}
@Model
class Chore: Identifiable {
@Attribute(.unique) var id = UUID()
var name: String
var frequency: ChoreFrequency
var assignedTo: FamilyMember
var isComplete: Bool
var dueDate: Date
}
Can I not use the Bindable property in the Picker?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
The Encoder and Decoder protocols have this property: var codingPath: [CodingKey] { get }
In my own custom coding class, how do I override this and pass valid CodingKeys? Every document and code example uses the enum to define coding keys.
Thanks.
I want to add SwiftUI to an existing package. Super simple to get started. It previews with Xcode 15.4, but gives an error on Xcode 16.0: JITError: Runtime linking failure
Anyone have an idea on what may be failing?
Full SwiftUI code:
import SwiftUI
struct Dashboard: View {
var body: some View {
Text("hello")
}
}
#Preview {
Dashboard()
}
I have a normal UIKit project with a package dependency containing some SwiftUI. Opening the package on its own, I can preview the SwiftUI. However, when I have the package as a dependency, I get the dreaded message saying Active scheme does not build this file regardless of choosing the app or package scheme.
Why can't I get a preview?
Using Xcode 16
I have a project with a single asset image. In the dependency package, I am attempting to preview using the image in the project using Bundle.main. I just get a blank.
How can I get this to work?
Sample project here: https://github.com/AaronBratcher/SwiftUIPreviewProblem