質問編集履歴
2
補足追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -193,3 +193,7 @@
|
|
193
193
|
パスワードエラー画面表示の際に、キーボードを表示しないようにするにはどのようにしたら良いでしょうか?
|
194
194
|
|
195
195
|
わかる方がいらっしゃいましたら、ご回答をお願いします。
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
#補足ですが、エラーにならずにほかの画面に移動した場合も同様にキーボードが一瞬表示されるようです。
|
1
見やすく更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,15 +36,27 @@
|
|
36
36
|
|
37
37
|
|
38
38
|
|
39
|
-
色々情報を調べると、UIAlertControllerに移行すべきという例が載っており、
|
39
|
+
色々情報を調べると、UIAlertControllerに移行すべきという例が載っており、
|
40
|
+
|
41
|
+
```Objective-C
|
42
|
+
|
43
|
+
コード
|
40
44
|
|
41
45
|
- (void)showPasswordAlertView{
|
42
46
|
|
47
|
+
UIAlertController *alert =
|
48
|
+
|
43
|
-
|
49
|
+
[UIAlertController alertControllerWithTitle:@"パスワード入力"
|
50
|
+
|
51
|
+
message:@"パスワードを入力後、\n「実行」をタップしてください。"
|
52
|
+
|
53
|
+
preferredStyle:UIAlertControllerStyleAlert];
|
44
54
|
|
45
55
|
|
46
56
|
|
47
|
-
[alert addAction:[UIAlertAction actionWithTitle:@"キャンセル"
|
57
|
+
[alert addAction:[UIAlertAction actionWithTitle:@"キャンセル"
|
58
|
+
|
59
|
+
style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
48
60
|
|
49
61
|
NSLog(@"Cancel");
|
50
62
|
|
@@ -52,7 +64,9 @@
|
|
52
64
|
|
53
65
|
|
54
66
|
|
67
|
+
[alert addAction:[UIAlertAction actionWithTitle:@"実行"
|
68
|
+
|
55
|
-
|
69
|
+
style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
56
70
|
|
57
71
|
// 認証処理
|
58
72
|
|
@@ -66,7 +80,7 @@
|
|
66
80
|
|
67
81
|
} else {
|
68
82
|
|
69
|
-
|
83
|
+
// 認証成功
|
70
84
|
|
71
85
|
error = NO;
|
72
86
|
|
@@ -108,9 +122,17 @@
|
|
108
122
|
|
109
123
|
//エラー
|
110
124
|
|
111
|
-
UIAlertController *alert =
|
125
|
+
UIAlertController *alert =
|
112
126
|
|
127
|
+
[UIAlertController alertControllerWithTitle:@"パスワードエラー"
|
128
|
+
|
129
|
+
message:@"入力したパスワードが間違っています。"
|
130
|
+
|
131
|
+
preferredStyle:UIAlertControllerStyleAlert];
|
132
|
+
|
133
|
+
[alert addAction:[UIAlertAction actionWithTitle:@"確認"
|
134
|
+
|
113
|
-
|
135
|
+
style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
114
136
|
|
115
137
|
// ボタンが押された時の処理
|
116
138
|
|
@@ -138,7 +160,11 @@
|
|
138
160
|
|
139
161
|
}
|
140
162
|
|
163
|
+
|
164
|
+
|
141
165
|
```
|
166
|
+
|
167
|
+
|
142
168
|
|
143
169
|
と実装してみたのですが、
|
144
170
|
|