I want to get UITextInputMode in Swift 2 but UITextInputMode.activeInputModes()
crashes.
let x = UITextInputMode.activeInputModes() // crash here
for t in x {
print(t)
}
I want to get UITextInputMode in Swift 2 but UITextInputMode.activeInputModes()
crashes.
let x = UITextInputMode.activeInputModes() // crash here
for t in x {
print(t)
}
It is a bug in Xcode 7 as mentioned HERE. Which says:
I was able to work around this bug by using an Objective-C bridge.
Bridge.h
Kludge.h
Kludge.m
From Swift, you can now call Kludge.activeInputModes() and get the correct results.