0

Right now I have created a basic prototype custom keyboard, however, I do not know how to make a shift key that would capitalize the letters. Right now the letters are all lowercase. Also I wrote this in Objective-C not Swift, but a swift based solution is welcome as well! :) Thank you

4

1 回答 1

0

制作一个可以在您使用的任何图像之间切换的键。当键切换到 shift 时,将其存储在布尔属性中。

然后,为每次按键使用此代码:

- (NSString *)stringForAKeyPress:(id)sender {
   if (self.shifted) {
       return @"A";
   } else {
       return @"a";
   }
}
于 2014-08-23T23:09:12.050 回答