Use typed unretained cast for input source ID
This commit is contained in:
parent
b6c5e3fe9e
commit
a0d2bca45d
1 changed files with 1 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ class KeyboardLayout {
|
|||
static var id: String? {
|
||||
if let source = TISCopyCurrentKeyboardInputSource()?.takeRetainedValue(),
|
||||
let sourceIdPointer = TISGetInputSourceProperty(source, kTISPropertyInputSourceID) {
|
||||
let sourceId = unsafeBitCast(sourceIdPointer, to: CFString.self)
|
||||
let sourceId = Unmanaged<CFString>.fromOpaque(sourceIdPointer).takeUnretainedValue()
|
||||
return sourceId as String
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue