Post

Replies

Boosts

Views

Activity

Reply to Swift Cpp/c++ interop: swift functions with c++ enums arguments not available in c++
Using swift enums in C++ isn't an issue, and it indeed does that weird'ish naming for the cases. What bothers me is that the Swift functions that I define that take a C++ enum or enum class just don't get interop at all. If the function is a global function, I get the // Unavailable in C++: Swift global function 'swiftFunctionWithCppEnum(_:)'. comment in the generate header. What's worse is that if the function is member for a Swift class, it just gets ommitted entirely without any indication that it is not compatible. It just doesn't show up at all in the generate Swift header. Upon further reading the C++ interop documentation I came across this: If I understand it correctly, this indicates that it actually should work? But it clearly doesn't.
Mar ’24
Reply to SFSpeechRecognizer.isAvailable returns wrong values
Further experimentation yields the following findings. When the iOS device is set to English (US), both SFSpeechRecognizer.isAvailable and .supportsOnDeviceRecognition return true. If we then set the SFSpeechAudioBufferRecognitionRequest’s requiresOnDeviceRecognition to true, we observe the stated issue where speechrecognition tasks fail with “Siri and Dictation are disabled” errors, while according to the SFSpeechRecognizer, it should work.
Oct ’23
Reply to Touch layout not matching UI layout on iPhone after waking device when .sheet is open
@Apple Any feedback on this? Can we expect a fix on this or do I need to implement a workaround for this in our upcoming release? Btw, this is my current workaround. You can add this to any View you show within the sheet, popover, etc... and when it gets dismissed, it will 'reset' the layout. public func body(content: Content) -> some View { content .onDisappear { let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene if let viewFrame = scene?.windows.first?.rootViewController?.view.frame { scene?.windows.first?.rootViewController?.view.frame = .zero scene?.windows.first?.rootViewController?.view.frame = viewFrame } } } } public extension View { func syncLayoutOnDissappear() -> some View { modifier(SyncLayoutOnDissappear()) } }
Feb ’23