My app crashes when running as Designed for iPad on macOS 12.6

The app uses UIReferenceLibraryViewController. It appears to be related to the crash. It's an iOS SwiftUI application.

The log shows some warnings like:

2022-12-22 14:12:22.844524-0600 hangul-practice[22135:13945548] [default] capability properties: could not find untranslocated node for <FSNode 0x6000008c7140> { isDir = ?, path = '/private/var/folders/dy/xsxx3q394kggnyw6st2p86840000gn/X/69B34322-B92C-55AF-BE13-2C8CEA83BE7B/d/Wrapper/hangul-practice.app' }, proceeding on the assumption it is not translocated: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"

And then, an assertion failure:

2022-12-22 14:12:23.462759-0600 hangul-practice[22135:13944773] *** Assertion failure in void *DictionaryServicesLibrary(void)(), _UIDictionaryManager.m:25
2022-12-22 14:12:23.469960-0600 hangul-practice[22135:13944773] [General] dlopen(/System/Library/PrivateFrameworks/DictionaryServices.framework/DictionaryServices, 0x0001): tried: '/Users/louis1001/Library/Developer/Xcode/DerivedData/hangul-practice-axifqfgooymqougfqjsrjjjpxqyq/Build/Products/Debug-iphoneos/DictionaryServices.framework/DictionaryServices' (no such file), '/Users/louis1001/Library/Developer/Xcode/DerivedData/hangul-practice-axifqfgooymqougfqjsrjjjpxqyq/Build/Products/Debug-iphoneos/PackageFrameworks/DictionaryServices.framework/DictionaryServices' (no such file), '/System/iOSSupport/System/Library/PrivateFrameworks/DictionaryServices.framework/DictionaryServices' (no such file), '/System/Library/PrivateFrameworks/DictionaryServices.framework/DictionaryServices' (no such file), '/System/Library/Frameworks/DictionaryServices.framework/DictionaryServices' (no such file)

dictionaryHasDefinition(forTerm:) is used within the UI to determine if a button should be greyed out or not.

Here is the code for the UI:
https://github.com/louis1001/hangul-practice-ios/blob/main/hangul-practice/Views/Details.swift#L43

And here is the part that handles Dictionary Definitions:
https://github.com/louis1001/hangul-practice-ios/blob/main/hangul-practice/Utils/DictionaryReference.swift

UIReferenceLibraryViewController needs Mac Catalyst 13.1 and higher, but all of its APs are marked as Mac Catalyst 13.0 and higher. Upgrade your macOS 12 to 13.

class func dictionaryHasDefinition(forTerm term: String) -> Bool

My app crashes when running as Designed for iPad on macOS 12.6
 
 
Q