質問編集履歴
1
タイトル等の変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
UIAlertController
|
1
|
+
UIAlertControllerのテキストフィールドに入力した文字数をカウントしたい
|
test
CHANGED
@@ -4,7 +4,11 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
|
7
|
+
このテキストフィールドに入力された文字数をカウントしたいです。
|
8
|
+
|
7
|
-
|
9
|
+
テキストフィールドのデリゲートを利用すると思うのですが、どのようにしたら良いのかわかりません。
|
10
|
+
|
11
|
+
ご教示お願い致します。
|
8
12
|
|
9
13
|
|
10
14
|
|
@@ -12,7 +16,7 @@
|
|
12
16
|
|
13
17
|
```swift
|
14
18
|
|
15
|
-
@IBAction func tapButton
|
19
|
+
@IBAction func tapButton(_ sender: UIButton) {
|
16
20
|
|
17
21
|
let alert = UIAlertController(title: "タイトル", message: "メッセージ", preferredStyle: .alert)
|
18
22
|
|
@@ -40,9 +44,13 @@
|
|
40
44
|
|
41
45
|
// カスタムテキストフィールドを追加
|
42
46
|
|
43
|
-
let
|
47
|
+
alert.addTextFieldWithConfigurationHandler({(text:UITextField!) -> Void in
|
44
48
|
|
49
|
+
})
|
50
|
+
|
45
|
-
alert.
|
51
|
+
alert.addTextFieldWithConfigurationHandler({(text:UITextField!) -> Void in
|
52
|
+
|
53
|
+
})
|
46
54
|
|
47
55
|
|
48
56
|
|