In function, that perfectly worked in Xcode 6.2, now I have a mistake 'subscript' in unavailable: Indexing a String's UTF16View requires a String.UTF16View.Index, which can be constructed from Int when Foundation is imported
. This is the code:
extension Character {
var keyCode: Int {
return Int(String(self).utf16[0])
}
}
And in this code I get the same mistake:
extension NSEvent {
var character: Int {
return Int(charactersIgnoringModifiers!.utf16[0])
}
}