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

質問編集履歴

1

コードの変更

2018/06/24 11:45

投稿

s1209
s1209

スコア13

title CHANGED
File without changes
body CHANGED
@@ -172,40 +172,27 @@
172
172
 
173
173
  import UIKit
174
174
 
175
- class SettingViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
175
+ class TableViewController: UITableViewController {
176
176
 
177
- @IBOutlet weak var tableView: UITableView!
178
-
179
177
  override func viewDidLoad() {
180
178
  super.viewDidLoad()
181
-
182
- tableView.delegate = self
179
+
183
- tableView.dataSource = self
180
+
184
181
  }
182
+
185
-
183
+ override func didReceiveMemoryWarning() {
184
+ super.didReceiveMemoryWarning()
185
+ }
186
+
187
+
186
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
188
+ override func numberOfSections(in tableView: UITableView) -> Int {
187
189
  return 1
188
190
  }
189
-
191
+
190
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
192
+ override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
191
-
192
- let cell: UITableViewCell = tableView.dequeueReusableCell(withIdentifier: "TableViewCell", for: indexPath) as! TableViewCell
193
- return cell
193
+ return 2
194
194
  }
195
-
196
- func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
197
- return 50
198
- }
199
195
 
200
-
201
-
202
- @IBAction func saveButton(_ sender: UIButton) {
203
-
204
- dismiss(animated: true) {}
205
-
206
- }
207
-
208
- }
209
196
  ```
210
197
 
211
198
  ```Swift