Post

Replies

Boosts

Views

Activity

Reply to Compiler exception when using Binding and Swift 6
You can still use the binding with getter and setter but not using the short syntax with just the function names : (this could help you if you need to use bindings with getter and setter) VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") Toggle("change it", isOn: Binding(get: { getValue() }, set: { newValue in setValue(newValue) })) } .padding() } private func getValue() -> Bool { isOn } private func setValue(_ value: Bool) { isOn = value }
Topic: Programming Languages SubTopic: Swift Tags:
1w
Reply to How To Position Controls With SwiftUI
Your layout seems quite unusual in the sense that you put a slider in the middle of nothing. There is seems to have no placement constraint other than obsolete positioning. (may be i am wrong) As show by Claude31 , you should define logical subviews (buttons view, tile view, header view, ...) Then you define how are these subviews arrange in line or column. If you need more complex positionning, you may use a large ZStack and set each subviews to a specific place. Or use en overlay to put the slider in the middle of the global view.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to CarPlay Simulator not Working
Another thing to check for CarPlay Simulator is the MacOS Firewall . It is specified in some help that the CarPlay simulator must be enabled in it. By default incoming connections are disabled for all apps. You must add the CarPlay Simulator in the authorised apps.
Topic: App & System Services SubTopic: General Tags:
Apr ’24
Reply to Xcode 15 Beta Stuck on preparing iphone simulator for previews
Did you tried to remove derives data ? You can nor see if XCode is trying to build/start fir preview by Clocking in the circle ⭕️ on top of window : it show the list of process that XCode is doing (indexing, comp for preview, starting simulator…) tou can also try to change the selected output on the preview tab in the bottom when it enable it (sometime you can choose : currently i did not managed to understand when)
Oct ’23