Post

Replies

Boosts

Views

Activity

Reply to VideoPlayer crashes on Archive build
As a follow up, three further points: I tried this on someone else’s machine. Same issue. So it’s not a config issue with my Xcode / machine. Secondly, one doesn’t need to go thru the archive step, just run the executable produced for the Xcode run. Issue not seen if a debug build is used.
Topic: Media Technologies SubTopic: Video Tags:
Dec ’25
Reply to Alert within Popover is clipped in height causing title to be hidden
I am also still getting this issue demonstrated here: struct PopUpIssue: View { @State private var showPopup = false var body: some View { Text("Tap Me") .onTapGesture { showPopup = true } .popover(isPresented: $showPopup) { popupContent .presentationCompactAdaptation(.popover) } } var popupContent: some View { Text("Here is description that will go on for a very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long part of the screen") .fixedSize(horizontal: false, vertical: true) } } #Preview { PopUpIssue() }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’25
Reply to SwiftUI Picker layout under MacOS26
The solution is to use buttonSizing(.flexible) as follows: Picker(selection: $selectedFruit) { ForEach(fruits, id: \.self, content: Text.init) } label: { Text("Fruity choice") .frame(width: 150, alignment: .trailing) } .frame(width: 300) .buttonSizing(.flexible)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to GCControllerDidConnect notification not received in VisionOS 2.0
Hello, I've tested this and am still unable to get it to work, with the following focused test: import GameController import SwiftUI struct ContentView: View { @State private var gamepadNotification: NSObjectProtocol? = nil @State private var keyboardNotification: NSObjectProtocol? = nil @FocusState var focused var body: some View { VStack { Text("Hello, world!") } .focused($focused, equals: true) .handlesGameControllerEvents(matching: .gamepad) .task { try? await Task.sleep(for: .seconds(1)) focused = true print("Setting up notification for controller connections") gamepadNotification = NotificationCenter.default.addObserver( forName: NSNotification.Name.GCControllerDidConnect, object: nil, queue: nil) { note in print("Handling GCControllerDidConnect notification RV") } keyboardNotification = NotificationCenter.default.addObserver( forName: NSNotification.Name.GCKeyboardDidConnect, object: nil, queue: nil) { note in print("Handling GCKeyboardDidConnect notification RV") } GCController.startWirelessControllerDiscovery{} } } } I have set up the following in info.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationPreferredDefaultSceneSessionRole</key> <string>UIWindowSceneSessionRoleApplication</string> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict/> </dict> <key>GCSupportsControllerUserInteraction</key> <true/> <key>GCSupportedGameControllers</key> <array> <dict> <key>ProfileName</key> <string>MicroGamepad</string> </dict> <dict> <key>ProfileName</key> <string>ExtendedGamepad</string> </dict> <dict> <key>ProfileName</key> <string>DirectionalGamepad</string> </dict> </array> </dict> </plist> On vision OS 2.1 I am seeing the following on the console: Setting up notification for controller connections Handling GCKeyboardDidConnect notification RV i.e. I can setup the keyboard connection handler, but not the gamepad connection handler ———————————————————————————————————————— On vision OS 2.2 I am seeing the following on the console: Setting up notification for controller connections i.e. now the keyboard connection notification is not working. Even though I am not able to setup either a keyboard nor gamepad connection event handler I am however able to control the simulator with the controller. i.e. the controller is connected and can pan and move the simulator with the controllers joysticks. ———————————————————————————————————————— Here’s the version numbers of the dev tools: Simulator: Version 16.0 (1038), SimulatorKit 942, CoreSimulator 993.7 XCode: Version 16.2 (16C5031c) visionOS on simulator: visionOS 2.2 (22N840)
Topic: Graphics & Games SubTopic: RealityKit Tags:
Dec ’24
Reply to VisionOS Continuously Rotate a 3D Object
I think the full solution would require this to be wrapped in a TimelineView to work? Something such as: TimelineView(.periodic(from: .now, by: 1)) { context in VStack { Model3D(named: "quantumComputer") { phase in switch phase { case .empty: ProgressView() case let .failure(error): Text(error.localizedDescription) case let .success(model): model .resizable() .scaledToFit() .offset(x: -100, y: 0) .rotation3DEffect( Rotation3D(angle: Angle2D(degrees: 1 * context.date.timeIntervalSinceReferenceDate), axis: .y ) ) /// Other code in here } }
Topic: Spatial Computing SubTopic: General Tags:
Nov ’24
Reply to Creating and applying a shader to change an entity's rendering in RealityKit
Thank you for your reply. I've replicated these steps and have the effect working as described. Could I ask a clarification though... This approach requires each model to have its shader graph updated in Reality Composer Pro to give it this capability. I understand that I could create a re-usable node graph if I wanted to have a more complex effect (the colouring was just a simple effect for sake of the question) - yet still each entity would need updating in Reality Composer Pro to wire it in. Thus, just to be sure, there is no way to create a shader that can be applied to any model entity. I see RealityKit provides CustomMaterial, which can be setup with a shader, but this is not available in VisionOS at present? CustomMaterial
Oct ’24
Reply to VideoPlayer crashes on Archive build
As a follow up, three further points: I tried this on someone else’s machine. Same issue. So it’s not a config issue with my Xcode / machine. Secondly, one doesn’t need to go thru the archive step, just run the executable produced for the Xcode run. Issue not seen if a debug build is used.
Topic: Media Technologies SubTopic: Video Tags:
Replies
Boosts
Views
Activity
Dec ’25
Reply to SwiftUI TextField selection - strange initial values with iOS
I've logged this issue: FB20851540
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to Alert within Popover is clipped in height causing title to be hidden
I am also still getting this issue demonstrated here: struct PopUpIssue: View { @State private var showPopup = false var body: some View { Text("Tap Me") .onTapGesture { showPopup = true } .popover(isPresented: $showPopup) { popupContent .presentationCompactAdaptation(.popover) } } var popupContent: some View { Text("Here is description that will go on for a very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long part of the screen") .fixedSize(horizontal: false, vertical: true) } } #Preview { PopUpIssue() }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to SwiftUI Picker layout under MacOS26
The solution is to use buttonSizing(.flexible) as follows: Picker(selection: $selectedFruit) { ForEach(fruits, id: \.self, content: Text.init) } label: { Text("Fruity choice") .frame(width: 150, alignment: .trailing) } .frame(width: 300) .buttonSizing(.flexible)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’25
Reply to RealityKit convexCast causing a crash
Solved! In another part of the code I was updating a physics body property of a model entity, which must have been corrupting the physics / scene.
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Jun ’25
Reply to visionOS 2.4b4 SDK Missing / Cannot Be Downloaded
Ah - yes it's now downloaded....I can get back to coding. Good luck to all you AVP devs on this thread . . . I actually do love programming for this device. I hope Apple is in this for the long haul ;-)
Replies
Boosts
Views
Activity
Mar ’25
Reply to visionOS 2.4b4 SDK Missing / Cannot Be Downloaded
The status now reports that it is downloading visionOS 2.4, but nothing is happening, or showing in the components tab of Xcode's setting window.
Replies
Boosts
Views
Activity
Mar ’25
Reply to visionOS 2.4b4 SDK Missing / Cannot Be Downloaded
I'm also seeing this too
Replies
Boosts
Views
Activity
Mar ’25
Reply to RealityKit particleEmitter delay starting when toggling isEmitting
OK - I've figured it out. The EmissionDuration needs to be set low - I had it at 10 seconds, which means I could be waiting between 0...10 for it to start.
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to EntityAction for MaterialBaseTint - incorrect colours
I have worked out that you need to take the channel values from the underlying cgColor to make this work: extension UIColor { var float4: Float4 { if cgColor.numberOfComponents == 4, let c = cgColor.components { Float4(Float(c[0]), Float(c[1]), Float(c[2]), Float(c[3])) } else { Float4() } } }
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to GCControllerDidConnect notification not received in VisionOS 2.0
Hello, I've tested this and am still unable to get it to work, with the following focused test: import GameController import SwiftUI struct ContentView: View { @State private var gamepadNotification: NSObjectProtocol? = nil @State private var keyboardNotification: NSObjectProtocol? = nil @FocusState var focused var body: some View { VStack { Text("Hello, world!") } .focused($focused, equals: true) .handlesGameControllerEvents(matching: .gamepad) .task { try? await Task.sleep(for: .seconds(1)) focused = true print("Setting up notification for controller connections") gamepadNotification = NotificationCenter.default.addObserver( forName: NSNotification.Name.GCControllerDidConnect, object: nil, queue: nil) { note in print("Handling GCControllerDidConnect notification RV") } keyboardNotification = NotificationCenter.default.addObserver( forName: NSNotification.Name.GCKeyboardDidConnect, object: nil, queue: nil) { note in print("Handling GCKeyboardDidConnect notification RV") } GCController.startWirelessControllerDiscovery{} } } } I have set up the following in info.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationPreferredDefaultSceneSessionRole</key> <string>UIWindowSceneSessionRoleApplication</string> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict/> </dict> <key>GCSupportsControllerUserInteraction</key> <true/> <key>GCSupportedGameControllers</key> <array> <dict> <key>ProfileName</key> <string>MicroGamepad</string> </dict> <dict> <key>ProfileName</key> <string>ExtendedGamepad</string> </dict> <dict> <key>ProfileName</key> <string>DirectionalGamepad</string> </dict> </array> </dict> </plist> On vision OS 2.1 I am seeing the following on the console: Setting up notification for controller connections Handling GCKeyboardDidConnect notification RV i.e. I can setup the keyboard connection handler, but not the gamepad connection handler ———————————————————————————————————————— On vision OS 2.2 I am seeing the following on the console: Setting up notification for controller connections i.e. now the keyboard connection notification is not working. Even though I am not able to setup either a keyboard nor gamepad connection event handler I am however able to control the simulator with the controller. i.e. the controller is connected and can pan and move the simulator with the controllers joysticks. ———————————————————————————————————————— Here’s the version numbers of the dev tools: Simulator: Version 16.0 (1038), SimulatorKit 942, CoreSimulator 993.7 XCode: Version 16.2 (16C5031c) visionOS on simulator: visionOS 2.2 (22N840)
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to UITest not launching the simulator on Xcode 15
I am running into the same issue now with Xcode 16.1 and MacOS 15.2
Replies
Boosts
Views
Activity
Nov ’24
Reply to VisionOS Continuously Rotate a 3D Object
I think the full solution would require this to be wrapped in a TimelineView to work? Something such as: TimelineView(.periodic(from: .now, by: 1)) { context in VStack { Model3D(named: "quantumComputer") { phase in switch phase { case .empty: ProgressView() case let .failure(error): Text(error.localizedDescription) case let .success(model): model .resizable() .scaledToFit() .offset(x: -100, y: 0) .rotation3DEffect( Rotation3D(angle: Angle2D(degrees: 1 * context.date.timeIntervalSinceReferenceDate), axis: .y ) ) /// Other code in here } }
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Creating and applying a shader to change an entity's rendering in RealityKit
Thank you for your reply. I've replicated these steps and have the effect working as described. Could I ask a clarification though... This approach requires each model to have its shader graph updated in Reality Composer Pro to give it this capability. I understand that I could create a re-usable node graph if I wanted to have a more complex effect (the colouring was just a simple effect for sake of the question) - yet still each entity would need updating in Reality Composer Pro to wire it in. Thus, just to be sure, there is no way to create a shader that can be applied to any model entity. I see RealityKit provides CustomMaterial, which can be setup with a shader, but this is not available in VisionOS at present? CustomMaterial
Replies
Boosts
Views
Activity
Oct ’24
Reply to SwiftUI ScrollView performance in macOS 15
I am seeing exactly the same. I have a 'LazyVStack' enclosed in a 'ScrollView', in which I can be displaying thousands of elements. Definite slow down. I've pulled my code apart and still can't get an improvement.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Oct ’24