Post

Replies

Boosts

Views

Activity

Reply to One to Many Relationship in SwiftData
I tried the code below, with SiftData models also below, but I got the error .. Value of type Sight has no member destination ! ForEach (destination.sights) { sight in VStack { Text(sight.name) Text(sight.destination.name) } } @Model class Destination { var name: String var details: String var date: Date var priority: Int @Relationship(deleteRule: .cascade) var sights = [Sight]() init(name: String = "", details: String = "", date: Date = .now, priority: Int = 2) { self.name = name self.details = details self.date = date self.priority = priority } } @Model class Sight { var name: String init(name: String) { self.name = name } }
Sep ’24
Reply to Text Don't Show in swipeActions buttons !
Thanks, it's working now, one last question is it possible to use views such as in code below ? maybe for example I want to show to circle buttons ? I remember Apple Mail used this design before ? Kind Regards Button(role: .destructive) { withAnimation { deletePatient2() } } label: { View1() } Button { deletePatient2() } label: { View2() } .tint(.orange) }
Jul ’24
Reply to Hiding chevron from list, SwiftUI
ForEach (patients) { patient in NavigationLink (value: patient) { PatientRow(patient: patient) } } .onDelete(perform: deletePatient) .listRowSeparator(.hidden) } .listStyle(.plain) .buttonStyle(PlainButtonStyle()) .scrollIndicators(.hidden) .navigationDestination(for: Patient.self) { patient in PatientDetails(patient: patient) }
Topic: UI Frameworks SubTopic: SwiftUI
Jun ’24
Reply to One to Many Relationship in SwiftData
I tried the code below, with SiftData models also below, but I got the error .. Value of type Sight has no member destination ! ForEach (destination.sights) { sight in VStack { Text(sight.name) Text(sight.destination.name) } } @Model class Destination { var name: String var details: String var date: Date var priority: Int @Relationship(deleteRule: .cascade) var sights = [Sight]() init(name: String = "", details: String = "", date: Date = .now, priority: Int = 2) { self.name = name self.details = details self.date = date self.priority = priority } } @Model class Sight { var name: String init(name: String) { self.name = name } }
Replies
Boosts
Views
Activity
Sep ’24
Reply to Sorting SwiftData module records based on recent update
Thanks allot, so is there any API or observation method to get notified when some record is changed or that should be done manually as well ? Kind Regards
Replies
Boosts
Views
Activity
Aug ’24
Reply to Text Don't Show in swipeActions buttons !
Thanks, it's working now, one last question is it possible to use views such as in code below ? maybe for example I want to show to circle buttons ? I remember Apple Mail used this design before ? Kind Regards Button(role: .destructive) { withAnimation { deletePatient2() } } label: { View1() } Button { deletePatient2() } label: { View2() } .tint(.orange) }
Replies
Boosts
Views
Activity
Jul ’24
Reply to Hiding chevron from list, SwiftUI
Above the foreach there's a line of code "List {" don't know why Apple editor cut it, the code formatting is very bad by the way.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jun ’24
Reply to Hiding chevron from list, SwiftUI
ForEach (patients) { patient in NavigationLink (value: patient) { PatientRow(patient: patient) } } .onDelete(perform: deletePatient) .listRowSeparator(.hidden) } .listStyle(.plain) .buttonStyle(PlainButtonStyle()) .scrollIndicators(.hidden) .navigationDestination(for: Patient.self) { patient in PatientDetails(patient: patient) }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jun ’24
Reply to Details panel catching show/hide
Thanks allot
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to Plain Segmented Control
Thanks allot, that doesn't work even when choosing white color the default gray background stays
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’24
Reply to Customizing Back Button in Column 2 "Content" in SplitView
Thanks allot
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Adding multi view to NavigationPath in one go
Thanks allot
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Access Control SwiftUI Structs
Thanks allot
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to NavigationSplitView Collapse Button
Hi, I tried the code it works, expect one thing, the default back button shows as well, how can we remove it ? Kindest Regards
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to What's the # symbol in swift documentation
Ok. Thanks allot.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Math Functions in Swift
Thanks allot
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to NavigationSplitView Collapse Button
Aha, thanks allot .
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to What's the # symbol in swift documentation
Thanks allot, but it’s not related to generics definition correct ? Didn’t see any generic definitions using this symbol ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’23