Post

Replies

Boosts

Views

Activity

AVFoundation CaptureDevice and Mac virtual cameras
Hello, on Mac OS, is it possible to see a virtual Camera, such as OBS (https://obsproject.com) as a CaptureDevice? I see that, for example, Google Chrome can use this camera, but using AVCaptureDevice.DiscoverySession I am unable to see it. Am I doing wrong?     var deviceTypes: [AVCaptureDevice.DeviceType] = [.builtInMicrophone, .builtInWideAngleCamera]     #if os(OSX)     deviceTypes.append(.externalUnknown)     #else     deviceTypes.append(contentsOf: [.builtInDualCamera, .builtInDualWideCamera, .builtInTelephotoCamera, .builtInTripleCamera, .builtInTrueDepthCamera, .builtInUltraWideCamera])     #endif     let discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: deviceTypes,         mediaType: nil, position: .unspecified)     result = discoverySession.devices.map { device in         device.localizedName     }
1
0
1.7k
Nov ’21
Request times out with iCloud Private Relay: Why?
We have our own backend, running on our own server. When iCloud Private Relay is enabled, the requests to the server time out. How can we find out what precisely is failing? TLS 1.3 is enabled on the backend finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x281b0a3d0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <CBAE9DA5-9988-4E55-A732-B759842E411F>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(     "LocalDataTask <CBAE9DA5-9988-4E55-A732-B759842E411F>.<1>" ), NSLocalizedDescription=The request timed out.,
2
0
1.3k
Nov ’21
CBService changed: How handle this in iOS 14 and 15?
Building my app with Xcode 13, a dependency threw an error related to the changes in CoreBluetooth: Some properties are now returned as optionals in iOS 15. Wanting to fix that, I would like to make sure that the library will run on both iOS 15 and SDKs prior to that, but the current availability markers will not help me:     func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) {         let peripheral: CBPeripheral         // So what I would like is something like this         // But this does not work :(         if  #available(iOS 15, *) {             guard let nonOptional = service.peripheral else {                 return             }             peripheral = nonOptional         } else {             peripheral = service.peripheral         }         let result: CBPeripheral = peripheral         print ("\(result)")     }``` This code will cause the compiler to throw an error both on Xcode 13 and Xcode 12. Is there any good way to solve this?
1
0
2.6k
Jun ’21
SwiftUI: Show Modal Dialog from … anywhere?
Context: Authorized Network requests. I have a process (a publisher, to be precise), which will give me a fresh access token for a request. To do that, I may need user interaction, i.e. show a View, Alert, or something like that. How can I do that in SwiftUI? Can I just (modally) display something, without explicitly being in a View body? Should I have to pass in a "superview" to do this, or do you have other ideas? Thanks Alex
0
0
1.4k
Mar ’21