├── QHKeyboard ├── Assets.xcassets │ ├── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── images.bundle │ ├── keypadBtn.png │ ├── keypadLongBtn.png │ ├── keypadDeleteBtn.png │ ├── keypadDeleteBtn2.png │ ├── trasition_normal.png │ ├── keypadBtnHighLighted.png │ └── trasition_highlighted.png ├── QHKeyboard.h ├── ViewController.h ├── AppDelegate.h ├── main.m ├── QHKeyboardNumPad.h ├── QHKeyboardWordPad.h ├── QHKeyboardBtn.h ├── QHKeyboardBtn.m ├── Info.plist ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard ├── ViewController.m ├── AppDelegate.m ├── QHKeyboard.m ├── QHKeyboardNumPad.m └── QHKeyboardWordPad.m ├── README.md └── QHKeyboard.xcodeproj ├── project.xcworkspace └── contents.xcworkspacedata ├── xcuserdata └── wangqinghua.xcuserdatad │ └── xcschemes │ ├── xcschememanagement.plist │ └── QHKeyboard.xcscheme └── project.pbxproj /QHKeyboard/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QHKeyboard 2 | iOS自定义键盘 3 | 如果项目中有特定的输入需求,例如 银行类、金融类、交易类App,对输入的安全性要求较高 4 | 因此需要通过自定义键盘进行操作,可以提高用户的安全性。 5 | -------------------------------------------------------------------------------- /QHKeyboard/images.bundle/keypadBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yadottoday/QHKeyboard/HEAD/QHKeyboard/images.bundle/keypadBtn.png -------------------------------------------------------------------------------- /QHKeyboard/images.bundle/keypadLongBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yadottoday/QHKeyboard/HEAD/QHKeyboard/images.bundle/keypadLongBtn.png -------------------------------------------------------------------------------- /QHKeyboard/images.bundle/keypadDeleteBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yadottoday/QHKeyboard/HEAD/QHKeyboard/images.bundle/keypadDeleteBtn.png -------------------------------------------------------------------------------- /QHKeyboard/images.bundle/keypadDeleteBtn2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yadottoday/QHKeyboard/HEAD/QHKeyboard/images.bundle/keypadDeleteBtn2.png -------------------------------------------------------------------------------- /QHKeyboard/images.bundle/trasition_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yadottoday/QHKeyboard/HEAD/QHKeyboard/images.bundle/trasition_normal.png -------------------------------------------------------------------------------- /QHKeyboard/images.bundle/keypadBtnHighLighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yadottoday/QHKeyboard/HEAD/QHKeyboard/images.bundle/keypadBtnHighLighted.png -------------------------------------------------------------------------------- /QHKeyboard/images.bundle/trasition_highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yadottoday/QHKeyboard/HEAD/QHKeyboard/images.bundle/trasition_highlighted.png -------------------------------------------------------------------------------- /QHKeyboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /QHKeyboard/QHKeyboard.h: -------------------------------------------------------------------------------- 1 | // 2 | // QHKeyboard.h 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QHKeyboard : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /QHKeyboard/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /QHKeyboard/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /QHKeyboard/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /QHKeyboard/QHKeyboardNumPad.h: -------------------------------------------------------------------------------- 1 | // 2 | // QHKeyboardNumPad.h 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "QHKeyboardBtn.h" 11 | 12 | @protocol QHKeyboardNumPadDelegate 13 | 14 | @required 15 | - (void)KeyboardNumPadDidClickSwitchBtn:(UIButton *)btn; 16 | 17 | @end 18 | 19 | @interface QHKeyboardNumPad : UIView 20 | 21 | @property (nonatomic, assign) id delegate; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /QHKeyboard/QHKeyboardWordPad.h: -------------------------------------------------------------------------------- 1 | // 2 | // QHKeyboardWordPad.h 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "QHKeyboardBtn.h" 11 | 12 | @protocol QHKeyboardWordPadDelegate 13 | 14 | @required 15 | - (void)KeyboardWordPadDidClickSwitchBtn:(UIButton *)btn; 16 | 17 | @end 18 | 19 | @interface QHKeyboardWordPad : UIView 20 | 21 | @property (nonatomic, assign) id delegate; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /QHKeyboard/QHKeyboardBtn.h: -------------------------------------------------------------------------------- 1 | // 2 | // QHKeyboardBtn.h 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define margin 5 12 | 13 | @class QHKeyboardBtn; 14 | @protocol QHKeyboardBtnDelegate 15 | 16 | @required 17 | - (void)KeyboardBtnDidClick:(QHKeyboardBtn *)btn; 18 | 19 | @end 20 | 21 | @interface QHKeyboardBtn : UIButton 22 | 23 | + (QHKeyboardBtn *)buttonWithTitle:(NSString *)title tag:(NSInteger)tag delegate:(id)delegate; 24 | 25 | @property (nonatomic, assign) id delegate; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /QHKeyboard.xcodeproj/xcuserdata/wangqinghua.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | QHKeyboard.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | C672FBE11DE6D7A300CED407 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /QHKeyboard/QHKeyboardBtn.m: -------------------------------------------------------------------------------- 1 | // 2 | // QHKeyboardBtn.m 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import "QHKeyboardBtn.h" 10 | 11 | @implementation QHKeyboardBtn 12 | 13 | + (QHKeyboardBtn *)buttonWithTitle:(NSString *)title tag:(NSInteger)tag delegate:(id)delegate 14 | { 15 | QHKeyboardBtn *btn = [QHKeyboardBtn buttonWithType:UIButtonTypeCustom]; 16 | btn.tag = tag; 17 | [btn setTitle:title forState:UIControlStateNormal]; 18 | [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 19 | [btn addTarget:btn action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside]; 20 | btn.titleLabel.font = [UIFont boldSystemFontOfSize:18]; 21 | [btn setBackgroundImage:[UIImage imageNamed:@"images.bundle/keypadBtn"] forState:UIControlStateNormal]; 22 | [btn setBackgroundImage:[UIImage imageNamed:@"images.bundle/keypadBtnHighLighted"] forState:UIControlStateHighlighted]; 23 | btn.layer.cornerRadius = 5; 24 | btn.layer.masksToBounds = YES; 25 | btn.delegate = delegate; 26 | 27 | return btn; 28 | } 29 | 30 | - (void)btnClick:(QHKeyboardBtn *)btn { 31 | 32 | if ([self.delegate respondsToSelector:@selector(KeyboardBtnDidClick:)]) { 33 | [self.delegate KeyboardBtnDidClick:btn]; 34 | } 35 | } 36 | 37 | - (void)layoutSubviews { 38 | 39 | [super layoutSubviews]; 40 | self.titleLabel.frame = self.bounds; 41 | self.titleLabel.textAlignment = NSTextAlignmentCenter; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /QHKeyboard/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /QHKeyboard/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /QHKeyboard/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /QHKeyboard/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /QHKeyboard/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "QHKeyboard.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (nonatomic, strong) UITextField *testTF; 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (UITextField *)testTF { 21 | 22 | if (!_testTF) { 23 | _testTF = [[UITextField alloc] init]; 24 | } 25 | return _testTF; 26 | } 27 | 28 | - (void)viewDidLoad { 29 | [super viewDidLoad]; 30 | 31 | UILabel *titleLabel = [[UILabel alloc] init]; 32 | titleLabel.frame = CGRectMake(70, 100, [UIScreen mainScreen].bounds.size.width - 140, 30); 33 | titleLabel.textAlignment = NSTextAlignmentCenter; 34 | titleLabel.font = [UIFont systemFontOfSize:25]; 35 | titleLabel.textColor = [UIColor redColor]; 36 | titleLabel.text = @"自定义键盘"; 37 | [self.view addSubview:titleLabel]; 38 | 39 | self.view.backgroundColor = [UIColor cyanColor]; 40 | 41 | UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(70, 150, [UIScreen mainScreen].bounds.size.width - 140, 40)]; 42 | [textField setTintColor:[UIColor redColor]]; 43 | textField.borderStyle = UITextBorderStyleRoundedRect; 44 | textField.clearButtonMode = UITextFieldViewModeWhileEditing; 45 | textField.placeholder = @"这是一个输入框"; 46 | self.testTF = textField; 47 | [self.view addSubview:textField]; 48 | textField.inputView = [[QHKeyboard alloc] init]; 49 | } 50 | 51 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 52 | 53 | [super touchesBegan: touches withEvent:event]; 54 | [self.testTF resignFirstResponder]; 55 | } 56 | 57 | - (void)didReceiveMemoryWarning { 58 | [super didReceiveMemoryWarning]; 59 | // Dispose of any resources that can be recreated. 60 | } 61 | 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /QHKeyboard/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /QHKeyboard/QHKeyboard.m: -------------------------------------------------------------------------------- 1 | // 2 | // QHKeyboard.m 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import "QHKeyboard.h" 10 | #import "QHKeyboardNumPad.h" 11 | #import "QHKeyboardWordPad.h" 12 | 13 | #define iPhone4 ([[UIScreen mainScreen] bounds].size.height==480) 14 | #define iPhone5 ([[UIScreen mainScreen] bounds].size.height==568) 15 | #define iPhone6 ([[UIScreen mainScreen] bounds].size.height==667) 16 | #define iPhone6plus ([[UIScreen mainScreen] bounds].size.height==736) 17 | 18 | 19 | @interface QHKeyboard () 20 | 21 | @property (nonatomic, weak) QHKeyboardNumPad *numPad; 22 | @property (nonatomic, weak) QHKeyboardWordPad *wordPad; 23 | 24 | @end 25 | 26 | @implementation QHKeyboard 27 | 28 | - (instancetype)init { 29 | 30 | self = [super init]; 31 | if (self) { 32 | self.backgroundColor = [UIColor colorWithRed:116/255.0 green:144/255.0 blue:194/255.0 alpha:0.2]; 33 | CGRect rect = CGRectZero; 34 | if (iPhone4 || iPhone5) { 35 | // rect = CGRectMake(0, 0, 320, 180); 36 | rect = CGRectMake(0, 0, 320, 216); 37 | }else if (iPhone6){ 38 | // rect = CGRectMake(0, 0, 375, 375/320*180); 39 | rect = CGRectMake(0, 0, 375, 216); 40 | }else{ 41 | // rect = CGRectMake(0, 0, 414, 414/320*180); 42 | rect = CGRectMake(0, 0, 414, 226); 43 | } 44 | 45 | self.frame = rect; 46 | QHKeyboardNumPad *numPad = [[QHKeyboardNumPad alloc] initWithFrame:rect]; 47 | numPad.delegate = self; 48 | self.numPad = numPad; 49 | [self addSubview:numPad]; 50 | } 51 | return self; 52 | } 53 | 54 | - (void)KeyboardNumPadDidClickSwitchBtn:(UIButton *)btn { 55 | 56 | if ([btn.titleLabel.text isEqualToString:@"ABC"]) { 57 | QHKeyboardWordPad *wordPad = [[QHKeyboardWordPad alloc] initWithFrame:self.bounds]; 58 | wordPad.delegate = self; 59 | [self addSubview:wordPad]; 60 | self.wordPad = wordPad; 61 | [self.numPad removeFromSuperview]; 62 | } 63 | } 64 | 65 | - (void)KeyboardWordPadDidClickSwitchBtn:(UIButton *)btn { 66 | 67 | if ([btn.titleLabel.text isEqualToString:@"123"]) { 68 | 69 | QHKeyboardNumPad *numPad = [[QHKeyboardNumPad alloc] initWithFrame:self.bounds]; 70 | numPad.delegate = self; 71 | [self addSubview:numPad]; 72 | self.numPad = numPad; 73 | [self.wordPad removeFromSuperview]; 74 | } 75 | } 76 | 77 | - (void)KeyboardSymbolPadDidClickSwitchBtn:(UIButton *)btn { 78 | 79 | if ([btn.titleLabel.text isEqualToString:@"123"]) { 80 | 81 | QHKeyboardNumPad *numPad = [[QHKeyboardNumPad alloc] initWithFrame:self.bounds]; 82 | numPad.delegate = self; 83 | [self addSubview:numPad]; 84 | self.numPad = numPad; 85 | 86 | } else { 87 | 88 | QHKeyboardWordPad *wordPad = [[QHKeyboardWordPad alloc] initWithFrame:self.bounds]; 89 | wordPad.delegate = self; 90 | [self addSubview:wordPad]; 91 | self.wordPad = wordPad; 92 | } 93 | } 94 | 95 | 96 | @end 97 | 98 | -------------------------------------------------------------------------------- /QHKeyboard.xcodeproj/xcuserdata/wangqinghua.xcuserdatad/xcschemes/QHKeyboard.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /QHKeyboard/QHKeyboardNumPad.m: -------------------------------------------------------------------------------- 1 | // 2 | // QHKeyboardNumPad.m 3 | // QHKeyboard 4 | // 5 | // Created by 王庆华 on 16/11/24. 6 | // Copyright © 2016年 王庆华. All rights reserved. 7 | // 8 | 9 | #import "QHKeyboardNumPad.h" 10 | 11 | @interface QHKeyboardNumPad () 12 | 13 | @property (nonatomic, strong) NSMutableArray *btnArray; 14 | @property (nonatomic, weak) UITextField *responder; 15 | 16 | @end 17 | 18 | @implementation QHKeyboardNumPad 19 | 20 | - (UITextField *)responder{ 21 | // if (!_responder) { // 防止多个输入框采用同一个inputview 22 | UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow]; 23 | UIView *firstResponder = [keyWindow valueForKey:@"firstResponder"]; 24 | _responder = (UITextField *)firstResponder; 25 | // } 26 | return _responder; 27 | } 28 | 29 | - (instancetype)initWithFrame:(CGRect)frame{ 30 | 31 | self = [super initWithFrame:frame]; 32 | if (self) { 33 | self.backgroundColor = [UIColor clearColor]; 34 | [self addControl]; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)addControl { 40 | 41 | NSMutableArray *btnArray = [NSMutableArray array]; 42 | QHKeyboardBtn *btn1 = [QHKeyboardBtn buttonWithTitle:@"1" tag:0 delegate:self]; 43 | [self addSubview:btn1]; 44 | 45 | QHKeyboardBtn *btn2 = [QHKeyboardBtn buttonWithTitle:@"2" tag:1 delegate:self]; 46 | [self addSubview:btn2]; 47 | 48 | QHKeyboardBtn *btn3 = [QHKeyboardBtn buttonWithTitle:@"3" tag:2 delegate:self]; 49 | [self addSubview:btn3]; 50 | 51 | QHKeyboardBtn *btn4 = [QHKeyboardBtn buttonWithTitle:@"4" tag:4 delegate:self]; 52 | [self addSubview:btn4]; 53 | 54 | QHKeyboardBtn *btn5 = [QHKeyboardBtn buttonWithTitle:@"5" tag:5 delegate:self]; 55 | [self addSubview:btn5]; 56 | 57 | QHKeyboardBtn *btn6 = [QHKeyboardBtn buttonWithTitle:@"6" tag:6 delegate:self]; 58 | [self addSubview:btn6]; 59 | 60 | QHKeyboardBtn *btn7 = [QHKeyboardBtn buttonWithTitle:@"7" tag:8 delegate:self]; 61 | [self addSubview:btn7]; 62 | 63 | QHKeyboardBtn *btn8 = [QHKeyboardBtn buttonWithTitle:@"8" tag:9 delegate:self]; 64 | [self addSubview:btn8]; 65 | 66 | QHKeyboardBtn *btn9 = [QHKeyboardBtn buttonWithTitle:@"9" tag:10 delegate:self]; 67 | [self addSubview:btn9]; 68 | 69 | QHKeyboardBtn *btn0 = [QHKeyboardBtn buttonWithTitle:@"0" tag:13 delegate:self]; 70 | [self addSubview:btn0]; 71 | 72 | QHKeyboardBtn *btnAT = [QHKeyboardBtn buttonWithTitle:@"" tag:12 delegate:self]; 73 | [self addSubview:btnAT]; 74 | 75 | QHKeyboardBtn *pointBtn = [QHKeyboardBtn buttonWithTitle:@"." tag:14 delegate:self]; 76 | [self addSubview:pointBtn]; 77 | 78 | UIButton *wordSwitchBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 79 | wordSwitchBtn.tag = 12; 80 | [wordSwitchBtn addTarget:self action:@selector(switchBtnClick:) forControlEvents:UIControlEventTouchUpInside]; 81 | [wordSwitchBtn setTitle:@"ABC" forState:UIControlStateNormal]; 82 | wordSwitchBtn.titleLabel.font = [UIFont boldSystemFontOfSize:18]; 83 | [wordSwitchBtn setBackgroundImage:[UIImage imageNamed:@"images.bundle/keypadLongBtn"] forState:UIControlStateNormal]; 84 | [self addSubview:wordSwitchBtn]; 85 | 86 | UIButton *symbolSwitchBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 87 | [symbolSwitchBtn setBackgroundImage:[UIImage imageNamed:@"images.bundle/keypadLongBtn"] forState:UIControlStateNormal]; 88 | [symbolSwitchBtn setTitle:@"" forState:UIControlStateNormal]; 89 | [symbolSwitchBtn addTarget:self action:@selector(switchBtnClick:) forControlEvents:UIControlEventTouchUpInside]; 90 | symbolSwitchBtn.titleLabel.font = wordSwitchBtn.titleLabel.font; 91 | symbolSwitchBtn.tag = 7; 92 | [self addSubview:symbolSwitchBtn]; 93 | 94 | UIButton *deleteBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 95 | [deleteBtn setImage:[UIImage imageNamed:@"images.bundle/keypadDeleteBtn"] forState:UIControlStateNormal]; 96 | [self addSubview:deleteBtn]; 97 | deleteBtn.tag = 7; 98 | 99 | UIButton *okBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 100 | [okBtn setTitle:@"完成" forState:UIControlStateNormal]; 101 | [okBtn addTarget:self action:@selector(okBtnClick) forControlEvents:UIControlEventTouchUpInside]; 102 | [self addSubview:okBtn]; 103 | 104 | [okBtn setBackgroundImage:[self createImageWithColor:[UIColor colorWithRed:11/255.0 green:98/255.0 blue:224/255.0 alpha:1]] forState:UIControlStateNormal]; 105 | [okBtn setBackgroundImage:[self createImageWithColor:[UIColor colorWithRed:11/255.0 green:98/255.0 blue:224/255.0 alpha:1]] forState:UIControlStateHighlighted]; 106 | okBtn.tag = 15; 107 | 108 | [wordSwitchBtn addTarget:self action:@selector(switchBtnClick:) forControlEvents:UIControlEventTouchUpInside]; 109 | [symbolSwitchBtn addTarget:self action:@selector(switchBtnClick:) forControlEvents:UIControlEventTouchUpInside]; 110 | [deleteBtn addTarget:self action:@selector(deleteBtnClick) forControlEvents:UIControlEventTouchUpInside]; 111 | [okBtn addTarget:self action:@selector(okBtnClick) forControlEvents:UIControlEventTouchUpInside]; 112 | 113 | 114 | self.btnArray = btnArray; 115 | [self.btnArray addObject:btn1]; 116 | [self.btnArray addObject:btn2]; 117 | [self.btnArray addObject:btn3]; 118 | [self.btnArray addObject:btn4]; 119 | [self.btnArray addObject:btn5]; 120 | [self.btnArray addObject:btn6]; 121 | [self.btnArray addObject:btn7]; 122 | [self.btnArray addObject:btn8]; 123 | [self.btnArray addObject:btn9]; 124 | [self.btnArray addObject:btn0]; 125 | [self.btnArray addObject:btnAT]; 126 | [self.btnArray addObject:pointBtn]; 127 | [self.btnArray addObject:deleteBtn]; 128 | [self.btnArray addObject:symbolSwitchBtn]; 129 | [self.btnArray addObject:wordSwitchBtn]; 130 | [self.btnArray addObject:okBtn]; 131 | 132 | for (int i = 11; i<16; i++) { 133 | 134 | UIButton *btn = self.btnArray[i]; 135 | btn.layer.cornerRadius = 5; 136 | btn.layer.masksToBounds = YES; 137 | } 138 | } 139 | 140 | - (void)layoutSubviews { 141 | 142 | [super layoutSubviews]; 143 | CGFloat btnW = (self.frame.size.width - 5*margin)/4; 144 | CGFloat btnH = (self.frame.size.height - 5*margin)/4; 145 | 146 | for (QHKeyboardBtn *btn in self.btnArray) { 147 | if (btn.tag == 7) { 148 | 149 | // 删除键 150 | btn.frame = CGRectMake(margin + 3 % 4 * (btnW + margin), margin, btnW, btnH*2 + margin); 151 | } else if (btn.tag == 15) { 152 | // 确定键 153 | btn.frame = CGRectMake(margin + 11 % 4 * (btnW + margin), margin + 11 / 4 * (btnH + margin), btnW, btnH*2 + margin); 154 | } else { 155 | btn.frame = CGRectMake(margin + btn.tag % 4 * (btnW + margin), margin + btn.tag / 4 * (btnH + margin), btnW, btnH); 156 | } 157 | } 158 | } 159 | 160 | - (void)switchBtnClick:(UIButton *)btn { 161 | 162 | if ([self.delegate respondsToSelector:@selector(KeyboardNumPadDidClickSwitchBtn:)]) { 163 | [self.delegate KeyboardNumPadDidClickSwitchBtn:btn]; 164 | } 165 | } 166 | 167 | - (void)deleteBtnClick { 168 | 169 | if (self.responder.text.length) { 170 | self.responder.text = [self.responder.text substringToIndex:self.responder.text.length-1]; 171 | } 172 | } 173 | 174 | - (void)okBtnClick{ 175 | [[UIApplication sharedApplication].keyWindow endEditing:YES]; 176 | } 177 | 178 | #pragma mark - QHKeyboardBtnDelegate 179 | -(void)KeyboardBtnDidClick:(QHKeyboardBtn *)btn{ 180 | 181 | if (btn.tag % 4 == 3) { 182 | return; 183 | } 184 | self.responder.text = [self.responder.text stringByAppendingString:btn.titleLabel.text]; 185 | } 186 | /** 187 | * 用颜色返回一张图片 188 | */ 189 | - (UIImage *)createImageWithColor:(UIColor *)color { 190 | 191 | CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); 192 | UIGraphicsBeginImageContext(rect.size); 193 | CGContextRef context = UIGraphicsGetCurrentContext(); 194 | CGContextSetFillColorWithColor(context, [color CGColor]); 195 | CGContextFillRect(context, rect); 196 | UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext(); 197 | UIGraphicsEndImageContext(); 198 | return theImage; 199 | } 200 | 201 | @end 202 | 203 | -------------------------------------------------------------------------------- /QHKeyboard/QHKeyboardWordPad.m: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // QHKeyboardWordPad.m 4 | // QHKeyboard 5 | // 6 | // Created by 王庆华 on 16/11/24. 7 | // Copyright © 2016年 王庆华. All rights reserved. 8 | // 9 | 10 | #import "QHKeyboardWordPad.h" 11 | #import "QHKeyboardBtn.h" 12 | 13 | @interface QHKeyboardWordPad () 14 | 15 | @property (nonatomic, weak) UITextField *responder; 16 | 17 | @property (nonatomic, strong) NSMutableArray *btnArray; 18 | @property (nonatomic, strong) NSArray *wordArray; 19 | @property (nonatomic, strong) NSArray *WORDArray; 20 | @property (nonatomic, weak) UIButton *trasitionWordBtn; 21 | @property (nonatomic, weak) UIButton *deleteBtn; 22 | @property (nonatomic, weak) UIButton *numPadCheckBtn; 23 | @property (nonatomic, weak) UIButton *okBtn; 24 | 25 | @end 26 | 27 | @implementation QHKeyboardWordPad 28 | 29 | - (UITextField *)responder { 30 | // if (!_responder) { // 防止多个输入框采用同一个inputview 31 | UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow]; 32 | UIView *firstResponder = [keyWindow valueForKey:@"firstResponder"]; 33 | _responder = (UITextField *)firstResponder; 34 | // } 35 | return _responder; 36 | } 37 | 38 | - (NSArray *)wordArray { 39 | 40 | if (!_wordArray) { 41 | _wordArray = @[@"q",@"w",@"e",@"r",@"t",@"y",@"u",@"i",@"o",@"p",@"a",@"s",@"d",@"f",@"g",@"h",@"j",@"k",@"l",@"z",@"x",@"c",@"v",@"b",@"n",@"m",@"space"]; 42 | } 43 | return _wordArray; 44 | } 45 | 46 | - (NSArray *)WORDArray { 47 | 48 | if (!_WORDArray) { 49 | _WORDArray = @[@"Q",@"W",@"E",@"R",@"T",@"Y",@"U",@"I",@"O",@"P",@"A",@"S",@"D",@"F",@"G",@"H",@"J",@"K",@"L",@"Z",@"X",@"C",@"V",@"B",@"N",@"M",@"space"]; 50 | } 51 | return _WORDArray; 52 | } 53 | 54 | - (instancetype)initWithFrame:(CGRect)frame { 55 | 56 | self = [super initWithFrame:frame]; 57 | if (self) { 58 | self.backgroundColor = [UIColor clearColor]; 59 | [self addControl]; 60 | } 61 | return self; 62 | } 63 | 64 | - (void)addControl { 65 | 66 | NSMutableArray *btnArray = [NSMutableArray array]; 67 | for (int i = 0; i< 27; i++) {// 添加26个英文字母 68 | QHKeyboardBtn *btn = [QHKeyboardBtn buttonWithTitle:self.wordArray[i] tag:i delegate:self]; 69 | if (i == 26) { 70 | // 71 | } else { 72 | [btn setBackgroundImage:[self createImageWithColor:[UIColor colorWithRed:11/255.0 green:98/255.0 blue:224/255.0 alpha:1]] forState:UIControlStateHighlighted]; 73 | [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; 74 | } 75 | [btnArray addObject:btn]; 76 | [self addSubview:btn]; 77 | } 78 | self.btnArray = btnArray; 79 | 80 | // 大小写装换 81 | UIButton *trasitionWordBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 82 | [trasitionWordBtn setImage:[UIImage imageNamed:@"images.bundle/trasition_normal"] forState:UIControlStateNormal]; 83 | [trasitionWordBtn setImage:[UIImage imageNamed:@"images.bundle/trasition_highlighted"] forState:UIControlStateSelected]; 84 | 85 | [trasitionWordBtn addTarget:self action:@selector(trasitionWord:) forControlEvents:UIControlEventTouchUpInside]; 86 | [self addSubview:trasitionWordBtn]; 87 | 88 | // 删除键 89 | UIButton *deleteBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 90 | [deleteBtn setImage:[UIImage imageNamed:@"images.bundle/keypadDeleteBtn2"] forState:UIControlStateNormal]; 91 | [deleteBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 92 | [deleteBtn addTarget:self action:@selector(deleteBtnClick) forControlEvents:UIControlEventTouchUpInside]; 93 | [self addSubview:deleteBtn]; 94 | 95 | // 数字键123 96 | UIButton *numPadCheckBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 97 | [numPadCheckBtn setTitle:@"123" forState:UIControlStateNormal]; 98 | [numPadCheckBtn setBackgroundImage:[UIImage imageNamed:@"images.bundle/keypadLongBtn"] forState:UIControlStateNormal]; 99 | [numPadCheckBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 100 | numPadCheckBtn.titleLabel.font = [UIFont boldSystemFontOfSize:19]; 101 | [numPadCheckBtn addTarget:self action:@selector(switchBtnClick:) forControlEvents:UIControlEventTouchUpInside]; 102 | [self addSubview:numPadCheckBtn]; 103 | 104 | // return 键 105 | UIButton *okBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 106 | [okBtn setTitle:@"确定" forState:UIControlStateNormal]; 107 | [okBtn setBackgroundImage:[self createImageWithColor:[UIColor colorWithRed:11/255.0 green:98/255.0 blue:224/255.0 alpha:1]] forState:UIControlStateHighlighted]; 108 | [okBtn setBackgroundImage:[self createImageWithColor:[UIColor colorWithRed:11/255.0 green:98/255.0 blue:224/255.0 alpha:1]] forState:UIControlStateNormal]; 109 | [okBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; 110 | okBtn.titleLabel.textColor = numPadCheckBtn.titleLabel.textColor; 111 | [okBtn addTarget:self action:@selector(okBtnClick) forControlEvents:UIControlEventTouchUpInside]; 112 | [self addSubview:okBtn]; 113 | 114 | self.okBtn = okBtn; 115 | self.numPadCheckBtn = numPadCheckBtn; 116 | self.deleteBtn = deleteBtn; 117 | self.trasitionWordBtn = trasitionWordBtn; 118 | 119 | self.numPadCheckBtn.layer.cornerRadius = 5.0; 120 | self.numPadCheckBtn.layer.masksToBounds = YES; 121 | self.okBtn.layer.cornerRadius = 5.0; 122 | self.okBtn.layer.masksToBounds = YES; 123 | 124 | self.deleteBtn.layer.cornerRadius = 5.0; 125 | self.deleteBtn.layer.masksToBounds = YES; 126 | } 127 | 128 | - (void)trasitionWord:(UIButton *)trasitionWordBtn { 129 | 130 | trasitionWordBtn.selected = !trasitionWordBtn.selected; 131 | if (trasitionWordBtn.selected) { 132 | for (int i = 0; i<26; i++) { 133 | QHKeyboardBtn *btn = self.btnArray[i]; 134 | [btn setTitle:self.WORDArray[i] forState:UIControlStateNormal]; 135 | } 136 | } else { 137 | for (int i = 0; i<26; i++) { 138 | QHKeyboardBtn *btn = self.btnArray[i]; 139 | [btn setTitle:self.wordArray[i] forState:UIControlStateNormal]; 140 | } 141 | } 142 | } 143 | 144 | - (void)deleteBtnClick { 145 | 146 | if (self.responder.text.length) { 147 | self.responder.text = [self.responder.text substringToIndex:self.responder.text.length-1]; 148 | } 149 | } 150 | 151 | - (void)switchBtnClick:(UIButton *)btn { 152 | 153 | if ([self.delegate respondsToSelector:@selector(KeyboardWordPadDidClickSwitchBtn:)]) { 154 | [self.delegate KeyboardWordPadDidClickSwitchBtn:btn]; 155 | } 156 | } 157 | 158 | - (void)okBtnClick { 159 | [[UIApplication sharedApplication].keyWindow endEditing:YES]; 160 | } 161 | 162 | - (void)layoutSubviews { 163 | 164 | [super layoutSubviews]; 165 | CGFloat smallBtnW = (self.frame.size.width - 13*margin)/10; 166 | CGFloat btnH = (self.frame.size.height - 5*margin)/4; 167 | 168 | for (int i = 0; i < 10; i++) { 169 | QHKeyboardBtn *btn = self.btnArray[i]; 170 | btn.frame = CGRectMake(2*margin + i*(smallBtnW + margin), margin, smallBtnW, btnH); 171 | } 172 | 173 | CGFloat margin2 = (self.frame.size.width - 8*margin - 9*smallBtnW)/2; 174 | for (int i = 10; i < 19; i++) { 175 | QHKeyboardBtn *btn = self.btnArray[i]; 176 | btn.frame = CGRectMake(margin2 + (i-10)*(smallBtnW + margin), 2*margin + btnH, smallBtnW, btnH); 177 | } 178 | 179 | CGFloat margin3 = (self.frame.size.width - 9.5*smallBtnW - 6*margin)/4; 180 | self.trasitionWordBtn.frame = CGRectMake(margin3, 3*margin + 2*btnH, smallBtnW, btnH); 181 | 182 | self.deleteBtn.frame = CGRectMake(margin3*3 + 6*margin + 8*smallBtnW, 3*margin + 2*btnH, smallBtnW * 1.5, btnH); 183 | for (int i = 19; i<26; i++) { 184 | QHKeyboardBtn *btn = self.btnArray[i]; 185 | btn.frame = CGRectMake(2*margin3 + smallBtnW + (i-19)*(smallBtnW + margin), 3*margin + 2*btnH, smallBtnW, btnH); 186 | } 187 | 188 | CGFloat bigBtnW = (self.frame.size.width - 5*margin)/4; 189 | self.numPadCheckBtn.frame = CGRectMake(margin, 4*margin + btnH*3, bigBtnW, btnH); 190 | QHKeyboardBtn *btn = [self.btnArray lastObject]; 191 | btn.frame = CGRectMake(2*margin+bigBtnW, 4*margin + btnH*3, bigBtnW * 2 + margin, btnH); 192 | self.okBtn.frame = CGRectMake(4*margin + 3*bigBtnW, 4*margin + btnH*3, bigBtnW, btnH); 193 | } 194 | 195 | #pragma mark - QHKeyboardBtnDelegate 196 | - (void)KeyboardBtnDidClick:(QHKeyboardBtn *)btn { 197 | 198 | if ([btn.titleLabel.text isEqualToString:@"space"]) { 199 | self.responder.text = [self.responder.text stringByAppendingString:@" "]; 200 | } else { 201 | if (self.trasitionWordBtn.selected) { 202 | self.responder.text = [self.responder.text stringByAppendingString:self.WORDArray[[self.btnArray indexOfObject:btn]]]; 203 | } else { 204 | self.responder.text = [self.responder.text stringByAppendingString:self.wordArray[[self.btnArray indexOfObject:btn]]]; 205 | } 206 | } 207 | } 208 | 209 | /** 210 | * 用颜色返回一张图片 211 | */ 212 | - (UIImage *)createImageWithColor:(UIColor *)color { 213 | 214 | CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); 215 | UIGraphicsBeginImageContext(rect.size); 216 | CGContextRef context = UIGraphicsGetCurrentContext(); 217 | CGContextSetFillColorWithColor(context, [color CGColor]); 218 | CGContextFillRect(context, rect); 219 | UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext(); 220 | UIGraphicsEndImageContext(); 221 | return theImage; 222 | } 223 | 224 | @end 225 | 226 | -------------------------------------------------------------------------------- /QHKeyboard.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C672FBE71DE6D7A300CED407 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C672FBE61DE6D7A300CED407 /* main.m */; }; 11 | C672FBEA1DE6D7A300CED407 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C672FBE91DE6D7A300CED407 /* AppDelegate.m */; }; 12 | C672FBED1DE6D7A300CED407 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C672FBEC1DE6D7A300CED407 /* ViewController.m */; }; 13 | C672FBF01DE6D7A300CED407 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C672FBEE1DE6D7A300CED407 /* Main.storyboard */; }; 14 | C672FBF21DE6D7A300CED407 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C672FBF11DE6D7A300CED407 /* Assets.xcassets */; }; 15 | C672FBF51DE6D7A300CED407 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C672FBF31DE6D7A300CED407 /* LaunchScreen.storyboard */; }; 16 | C672FC0E1DE6D8BE00CED407 /* QHKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = C672FC0D1DE6D8BE00CED407 /* QHKeyboard.m */; }; 17 | C672FC141DE6D96600CED407 /* QHKeyboardBtn.m in Sources */ = {isa = PBXBuildFile; fileRef = C672FC131DE6D96600CED407 /* QHKeyboardBtn.m */; }; 18 | C672FC171DE6D99A00CED407 /* QHKeyboardNumPad.m in Sources */ = {isa = PBXBuildFile; fileRef = C672FC161DE6D99A00CED407 /* QHKeyboardNumPad.m */; }; 19 | C672FC1A1DE6D9B100CED407 /* QHKeyboardWordPad.m in Sources */ = {isa = PBXBuildFile; fileRef = C672FC191DE6D9B100CED407 /* QHKeyboardWordPad.m */; }; 20 | C672FC301DE6DD0400CED407 /* images.bundle in Resources */ = {isa = PBXBuildFile; fileRef = C672FC2F1DE6DD0400CED407 /* images.bundle */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | C672FBE21DE6D7A300CED407 /* QHKeyboard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QHKeyboard.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | C672FBE61DE6D7A300CED407 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 26 | C672FBE81DE6D7A300CED407 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 27 | C672FBE91DE6D7A300CED407 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 28 | C672FBEB1DE6D7A300CED407 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 29 | C672FBEC1DE6D7A300CED407 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 30 | C672FBEF1DE6D7A300CED407 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 31 | C672FBF11DE6D7A300CED407 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 32 | C672FBF41DE6D7A300CED407 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 33 | C672FBF61DE6D7A300CED407 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | C672FC0C1DE6D8BE00CED407 /* QHKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QHKeyboard.h; sourceTree = ""; }; 35 | C672FC0D1DE6D8BE00CED407 /* QHKeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QHKeyboard.m; sourceTree = ""; }; 36 | C672FC121DE6D96600CED407 /* QHKeyboardBtn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QHKeyboardBtn.h; sourceTree = ""; }; 37 | C672FC131DE6D96600CED407 /* QHKeyboardBtn.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QHKeyboardBtn.m; sourceTree = ""; }; 38 | C672FC151DE6D99A00CED407 /* QHKeyboardNumPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QHKeyboardNumPad.h; sourceTree = ""; }; 39 | C672FC161DE6D99A00CED407 /* QHKeyboardNumPad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QHKeyboardNumPad.m; sourceTree = ""; }; 40 | C672FC181DE6D9B100CED407 /* QHKeyboardWordPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QHKeyboardWordPad.h; sourceTree = ""; }; 41 | C672FC191DE6D9B100CED407 /* QHKeyboardWordPad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QHKeyboardWordPad.m; sourceTree = ""; }; 42 | C672FC2F1DE6DD0400CED407 /* images.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = images.bundle; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | C672FBDF1DE6D7A300CED407 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | C672FBD91DE6D7A300CED407 = { 57 | isa = PBXGroup; 58 | children = ( 59 | C672FBE41DE6D7A300CED407 /* QHKeyboard */, 60 | C672FBE31DE6D7A300CED407 /* Products */, 61 | ); 62 | sourceTree = ""; 63 | }; 64 | C672FBE31DE6D7A300CED407 /* Products */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | C672FBE21DE6D7A300CED407 /* QHKeyboard.app */, 68 | ); 69 | name = Products; 70 | sourceTree = ""; 71 | }; 72 | C672FBE41DE6D7A300CED407 /* QHKeyboard */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | C672FC2F1DE6DD0400CED407 /* images.bundle */, 76 | C672FC0C1DE6D8BE00CED407 /* QHKeyboard.h */, 77 | C672FC0D1DE6D8BE00CED407 /* QHKeyboard.m */, 78 | C672FC121DE6D96600CED407 /* QHKeyboardBtn.h */, 79 | C672FC131DE6D96600CED407 /* QHKeyboardBtn.m */, 80 | C672FC151DE6D99A00CED407 /* QHKeyboardNumPad.h */, 81 | C672FC161DE6D99A00CED407 /* QHKeyboardNumPad.m */, 82 | C672FC181DE6D9B100CED407 /* QHKeyboardWordPad.h */, 83 | C672FC191DE6D9B100CED407 /* QHKeyboardWordPad.m */, 84 | C672FBE81DE6D7A300CED407 /* AppDelegate.h */, 85 | C672FBE91DE6D7A300CED407 /* AppDelegate.m */, 86 | C672FBEB1DE6D7A300CED407 /* ViewController.h */, 87 | C672FBEC1DE6D7A300CED407 /* ViewController.m */, 88 | C672FBEE1DE6D7A300CED407 /* Main.storyboard */, 89 | C672FBF11DE6D7A300CED407 /* Assets.xcassets */, 90 | C672FBF31DE6D7A300CED407 /* LaunchScreen.storyboard */, 91 | C672FBF61DE6D7A300CED407 /* Info.plist */, 92 | C672FBE51DE6D7A300CED407 /* Supporting Files */, 93 | ); 94 | path = QHKeyboard; 95 | sourceTree = ""; 96 | }; 97 | C672FBE51DE6D7A300CED407 /* Supporting Files */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | C672FBE61DE6D7A300CED407 /* main.m */, 101 | ); 102 | name = "Supporting Files"; 103 | sourceTree = ""; 104 | }; 105 | /* End PBXGroup section */ 106 | 107 | /* Begin PBXNativeTarget section */ 108 | C672FBE11DE6D7A300CED407 /* QHKeyboard */ = { 109 | isa = PBXNativeTarget; 110 | buildConfigurationList = C672FBF91DE6D7A300CED407 /* Build configuration list for PBXNativeTarget "QHKeyboard" */; 111 | buildPhases = ( 112 | C672FBDE1DE6D7A300CED407 /* Sources */, 113 | C672FBDF1DE6D7A300CED407 /* Frameworks */, 114 | C672FBE01DE6D7A300CED407 /* Resources */, 115 | ); 116 | buildRules = ( 117 | ); 118 | dependencies = ( 119 | ); 120 | name = QHKeyboard; 121 | productName = QHKeyboard; 122 | productReference = C672FBE21DE6D7A300CED407 /* QHKeyboard.app */; 123 | productType = "com.apple.product-type.application"; 124 | }; 125 | /* End PBXNativeTarget section */ 126 | 127 | /* Begin PBXProject section */ 128 | C672FBDA1DE6D7A300CED407 /* Project object */ = { 129 | isa = PBXProject; 130 | attributes = { 131 | LastUpgradeCheck = 0800; 132 | ORGANIZATIONNAME = "王庆华"; 133 | TargetAttributes = { 134 | C672FBE11DE6D7A300CED407 = { 135 | CreatedOnToolsVersion = 8.0; 136 | ProvisioningStyle = Automatic; 137 | }; 138 | }; 139 | }; 140 | buildConfigurationList = C672FBDD1DE6D7A300CED407 /* Build configuration list for PBXProject "QHKeyboard" */; 141 | compatibilityVersion = "Xcode 3.2"; 142 | developmentRegion = English; 143 | hasScannedForEncodings = 0; 144 | knownRegions = ( 145 | en, 146 | Base, 147 | ); 148 | mainGroup = C672FBD91DE6D7A300CED407; 149 | productRefGroup = C672FBE31DE6D7A300CED407 /* Products */; 150 | projectDirPath = ""; 151 | projectRoot = ""; 152 | targets = ( 153 | C672FBE11DE6D7A300CED407 /* QHKeyboard */, 154 | ); 155 | }; 156 | /* End PBXProject section */ 157 | 158 | /* Begin PBXResourcesBuildPhase section */ 159 | C672FBE01DE6D7A300CED407 /* Resources */ = { 160 | isa = PBXResourcesBuildPhase; 161 | buildActionMask = 2147483647; 162 | files = ( 163 | C672FBF51DE6D7A300CED407 /* LaunchScreen.storyboard in Resources */, 164 | C672FBF21DE6D7A300CED407 /* Assets.xcassets in Resources */, 165 | C672FBF01DE6D7A300CED407 /* Main.storyboard in Resources */, 166 | C672FC301DE6DD0400CED407 /* images.bundle in Resources */, 167 | ); 168 | runOnlyForDeploymentPostprocessing = 0; 169 | }; 170 | /* End PBXResourcesBuildPhase section */ 171 | 172 | /* Begin PBXSourcesBuildPhase section */ 173 | C672FBDE1DE6D7A300CED407 /* Sources */ = { 174 | isa = PBXSourcesBuildPhase; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | C672FBED1DE6D7A300CED407 /* ViewController.m in Sources */, 178 | C672FC0E1DE6D8BE00CED407 /* QHKeyboard.m in Sources */, 179 | C672FBEA1DE6D7A300CED407 /* AppDelegate.m in Sources */, 180 | C672FC141DE6D96600CED407 /* QHKeyboardBtn.m in Sources */, 181 | C672FC1A1DE6D9B100CED407 /* QHKeyboardWordPad.m in Sources */, 182 | C672FC171DE6D99A00CED407 /* QHKeyboardNumPad.m in Sources */, 183 | C672FBE71DE6D7A300CED407 /* main.m in Sources */, 184 | ); 185 | runOnlyForDeploymentPostprocessing = 0; 186 | }; 187 | /* End PBXSourcesBuildPhase section */ 188 | 189 | /* Begin PBXVariantGroup section */ 190 | C672FBEE1DE6D7A300CED407 /* Main.storyboard */ = { 191 | isa = PBXVariantGroup; 192 | children = ( 193 | C672FBEF1DE6D7A300CED407 /* Base */, 194 | ); 195 | name = Main.storyboard; 196 | sourceTree = ""; 197 | }; 198 | C672FBF31DE6D7A300CED407 /* LaunchScreen.storyboard */ = { 199 | isa = PBXVariantGroup; 200 | children = ( 201 | C672FBF41DE6D7A300CED407 /* Base */, 202 | ); 203 | name = LaunchScreen.storyboard; 204 | sourceTree = ""; 205 | }; 206 | /* End PBXVariantGroup section */ 207 | 208 | /* Begin XCBuildConfiguration section */ 209 | C672FBF71DE6D7A300CED407 /* Debug */ = { 210 | isa = XCBuildConfiguration; 211 | buildSettings = { 212 | ALWAYS_SEARCH_USER_PATHS = NO; 213 | CLANG_ANALYZER_NONNULL = YES; 214 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 215 | CLANG_CXX_LIBRARY = "libc++"; 216 | CLANG_ENABLE_MODULES = YES; 217 | CLANG_ENABLE_OBJC_ARC = YES; 218 | CLANG_WARN_BOOL_CONVERSION = YES; 219 | CLANG_WARN_CONSTANT_CONVERSION = YES; 220 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 221 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 222 | CLANG_WARN_EMPTY_BODY = YES; 223 | CLANG_WARN_ENUM_CONVERSION = YES; 224 | CLANG_WARN_INFINITE_RECURSION = YES; 225 | CLANG_WARN_INT_CONVERSION = YES; 226 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 227 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 228 | CLANG_WARN_UNREACHABLE_CODE = YES; 229 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 230 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 231 | COPY_PHASE_STRIP = NO; 232 | DEBUG_INFORMATION_FORMAT = dwarf; 233 | ENABLE_STRICT_OBJC_MSGSEND = YES; 234 | ENABLE_TESTABILITY = YES; 235 | GCC_C_LANGUAGE_STANDARD = gnu99; 236 | GCC_DYNAMIC_NO_PIC = NO; 237 | GCC_NO_COMMON_BLOCKS = YES; 238 | GCC_OPTIMIZATION_LEVEL = 0; 239 | GCC_PREPROCESSOR_DEFINITIONS = ( 240 | "DEBUG=1", 241 | "$(inherited)", 242 | ); 243 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 244 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 245 | GCC_WARN_UNDECLARED_SELECTOR = YES; 246 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 247 | GCC_WARN_UNUSED_FUNCTION = YES; 248 | GCC_WARN_UNUSED_VARIABLE = YES; 249 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 250 | MTL_ENABLE_DEBUG_INFO = YES; 251 | ONLY_ACTIVE_ARCH = YES; 252 | SDKROOT = iphoneos; 253 | TARGETED_DEVICE_FAMILY = "1,2"; 254 | }; 255 | name = Debug; 256 | }; 257 | C672FBF81DE6D7A300CED407 /* Release */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | ALWAYS_SEARCH_USER_PATHS = NO; 261 | CLANG_ANALYZER_NONNULL = YES; 262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_WARN_BOOL_CONVERSION = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 269 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INFINITE_RECURSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 275 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 276 | CLANG_WARN_UNREACHABLE_CODE = YES; 277 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 278 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 279 | COPY_PHASE_STRIP = NO; 280 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 281 | ENABLE_NS_ASSERTIONS = NO; 282 | ENABLE_STRICT_OBJC_MSGSEND = YES; 283 | GCC_C_LANGUAGE_STANDARD = gnu99; 284 | GCC_NO_COMMON_BLOCKS = YES; 285 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 286 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 287 | GCC_WARN_UNDECLARED_SELECTOR = YES; 288 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 289 | GCC_WARN_UNUSED_FUNCTION = YES; 290 | GCC_WARN_UNUSED_VARIABLE = YES; 291 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 292 | MTL_ENABLE_DEBUG_INFO = NO; 293 | SDKROOT = iphoneos; 294 | TARGETED_DEVICE_FAMILY = "1,2"; 295 | VALIDATE_PRODUCT = YES; 296 | }; 297 | name = Release; 298 | }; 299 | C672FBFA1DE6D7A300CED407 /* Debug */ = { 300 | isa = XCBuildConfiguration; 301 | buildSettings = { 302 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 303 | INFOPLIST_FILE = QHKeyboard/Info.plist; 304 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 305 | PRODUCT_BUNDLE_IDENTIFIER = com.baidu.QHKeyboard; 306 | PRODUCT_NAME = "$(TARGET_NAME)"; 307 | }; 308 | name = Debug; 309 | }; 310 | C672FBFB1DE6D7A300CED407 /* Release */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 314 | INFOPLIST_FILE = QHKeyboard/Info.plist; 315 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 316 | PRODUCT_BUNDLE_IDENTIFIER = com.baidu.QHKeyboard; 317 | PRODUCT_NAME = "$(TARGET_NAME)"; 318 | }; 319 | name = Release; 320 | }; 321 | /* End XCBuildConfiguration section */ 322 | 323 | /* Begin XCConfigurationList section */ 324 | C672FBDD1DE6D7A300CED407 /* Build configuration list for PBXProject "QHKeyboard" */ = { 325 | isa = XCConfigurationList; 326 | buildConfigurations = ( 327 | C672FBF71DE6D7A300CED407 /* Debug */, 328 | C672FBF81DE6D7A300CED407 /* Release */, 329 | ); 330 | defaultConfigurationIsVisible = 0; 331 | defaultConfigurationName = Release; 332 | }; 333 | C672FBF91DE6D7A300CED407 /* Build configuration list for PBXNativeTarget "QHKeyboard" */ = { 334 | isa = XCConfigurationList; 335 | buildConfigurations = ( 336 | C672FBFA1DE6D7A300CED407 /* Debug */, 337 | C672FBFB1DE6D7A300CED407 /* Release */, 338 | ); 339 | defaultConfigurationIsVisible = 0; 340 | }; 341 | /* End XCConfigurationList section */ 342 | }; 343 | rootObject = C672FBDA1DE6D7A300CED407 /* Project object */; 344 | } 345 | --------------------------------------------------------------------------------