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

質問編集履歴

1

コード一部修正しました

2017/08/14 05:37

投稿

Kenelaoy
Kenelaoy

スコア50

title CHANGED
File without changes
body CHANGED
@@ -44,11 +44,11 @@
44
44
 
45
45
  }
46
46
 
47
- public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int{ //セクションごとの行数を返す
47
+ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int{ //セクションごとの行数を返す
48
48
  return ap.tasks.count
49
49
  }
50
50
 
51
- public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{ //各行に表示するセルを返す
51
+ func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{ //各行に表示するセルを返す
52
52
  let cell: UITableViewCell = tableView.dequeueReusableCell(withIdentifier: "MyCell", for: indexPath)
53
53
 
54
54
  // セルに表示する値を設定する
@@ -57,11 +57,11 @@
57
57
  return cell
58
58
  }
59
59
 
60
- public func numberOfSections(in tableView: UITableView) -> Int { //セクション数を返す(初期値は1)
60
+ func numberOfSections(in tableView: UITableView) -> Int { //セクション数を返す(初期値は1)
61
61
  return 1 //今回は別に何かセクション分けする必要はないので必ず1を返す
62
62
  }
63
63
 
64
- public func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { //セクションタイトルを返す(初期値は空)
64
+ func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { //セクションタイトルを返す(初期値は空)
65
65
  return ""
66
66
  }
67
67
 
@@ -82,6 +82,9 @@
82
82
 
83
83
  print(tasks)
84
84
  ```
85
+ ```
86
+ tasks = ["テスト2チェック", "テスト4だよ", "こんにちは世界", "", "テストだよ", "テスト2だよ", "テスト3だよ", "テストじゃい!1", "テストじゃち"]
87
+ ```
85
88
 
86
89
  AppDelegateでは
87
90
  ```