回答編集履歴
1
コードの誤りを修正しました。申し訳ございません。
test
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
```ShowViewController.swift
|
14
14
|
import UIKit
|
15
15
|
|
16
|
-
var passd
|
16
|
+
var passdLabel: UILabel! //追加
|
17
17
|
|
18
18
|
class ShowViewController: UIViewController {
|
19
19
|
|
@@ -22,10 +22,10 @@
|
|
22
22
|
override func viewDidLoad() {
|
23
23
|
super.viewDidLoad()
|
24
24
|
title = "ようこそ"
|
25
|
+
passedLabel = textLabel //追加
|
25
26
|
}
|
26
27
|
|
27
28
|
@IBAction func unwind(_ segue: UIStoryboardSegue) {
|
28
|
-
passdString = self.textLabel.text //追加
|
29
29
|
let edit = segue.source as! EditViewController
|
30
30
|
self.textLabel.text = edit.textField.text
|
31
31
|
}
|
@@ -41,7 +41,7 @@
|
|
41
41
|
|
42
42
|
override func viewDidLoad() {
|
43
43
|
super.viewDidLoad()
|
44
|
-
self.textField.text = passd
|
44
|
+
self.textField.text = passdLabel.text //追加
|
45
45
|
|
46
46
|
let tapGesture: UITapGestureRecognizer = UITapGestureRecognizer(target:self, action:#selector(dismissKeyboard))
|
47
47
|
self.view.addGestureRecognizer(tapGesture)
|