【发布时间】:2015-07-01 17:44:53
【问题描述】:
我正在使用自定义 keyboard (iOS App Extension)。 I have a UICollectionView in my Keyboard Layout, so when one item is selected I want to show a message (UIAlerView for example).
这是我的代码:
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
...
UIAlertController * alert= [UIAlertController
alertControllerWithTitle:@"My Title"
message:@"Enter User Credentials"
preferredStyle:UIAlertControllerStyleAlert];
[self presentViewController:alert animated:YES completion:nil];
}
我收到此错误:'Feature not available in extensions of type com.apple.keyboard-service'
那么...有没有办法从App Extension 显示message?
编辑:
这是一个例子。 IKEA Emoticons Keyboard 显示一条消息(如选择一个项目后的 Android Toast)。
我也试过这个库:
【问题讨论】:
标签: ios ios-app-extension uialertcontroller custom-keyboard