-
Notifications
You must be signed in to change notification settings - Fork 14
/
ViewController.m
46 lines (35 loc) · 1.39 KB
/
ViewController.m
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// ViewController.m
// KeyboardToolBar
//
// Created by Jiar on 15/11/13.
// Copyright © 2015年 Jiar. All rights reserved.
//
#import "ViewController.h"
#import "KeyboardToolBar.h"
@interface ViewController ()
@property(nonatomic, weak) IBOutlet UITextField *first;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.first.textColor = [UIColor greenColor];
self.first.secureTextEntry = YES;
self.first.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.first.placeholder attributes:@{NSForegroundColorAttributeName: [UIColor redColor]}];
}
- (IBAction)registerFirst:(id)sender {
[KeyboardToolBar registerKeyboardToolBarWithTextField:self.first];
[[[UIApplication sharedApplication] keyWindow] endEditing:YES];
}
- (IBAction)unregisterFirst:(id)sender {
[KeyboardToolBar unregisterKeyboardToolBarWithTextField:self.first];
[[[UIApplication sharedApplication] keyWindow] endEditing:YES];
}
- (IBAction)toMyGithub:(id)sender {
UIWebView *webView = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://github.com/Jiar/KeyboardToolBar/"]]];
UIViewController *viewCro = [[UIViewController alloc] init];
[viewCro.view addSubview:webView];
[self presentViewController:viewCro animated:YES completion:nil];
}
@end