Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have the following test code:

import Cocoa
import Carbon
let x = kUCKeyActionDisplay

In Xcode 6.2 there is no problem, but in Xcode 6.3 this code throws an error.

The error message is: Use of unresolved identifier 'kUCKeyActionDisplay'.

Why can't I access the UnicodeUtilities namespace?

like image 382
Mandroid Avatar asked Apr 09 '15 07:04

Mandroid


1 Answers

It is no longer available in Swift for some reason, according to the OSX 10.10.3 API documents.

You can however still access them in Objective-C, in the same way (i.e. @import CoreServices;)

I've just written the code that needs them in Objective-C - you could of course create a wrapper.

like image 172
James Alvarez Avatar answered Nov 15 '22 08:11

James Alvarez