質問編集履歴
1
コード修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -68,132 +68,4 @@
|
|
68
68
|
|
69
69
|
|
70
70
|
|
71
|
-
if metadataObj.type == AVMetadataObjectTypeQRCode {
|
72
|
-
|
73
|
-
// 見つかったメタデータがQRコードメタデータと等しい場合は、ステータスラベルのテキストを更新し、境界を設定
|
74
|
-
|
75
|
-
let barCodeObject = videoPreviewLayer?.transformedMetadataObject(for: metadataObj)
|
76
|
-
|
77
|
-
qrCodeFrameView?.frame = barCodeObject!.bounds
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
if metadataObj.stringValue != nil {
|
82
|
-
|
83
|
-
device_name = metadataObj.stringValue
|
84
|
-
|
85
|
-
//自動遷移
|
86
|
-
|
87
|
-
//self.performSegue(withIdentifier: "toLentTable",sender: device_name)
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
}
|
92
|
-
|
93
|
-
captureSession?.stopRunning()
|
94
|
-
|
95
|
-
}
|
96
|
-
|
97
|
-
}
|
98
|
-
|
99
|
-
//LentListViewControllerに遷移後値を渡す
|
100
|
-
|
101
|
-
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
102
|
-
|
103
|
-
if segue.identifier == "toLentTable" {
|
104
|
-
|
105
|
-
let lentListViewController = segue.destination as! LentListViewController
|
106
|
-
|
107
|
-
lentListViewController.device_name = [sender as! String]
|
108
|
-
|
109
|
-
}
|
110
|
-
|
111
|
-
}
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
override func viewWillAppear(_ animated: Bool) {
|
116
|
-
|
117
|
-
super.viewWillAppear(animated)
|
118
|
-
|
119
|
-
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
120
|
-
|
121
|
-
self.navigationController!.navigationBar.shadowImage = UIImage()
|
122
|
-
|
123
|
-
}
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
}
|
128
|
-
|
129
|
-
|
130
|
-
|
131
71
|
```
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
```
|
136
|
-
|
137
|
-
TableViewController
|
138
|
-
|
139
|
-
@IBOutlet weak var LentTableVIew: UITableView!
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
var device_name = [""]
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
override func viewDidLoad() {
|
148
|
-
|
149
|
-
super.viewDidLoad()
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
LentTableVIew.delegate = self
|
154
|
-
|
155
|
-
LentTableVIew.dataSource = self
|
156
|
-
|
157
|
-
}
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
override func didReceiveMemoryWarning() {
|
162
|
-
|
163
|
-
super.didReceiveMemoryWarning()
|
164
|
-
|
165
|
-
// Dispose of any resources that can be recreated.
|
166
|
-
|
167
|
-
}
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
172
|
-
|
173
|
-
return device_name.count
|
174
|
-
|
175
|
-
}
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
180
|
-
|
181
|
-
let cell = tableView.dequeueReusableCell(withIdentifier: "mycell", for: indexPath)
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
cell.textLabel?.text = device_name[indexPath.row]
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
return cell
|
190
|
-
|
191
|
-
}
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
}
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
```
|