Posts

Post not yet marked as solved
0 Replies
360 Views
I have a main app window that presents an Immersive style in Mixed Reality. I am trying to determine the anchor/position of this glass window in the 3D space and place a Sphere entity right next to it. The goal is to ensure that if the user moves the window, the Sphere entity remains attached to it. Does anyone have insights on how to achieve this? The below code snippet provides the position of the device, and I have positioned it 0.5 meters away from the z-axis. However, my objective is to obtain the position of the glass window and anchor the sphere to it. Any guidance on achieving this would be appreciated. import RealityKit import RealityKitContent import ARKit struct ImmersiveView: View { let visionProPose = VisionProPose() var body: some View { RealityView { content in Task { await visionProPose.runArSession() } // Add the initial RealityKit content if let scene = try? await Entity(named: "Immersive", in: realityKitContentBundle) { content.add(scene) } } update: { content in if let scene = content.entities.first { if let sphere = scene.findEntity(named: "Sphere") as? ModelEntity { Task { let transfrom = await visionProPose.getTransform() sphere.position = [Float((transfrom?.columns.3.x)!), Float((transfrom?.columns.3.y)!), Float((transfrom?.columns.3.z)!) - 1 ] } } } } } } @Observable class VisionProPose { let session = ARKitSession() let worldTracking = WorldTrackingProvider() func runArSession() async { Task { try? await session.run([worldTracking]) } } func getTransform() async -> simd_float4x4? { guard let deviceAnchor = worldTracking.queryDeviceAnchor(atTimestamp: 1) else { return nil } let transform = deviceAnchor.originFromAnchorTransform return transform } }
Posted Last updated
.
Post marked as solved
1 Replies
565 Views
I would like to apply different textures to the front and back faces of a 3D material. Specifically, when applying a texture that cuts the object in half through opacity, I want to be able to observe the back face of the object and apply a different color to it compared to the front face. In Unity, there is a 'isFrontFace' boolean node that allows for applying different colours to the front and rear faces. However, I am unsure of how to achieve the same effect in Reality Composer Pro! 3D Model is already two-sided.
Posted Last updated
.
Post marked as solved
4 Replies
1.1k Views
When applied .contentMarginsDisabled() modifier to WidgetConfiguration, Widget extension crashes on launch in Xcode 15 Beta 3. struct TestWidget: Widget { let kind: String = "TestWidget" var body: some WidgetConfiguration { return IntentConfiguration(kind: kind, intent: TestIntent.self, provider: TestProvider()) { entry in TestView(entry: entry) } .configurationDisplayName("TestWidget") .description("This is TestWidget.") .supportedFamilies([.systemMedium]) .contentMarginsDisabled() // << Here } } Though it works in Xcode 15 Beta 2. Anyone facing same issue ?
Posted Last updated
.
Post not yet marked as solved
0 Replies
595 Views
I'm encountering an intriguing issue with interactive widgets and the AudioPlaybackIntent on my device. Specifically, my problem arises when the device is set to silent mode. Despite the silence setting, selecting the category .playback continues to play sounds, which is the expected behaviour. However, when I opt for alternative categories like .ambient or .soloAmbient, these widgets cease to produce sound, even when the device is in ringer mode. I would appreciate any insights, solutions, or discussion on this matter within the Apple forum community. // This code snippet allows audio to play in widgets with interactive buttons, even in silent mode. try? AVAudioSession.sharedInstance().setCategory(.playback, mode: .default, options: []) try? AVAudioSession.sharedInstance().setActive(true) // Conversely, this code snippet prevents audio playback in widgets with interactive buttons, even in silent mode. try? AVAudioSession.sharedInstance().setCategory(.ambient, mode: .default, options: []) try? AVAudioSession.sharedInstance().setActive(true) Works as expected on the Simulator, but encounters issues when tested on a physical device using Xcode 15 Beta 8
Posted Last updated
.
Post not yet marked as solved
1 Replies
992 Views
UITextview's Spellchecker seem not to detect spells and show red dots at odd position in MacCatalyst: It does work well in iPhone and iPad though. I've activated the Spellcheck through storyboard, also tested with both Normal and Attributed strings. Even tried disabling the scrolling. But nothing seems to help! Does any one know about this behaviour?
Posted Last updated
.
Post not yet marked as solved
0 Replies
897 Views
When I hover the mouse over the NSTextAttachment image inside the UITextview, it should show this option to MarkUp. All native app including Notes, TextEditor, Mail have this behaviour: I think, by default, NSTextView will show the NSSharingServicePicker button when you hover over an image inside the text view. That’s true even for custom image-based NSTextAttachments in the attributed string. But it is not showing the button for UITextview in MacCatalyst. Also NSSharingService class is limited to MacOS only. Are there any alternative way to achieve this in MacCatalyst?
Posted Last updated
.
Post marked as solved
1 Replies
937 Views
Hi, I've assigned contextual menu to my tableview rows which seems to focus cells background with blue ring in MacCatayst. If tableview style is Plain or Grouped, it focus ring appear as it should but in InsetGrouped type tableview, it seems to be broken. I've tried disabling the focus with : func tableView(_ tableView: UITableView, canFocusRowAt indexPath: IndexPath) -> Bool { return false } And tableView.selectionFollowsFocus = false But no luck disabling it. Anyone has any Idea about this behaviour ?
Posted Last updated
.
Post not yet marked as solved
4 Replies
1.2k Views
I'm trying with the MacCatalyst app which has editor screen with UITextView. Whenever I select some text [Attributed] & try to copy/paste ( using ctrl + c ) to another Mac app ( i.e Notes, Safari) it works well but if I try to paste it to Mail App's Composer, it doesn't work! When selecting some text and copying, it prints this log in debug window: Incorrect NSStringEncoding value 0x8000100 detected. Assuming NSASCIIStringEncoding. Will stop this compatibility mapping behavior in the near future. When converting Attributed string to Data, I'm applying the Encoding options as below: [NSAttributedString.DocumentAttributeKey: Any] = [ .documentType: NSAttributedString.DocumentType.rtfd, .characterEncoding: String.Encoding.utf8 ] Still it doesn't seem to work. Anyone has any idea about this ?
Posted Last updated
.
Post not yet marked as solved
0 Replies
579 Views
Hi, I've made a simple list using UITableview for Mac Catalyst and have set the separator style to default. ( I'm not using Diffable datasource ) The problem is it is showing separators in iPhone and iPad, but not showing in Mac. Does any one has any idea about this behaviour? Is there any way to show for the Mac or do I have to make custom cells with separators ?
Posted Last updated
.
Post not yet marked as solved
1 Replies
960 Views
I'm trying to build a simple Mail Extension using Compose session handler for the Mac Catalyst App. The idea is to open a ComposeViewController on App Icon click from Mail Toolbar ( when the user adds the app extensions for the app from Mail Preference ). I'm using core data in a shared group and I want to show the list of the email address that the user has added from the app to the ComposeViewController. But on the extension window in the Mail, it shows : Permissions for “MyDemoApp”: • Email Contents Can read sensitive information from emails including the message subject and recipients. This applies to all outgoing messages. Since my Compose-Mail-Extension does not read subject/recipients in the Compose window, My app should not ask this permission from users. Is there any way to omit permissions which my app is not using?
Posted Last updated
.