Improve Swift binding of InputMethodKit

Number:rdar://39380486 Date Originated:2018/04/12
Status:Open Resolved:
Product:macOS + SDK, Keyboards, mice and trackpads Product Version:
Classification: Reproducible:
Swift binding of InputMethodKit uses many `Any!`. So this binding might cause type error.

Especially following methods require more typed binding:

- (BOOL)handleEvent:(NSEvent*)event client:(id)sender;
  => `sender`  argument is confirmed to some protocols, but its information is missing.

- (void)setMarkedText:(id)string selectionRange:(NSRange)selectionRange replacementRange:(NSRange)replacementRange;
  => When pass nil as first argument, IMK will crash. So it should be forbidden by type system.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!