Post

Replies

Boosts

Views

Activity

Reply to Xcode does not see Apple Vision Pro headset
Resolved! In case someone else runs ints this problem, or I do in the future and find this post, here is what I did: In Apple Vision Pro, I selected Settings > General > Remote Devices The pane said it was available for pairing. In Xcode, I selected the "No eligible devices" in the destination pop-up (down?) menu. In the "Devices and Simulators" windows, my Apple Vision Pro shows up. Then I could select it and pair with it (a challenge code popped up in the Vision Pro).
Feb ’25
Reply to Scene's origin relative to portal's window?
I discovered part of my confusion. An entity (e.g., green cylinder) that is front of the portal is still visible as long as the portal's clipping plane isn't activated. In screenshots below, initially Red cylinder is at Z = 0; Blue cylinder is at Z = -0.3 Green cylinder is at Z = 0.3 (in front of the portal plane). Despite the green cylinder being in front of the window/portal plane, it is initially still visible as long as it is positioned between the camera and the portal window. When I activate the clipping plane, the green cylinder disappears, and the red cylinder gets cut in half. To have the green cylinder appear beyond the frame of the portal, (1) the portal has to have the PortalComponent's crossingMode set to .plane(.positiveZ) and (2) the green cylinder needs to have a PortalCrossingComponent. I am still stuck on the fact that when I move the green cylinder's Z position to +0.5, it still gets clipped. Still have lots to learn... Example screenshots: Green cylinder Z at 0.3, it appears in front of the portal but rendering is still bound by the portal. Portal's clipping plane is enabled. Green cylinder is gone, and red cylinder is cut in half, verifying clipping plane is at Z = 0. Portal's PortalComponent crossingMode = .plane(.positiveZ) and PortalCrossingComponent added to green cylinder. When green cylinder is pushed out to Z = 0.5, part of it is still clipped. Is there a limit for how far things can come out of the portal?
Topic: Spatial Computing SubTopic: General Tags:
Mar ’25
Reply to Safari-like toolbar in visionOS
BTW, I can put a toolbar at the bottom of the window, but it isn't separated a fixed distance from the window like Safari's is. From my reading of Apple's HIG on toolbars, this is the proper place to put toolbar items in visionOS. Should I go with this design (which looks like Apple HIG's preferred design) as opposed to following Safari's design? struct ContentView: View { var body: some View { Text("This is some text") .toolbar { // .bottomOrnament only placement that works ToolbarItemGroup(placement: .bottomOrnament) { Button("Hello") { print("World") } Button("Goodbye") { print("cruel world") } } } } }
Topic: Spatial Computing SubTopic: General Tags:
Oct ’25
Reply to archive single file to .aar file in Swift
The following code is working for me. Hopefully, Apple has a better example posted somewhere and someone will post it here. It is based on Apple's string compression code with some code at the end to write the source file as a sequence of blobs to the encodeStream. func compressFile(at sourceURL: URL, to destURL: URL, deleteSource: Bool = true) async throws { let sourceLastComponent = sourceURL.lastPathComponent let destPath = FilePath(destURL.path) guard let sourceFileSize = getFileSize(url: sourceURL) else { return } // writeFileStream guard let writeFileStream = ArchiveByteStream.fileStream( path: destPath, mode: .writeOnly, options: [.create], permissions: FilePermissions(rawValue: 0o644) ) else { return } defer { try? writeFileStream.close() } // compressStream guard let compressStream = ArchiveByteStream.compressionStream( using: .lzfse, writingTo: writeFileStream ) else { return } defer { try? compressStream.close() } // encodeStream guard let encodeStream = ArchiveStream.encodeStream(writingTo: compressStream) else { return } defer { try? encodeStream.close() } // Create header and send it to the encodeStream let header = ArchiveHeader() header.append(.string(key: ArchiveHeader.FieldKey("PAT"), value: sourceLastComponent)) header.append(.uint(key: ArchiveHeader.FieldKey("TYP"), value: UInt64(ArchiveHeader.EntryType.regularFile.rawValue))) header.append(.blob(key: ArchiveHeader.FieldKey("DAT"), size: UInt64(sourceFileSize))) do { try encodeStream.writeHeader(header) } catch { print("Failed to write header.") return } // Open source file, reading in chunks up to 64000 bytes and writing // them as blobs to the encodeStream let fileHandle = try FileHandle(forReadingFrom: sourceURL) defer { try? fileHandle.close() } let chunkSize = 64000 while true { guard let data = try fileHandle.read(upToCount: chunkSize) else { break } if data.isEmpty { break } try data.withUnsafeBytes { rawBufferPointer in try encodeStream.writeBlob(key: ArchiveHeader.FieldKey("DAT"), from: rawBufferPointer) } } try fileHandle.close() if deleteSource { do { try FileManager.default.removeItem(at: sourceURL) } catch { print("ERROR: Could not remove source file at \(sourceURL.path)") } } } func getFileSize(url: URL) -> Int64? { do { let resourceValues = try url.resourceValues(forKeys: [.fileSizeKey]) return Int64(resourceValues.fileSize ?? 0) } catch { print("Error getting file size: \(error.localizedDescription)") return nil } }
Topic: App & System Services SubTopic: Core OS Tags:
3w
Reply to XCode 13.5 not downloadable
I was having the same problem earlier today, but it just started downloading now.
Replies
Boosts
Views
Activity
Aug ’21
Reply to Xcode does not see Apple Vision Pro headset
Resolved! In case someone else runs ints this problem, or I do in the future and find this post, here is what I did: In Apple Vision Pro, I selected Settings > General > Remote Devices The pane said it was available for pairing. In Xcode, I selected the "No eligible devices" in the destination pop-up (down?) menu. In the "Devices and Simulators" windows, my Apple Vision Pro shows up. Then I could select it and pair with it (a challenge code popped up in the Vision Pro).
Replies
Boosts
Views
Activity
Feb ’25
Reply to Scene's origin relative to portal's window?
I discovered part of my confusion. An entity (e.g., green cylinder) that is front of the portal is still visible as long as the portal's clipping plane isn't activated. In screenshots below, initially Red cylinder is at Z = 0; Blue cylinder is at Z = -0.3 Green cylinder is at Z = 0.3 (in front of the portal plane). Despite the green cylinder being in front of the window/portal plane, it is initially still visible as long as it is positioned between the camera and the portal window. When I activate the clipping plane, the green cylinder disappears, and the red cylinder gets cut in half. To have the green cylinder appear beyond the frame of the portal, (1) the portal has to have the PortalComponent's crossingMode set to .plane(.positiveZ) and (2) the green cylinder needs to have a PortalCrossingComponent. I am still stuck on the fact that when I move the green cylinder's Z position to +0.5, it still gets clipped. Still have lots to learn... Example screenshots: Green cylinder Z at 0.3, it appears in front of the portal but rendering is still bound by the portal. Portal's clipping plane is enabled. Green cylinder is gone, and red cylinder is cut in half, verifying clipping plane is at Z = 0. Portal's PortalComponent crossingMode = .plane(.positiveZ) and PortalCrossingComponent added to green cylinder. When green cylinder is pushed out to Z = 0.5, part of it is still clipped. Is there a limit for how far things can come out of the portal?
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to spatial-backdrop feature available yet?
If someone runs across this same problem, it does work in the headset in the visionOS 26 beta. The error was me clicking on the "spatial browsing" button on the right and not the button on the left.
Replies
Boosts
Views
Activity
Aug ’25
Reply to App Groups names are red
Adding another App Groups image showing the grayed out group I do not remember adding. Clicking on the (i) in the developer provisioning profile also says there are 3 groups.
Replies
Boosts
Views
Activity
Sep ’25
Reply to Safari-like toolbar in visionOS
BTW, I can put a toolbar at the bottom of the window, but it isn't separated a fixed distance from the window like Safari's is. From my reading of Apple's HIG on toolbars, this is the proper place to put toolbar items in visionOS. Should I go with this design (which looks like Apple HIG's preferred design) as opposed to following Safari's design? struct ContentView: View { var body: some View { Text("This is some text") .toolbar { // .bottomOrnament only placement that works ToolbarItemGroup(placement: .bottomOrnament) { Button("Hello") { print("World") } Button("Goodbye") { print("cruel world") } } } } }
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to FYI: Network System extension, macOS update issue, loss of networking
UPDATE: the TestFlight build had expired. I have a second Mac, and before updating, I checked the application with the network system extension. The TestFlight build had expired. When I updated to macOS 26.2, networking was dead. (Again, deleting the app resolved the problem).
Replies
Boosts
Views
Activity
Dec ’25
Reply to archive single file to .aar file in Swift
The following code is working for me. Hopefully, Apple has a better example posted somewhere and someone will post it here. It is based on Apple's string compression code with some code at the end to write the source file as a sequence of blobs to the encodeStream. func compressFile(at sourceURL: URL, to destURL: URL, deleteSource: Bool = true) async throws { let sourceLastComponent = sourceURL.lastPathComponent let destPath = FilePath(destURL.path) guard let sourceFileSize = getFileSize(url: sourceURL) else { return } // writeFileStream guard let writeFileStream = ArchiveByteStream.fileStream( path: destPath, mode: .writeOnly, options: [.create], permissions: FilePermissions(rawValue: 0o644) ) else { return } defer { try? writeFileStream.close() } // compressStream guard let compressStream = ArchiveByteStream.compressionStream( using: .lzfse, writingTo: writeFileStream ) else { return } defer { try? compressStream.close() } // encodeStream guard let encodeStream = ArchiveStream.encodeStream(writingTo: compressStream) else { return } defer { try? encodeStream.close() } // Create header and send it to the encodeStream let header = ArchiveHeader() header.append(.string(key: ArchiveHeader.FieldKey("PAT"), value: sourceLastComponent)) header.append(.uint(key: ArchiveHeader.FieldKey("TYP"), value: UInt64(ArchiveHeader.EntryType.regularFile.rawValue))) header.append(.blob(key: ArchiveHeader.FieldKey("DAT"), size: UInt64(sourceFileSize))) do { try encodeStream.writeHeader(header) } catch { print("Failed to write header.") return } // Open source file, reading in chunks up to 64000 bytes and writing // them as blobs to the encodeStream let fileHandle = try FileHandle(forReadingFrom: sourceURL) defer { try? fileHandle.close() } let chunkSize = 64000 while true { guard let data = try fileHandle.read(upToCount: chunkSize) else { break } if data.isEmpty { break } try data.withUnsafeBytes { rawBufferPointer in try encodeStream.writeBlob(key: ArchiveHeader.FieldKey("DAT"), from: rawBufferPointer) } } try fileHandle.close() if deleteSource { do { try FileManager.default.removeItem(at: sourceURL) } catch { print("ERROR: Could not remove source file at \(sourceURL.path)") } } } func getFileSize(url: URL) -> Int64? { do { let resourceValues = try url.resourceValues(forKeys: [.fileSizeKey]) return Int64(resourceValues.fileSize ?? 0) } catch { print("Error getting file size: \(error.localizedDescription)") return nil } }
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
3w