Post

Replies

Boosts

Views

Activity

Reply to How to use AXBrailleMapRenderer in SwiftUI to improve UX for braille users
Hello, thanks for the help. I read those documentation pages too but I couldn't understand how to implement the solution. I will show my code with the errors and I hope you will can help me better. I am developing a video capture app for MacOS using SwiftUI. Here is my custom view to show the preview from the camera. Take a look to the function setupBraille(). When I try to compile the project XCode gives me these errors: Value of type 'CameraPreviewLayout' has no member 'accessibilityBrailleMapRenderer' Unable to infer type of a closure parameter 'map' in the current context Here is my code: import SwiftUI import AVFoundation import Accessibility struct CameraView: NSViewRepresentable { let captureSession: AVCaptureSession init(captureSession: AVCaptureSession) { self.captureSession = captureSession } func makeNSView(context: Context) -> CameraPreviewLayout { return CameraPreviewLayout(captureSession: captureSession) } func updateNSView(_ nsView: CameraPreviewLayout, context: Context) { } } class CameraPreviewLayout: NSView, AXBrailleMapRenderer { var previewLayer: AVCaptureVideoPreviewLayer? required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } init(captureSession: AVCaptureSession) { previewLayer = AVCaptureVideoPreviewLayer(session: captureSession) super.init(frame: .zero) setupLayer() setupBraille() } func setupLayer() { previewLayer?.frame = self.frame previewLayer?.contentsGravity = .resizeAspectFill previewLayer?.videoGravity = .resizeAspectFill previewLayer?.connection?.automaticallyAdjustsVideoMirroring = false previewLayer?.connection?.isVideoMirrored = true layer = previewLayer } func setupBraille() { self.accessibilityBrailleMapRenderer = { map in // code to manage the braille display } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’23
Reply to No screenshot files in XCResult files using Xcode 16.1
Nice, thanks! It works great!
Replies
Boosts
Views
Activity
Apr ’25
Reply to No screenshot files in XCResult files using Xcode 16.1
Hello again, I could check the reports in Xcode using a shared eye (I am blind) and in the test reports the screenshots are available and I can export them but they are not present in the xcresult bundles and I cannot use automatic tools to create my screenshots for the AppStore :-( Can anyone help me? Thanks
Replies
Boosts
Views
Activity
Nov ’24
Reply to How to use AXBrailleMapRenderer in SwiftUI to improve UX for braille users
Hello, thanks for the help. I read those documentation pages too but I couldn't understand how to implement the solution. I will show my code with the errors and I hope you will can help me better. I am developing a video capture app for MacOS using SwiftUI. Here is my custom view to show the preview from the camera. Take a look to the function setupBraille(). When I try to compile the project XCode gives me these errors: Value of type 'CameraPreviewLayout' has no member 'accessibilityBrailleMapRenderer' Unable to infer type of a closure parameter 'map' in the current context Here is my code: import SwiftUI import AVFoundation import Accessibility struct CameraView: NSViewRepresentable { let captureSession: AVCaptureSession init(captureSession: AVCaptureSession) { self.captureSession = captureSession } func makeNSView(context: Context) -> CameraPreviewLayout { return CameraPreviewLayout(captureSession: captureSession) } func updateNSView(_ nsView: CameraPreviewLayout, context: Context) { } } class CameraPreviewLayout: NSView, AXBrailleMapRenderer { var previewLayer: AVCaptureVideoPreviewLayer? required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } init(captureSession: AVCaptureSession) { previewLayer = AVCaptureVideoPreviewLayer(session: captureSession) super.init(frame: .zero) setupLayer() setupBraille() } func setupLayer() { previewLayer?.frame = self.frame previewLayer?.contentsGravity = .resizeAspectFill previewLayer?.videoGravity = .resizeAspectFill previewLayer?.connection?.automaticallyAdjustsVideoMirroring = false previewLayer?.connection?.isVideoMirrored = true layer = previewLayer } func setupBraille() { self.accessibilityBrailleMapRenderer = { map in // code to manage the braille display } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’23