質問するログイン新規登録

回答編集履歴

4

ss

2020/08/12 00:05

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -79,4 +79,6 @@
79
79
  }
80
80
  ```
81
81
 
82
- ![イメージ説明](b5a7e7ce040e1d0e7c193262184db28e.png)
82
+ ![イメージ説明](b5a7e7ce040e1d0e7c193262184db28e.png)
83
+
84
+ ![イメージ説明](52f2ce70099490c775813cfd1e434db1.png)

3

s

2020/08/12 00:05

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -26,14 +26,14 @@
26
26
  pickerView.dataSource = self
27
27
  let toolbar = UIToolbar()
28
28
  let space = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
29
- let doneButton = UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(tappedDone(_:)))
29
+ let doneButton = UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(ViewController.tappedDone))
30
30
  toolbar.items = [space, doneButton]
31
31
  toolbar.sizeToFit()
32
32
  textField.inputView = pickerView
33
33
  textField.inputAccessoryView = toolbar
34
34
  }
35
35
 
36
- @objc func tappedDone(_ sender: UIBarButtonItem) {
36
+ @objc func tappedDone() {
37
37
  textField.resignFirstResponder()
38
38
  }
39
39
  }

2

image

2020/08/11 23:58

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -77,4 +77,6 @@
77
77
  return false
78
78
  }
79
79
  }
80
- ```
80
+ ```
81
+
82
+ ![イメージ説明](b5a7e7ce040e1d0e7c193262184db28e.png)

1

s

2020/08/11 23:55

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -1,6 +1,6 @@
1
1
  `UITextField`クラスをカスタムすればカーソル(キャレット)は消すことができるので、以下の様にしたほうがシンプルで良いと思います。
2
2
 
3
- 以下の2つのファイルでそのまま動くと思うので、`Storyboard`に `UITextFiled`を乗せ(クラスはカスタムクラスを指定)、`IBOutlet`を結んで試してみてください。
3
+ 以下の2つのファイルでそのまま動くと思うので、`Storyboard`の`ViewController`に `UITextFiled`を乗せ(クラスはカスタムクラスを指定)、`IBOutlet`を結んで試してみてください。
4
4
 
5
5
 
6
6
  * ViewController