要运行示例项目,请克隆整个仓库,然后在 Example 目录中首先运行 `pod install`。
@interface PHMViewController ()<PHMKeyboardViewDelegate>
@end
@implementation PHMViewController
- (void)viewDidLoad {
[super viewDidLoad];
PHMKeyboardView *keyboard = [PHMKeyboardView keyboardWithDelegate:self];
[self.view addSubview:keyboard];
keyboard.frame = CGRectMake(0, 40, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height/2-40);
//自定义Style
PHMKeyboardView *keyboardT = [PHMKeyboardView keyboardWithDelegate:self styleClass:[PHMCustomStyle class]] ;
[self.view addSubview:keyboardT];
keyboardT.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height/2);
}
#pragma mark PHMKeyboardViewDelegate
- (void)keyboardView:(PHMKeyboardView *)view
button:(UIButton *)button
text:(NSString *)text {
NSLog(@"%@",text);
}
@end
PHMKeyboard 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中。
pod "PHMKeyboard"
Get busy Masoning
'#import "PHMKeyboard.h"'
PHM, [email protected]
PHMKeyboard 按 MIT 许可证提供。有关更多信息,请参阅 LICENSE 文件。