Xcode 6.3 and Swift: Unicode utilities (e.g. UCKeyTranslate) not available?

I have the following test code:

import Cocoa import Carbon let x = kUCKeyActionDisplay 

There is no problem with Xcode 6.2, but with Xcode 6.3 this code causes an error.

Error message: Use of unresolved identifier 'kUCKeyActionDisplay' .

Why can't I access the UnicodeUtilities namespace?

+5
source share
1 answer

For some reason, it is no longer available in Swift, according to the OSX 10.10.3 API docs .

However, you can still access them in Objective-C (i.e. @import CoreServices; )

I just wrote the code they need in Objective-C - you could, of course, create a wrapper.

0
source

Source: https://habr.com/ru/post/1210232/


All Articles