Post

Replies

Boosts

Views

Activity

Modifying SwiftData Object
Hi, The dataModule in code below is a swiftData object being passed to the view and its property as key path but when trying to modify it I'm getting the error ."Cannot assign through subscript: 'self' is immutable" how to solve this issue ? Kind Regards struct ListSel<T: PersistentModel>: View { @Bindable var dataModule: T @Binding var txtValue: String var keyPath: WritableKeyPath<T, String> var turncate: CGFloat? = 94.0 var image = "" var body: some View { HStack { Text(txtValue) .foregroundColor(sysSecondary) .font(.subheadline) .onChange(of: txtValue) { value in dataModule[keyPath: keyPath] = value } Image(systemName: image) .foregroundColor(sysSecondary) .font(.subheadline) .imageScale(.small) .symbolRenderingMode(.hierarchical) .scaleEffect(0.8) } .frame(width: turncate, height: 20, alignment: .leading) .truncationMode(.tail) } }
2
0
499
Nov ’24
SwiftData Master Details
I want to create master details relationship between patient and vitals signs so which of option codes below are better performance wise ? Option one is master - details done manually .. option 1 @Model class TestResult { @Attribute(.primaryKey) var id: UUID var patientID: UUID Option 2 @Model final class Vital { var patient: Patient?
0
0
321
Nov ’24
Customizing Tables in SwiftUI
Hi, How to customize tables in SwiftUI its color background for example, the background modifier doesn't work ? how to change separator lines ? rows background colors ? give header row different colors to its text and background color ? Kind Regards
Topic: UI Frameworks SubTopic: SwiftUI
2
0
526
Nov ’24
Multi Platform App
Hi, Suppose I want to create an School management App that have little complex views so I need a three versions of each view one for Mac and one for iPadOS and one for iOS, cause using platform detector on same view and adjusting layout will make things messy. So what's the best way to achieve that ? Separate project to each platform ? maybe Targets which I still don't understand cause modifying a view in any target will be reflected to other targets so what's the best practice here ? Im working with SwiftUI Kind Regards
Topic: UI Frameworks SubTopic: SwiftUI
2
0
378
Jan ’25
Hiding Xcode Console @ Run Time
Hi, Every time Im developing an App and run it the console appears and stay there even when stopping the App then I need to again close it cause it minimize the canvas, is there any setting to prevent it from automatically showing in every run ? Kind Regards
2
0
277
Jan ’25
Customizing Swipe to Delete Button
Hi, Im trying to customize the button that appear when swiping a for each list for deleting trying to show a red circle and a white trash icon inside it, but instead I get a white empty button ? .swipeActions(edge: .trailing) { Button { deletePatient(patient: patient) } label: { ZStack { Circle() .fill(Color.red) .frame(width: 50, height: 50) Image(systemName: "trash") .foregroundColor(.white) } } .tint(.white) }
Topic: UI Frameworks SubTopic: SwiftUI
3
1
579
Jan ’25
Modifying SwiftData Object
Hi, The dataModule in code below is a swiftData object being passed to the view and its property as key path but when trying to modify it I'm getting the error ."Cannot assign through subscript: 'self' is immutable" how to solve this issue ? Kind Regards struct ListSel<T: PersistentModel>: View { @Bindable var dataModule: T @Binding var txtValue: String var keyPath: WritableKeyPath<T, String> var turncate: CGFloat? = 94.0 var image = "" var body: some View { HStack { Text(txtValue) .foregroundColor(sysSecondary) .font(.subheadline) .onChange(of: txtValue) { value in dataModule[keyPath: keyPath] = value } Image(systemName: image) .foregroundColor(sysSecondary) .font(.subheadline) .imageScale(.small) .symbolRenderingMode(.hierarchical) .scaleEffect(0.8) } .frame(width: turncate, height: 20, alignment: .leading) .truncationMode(.tail) } }
Replies
2
Boosts
0
Views
499
Activity
Nov ’24
SwiftData Master Details
I want to create master details relationship between patient and vitals signs so which of option codes below are better performance wise ? Option one is master - details done manually .. option 1 @Model class TestResult { @Attribute(.primaryKey) var id: UUID var patientID: UUID Option 2 @Model final class Vital { var patient: Patient?
Replies
0
Boosts
0
Views
321
Activity
Nov ’24
Sync SwidtData records between devices and simulators
Hi, Im developing a data centric App using SwiftData, I noticed that the device I use for testing doesn't sync its data with the simulator although both have same Apple Account ? What's Im missing here ? arched is my project settings. Kind Regards
Replies
0
Boosts
0
Views
315
Activity
Nov ’24
Manually Creating Collapsable Areas in Xcode
Hi, Is it possible to manually create collapsable areas in Xcode when it doesn't show automatically , for example variables definition area in views ? Kind Regards
Replies
0
Boosts
0
Views
211
Activity
Nov ’24
Customizing Tables in SwiftUI
Hi, How to customize tables in SwiftUI its color background for example, the background modifier doesn't work ? how to change separator lines ? rows background colors ? give header row different colors to its text and background color ? Kind Regards
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
526
Activity
Nov ’24
Using Old Style at Bottom Tab Bar in SwiftUI with iPadOS
Hi, the new style of tab bar is at top, sort of a picker style , how to enforce SwiftUI to use it in old style fashion at bottom in iPadOS same as iOS ? — Kind Regards
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
254
Activity
Dec ’24
Text Fields Covered By Keyboard. iPadOS App
Hi, I have a form on an iPad App I'm developing and the form have text field at its bottom when tapping on it the keyboard cover those text fields how to solve this issue leave a hug gap at bottom of the form so text field jump to top when keyboard shows ? Kind Regards
Replies
3
Boosts
0
Views
323
Activity
Jan ’25
Multi Platform App
Hi, Suppose I want to create an School management App that have little complex views so I need a three versions of each view one for Mac and one for iPadOS and one for iOS, cause using platform detector on same view and adjusting layout will make things messy. So what's the best way to achieve that ? Separate project to each platform ? maybe Targets which I still don't understand cause modifying a view in any target will be reflected to other targets so what's the best practice here ? Im working with SwiftUI Kind Regards
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
378
Activity
Jan ’25
Hiding Xcode Console @ Run Time
Hi, Every time Im developing an App and run it the console appears and stay there even when stopping the App then I need to again close it cause it minimize the canvas, is there any setting to prevent it from automatically showing in every run ? Kind Regards
Replies
2
Boosts
0
Views
277
Activity
Jan ’25
Disable Landscape For iPhone
Hi, is it possible to prevent App I’m developing from supporting landscape mode on iPhone ? Is there sort of setting in Xcode for that or in code ? — kind Regards
Replies
2
Boosts
0
Views
244
Activity
Jan ’25
App Pricing
Hi, suppose I released an App with subscription price, monthly or annually, can I increase its price anytime ? Or there’s some restrictions ? — Kind Regards
Replies
2
Boosts
0
Views
260
Activity
Jan ’25
Reserving App Name
Hi, how to reserve an App name for an App I’m developing ? — Kind Regards
Replies
5
Boosts
0
Views
426
Activity
Jan ’25
What's The Difference Swift Packages Frameworks ?
Hi, What's the difference Swift Packages Frameworks ? for me I see them the same as not an expert developer ? Which should I use ?for example for a SwiftUI UI Kit to be distributed online for sale ? Kind Regards
Replies
1
Boosts
0
Views
215
Activity
Jan ’25
Disable Multi or Split View for an App in iPadOS
Hi, I see some apps like LinkedIn that doesn't support multi view or split views on iPad, but seems this feature is enabled by default to any new project in Xcode, how to disable it ? Kind Regards
Topic: UI Frameworks SubTopic: General
Replies
0
Boosts
0
Views
237
Activity
Jan ’25
Customizing Swipe to Delete Button
Hi, Im trying to customize the button that appear when swiping a for each list for deleting trying to show a red circle and a white trash icon inside it, but instead I get a white empty button ? .swipeActions(edge: .trailing) { Button { deletePatient(patient: patient) } label: { ZStack { Circle() .fill(Color.red) .frame(width: 50, height: 50) Image(systemName: "trash") .foregroundColor(.white) } } .tint(.white) }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
3
Boosts
1
Views
579
Activity
Jan ’25