質問編集履歴

3

誤字

2018/10/24 15:17

投稿

kawano108
kawano108

スコア17

test CHANGED
File without changes
test CHANGED
@@ -82,19 +82,7 @@
82
82
 
83
83
  ```Swift
84
84
 
85
- //
86
85
 
87
- // AppDelegate.swift
88
-
89
- // youtube
90
-
91
- //
92
-
93
- // Created by TOUYA KAWANO on 2018/10/20.
94
-
95
- // Copyright © 2018年 Toya Kawano. All rights reserved.
96
-
97
- //
98
86
 
99
87
 
100
88
 

2

AppDelegateクラスのソースコードを追加しました。

2018/10/24 15:17

投稿

kawano108
kawano108

スコア17

test CHANGED
File without changes
test CHANGED
@@ -80,6 +80,114 @@
80
80
 
81
81
 
82
82
 
83
+ ```Swift
84
+
85
+ //
86
+
87
+ // AppDelegate.swift
88
+
89
+ // youtube
90
+
91
+ //
92
+
93
+ // Created by TOUYA KAWANO on 2018/10/20.
94
+
95
+ // Copyright © 2018年 Toya Kawano. All rights reserved.
96
+
97
+ //
98
+
99
+
100
+
101
+ import UIKit
102
+
103
+
104
+
105
+ @UIApplicationMain
106
+
107
+ class AppDelegate: UIResponder, UIApplicationDelegate {
108
+
109
+
110
+
111
+ var window: UIWindow?
112
+
113
+
114
+
115
+
116
+
117
+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
118
+
119
+
120
+
121
+ window = UIWindow(frame: UIScreen.main.bounds)
122
+
123
+ window?.makeKeyAndVisible()
124
+
125
+ let layout = UICollectionViewLayout()
126
+
127
+ window?.rootViewController = UINavigationController(rootViewController: HomeController(collectionViewLayout: layout))
128
+
129
+ return true
130
+
131
+ }
132
+
133
+
134
+
135
+ func applicationWillResignActive(_ application: UIApplication) {
136
+
137
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
138
+
139
+ // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
140
+
141
+ }
142
+
143
+
144
+
145
+ func applicationDidEnterBackground(_ application: UIApplication) {
146
+
147
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
148
+
149
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
150
+
151
+ }
152
+
153
+
154
+
155
+ func applicationWillEnterForeground(_ application: UIApplication) {
156
+
157
+ // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
158
+
159
+ }
160
+
161
+
162
+
163
+ func applicationDidBecomeActive(_ application: UIApplication) {
164
+
165
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
166
+
167
+ }
168
+
169
+
170
+
171
+ func applicationWillTerminate(_ application: UIApplication) {
172
+
173
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
174
+
175
+ }
176
+
177
+
178
+
179
+
180
+
181
+ }
182
+
183
+
184
+
185
+
186
+
187
+ ```
188
+
189
+
190
+
83
191
  ### 試したこと
84
192
 
85
193
  ・ブレークポイントを貼ってcellForRowAtが呼ばれているか調べた。
@@ -92,4 +200,4 @@
92
200
 
93
201
 
94
202
 
95
- ここにより詳細な情報を記てください。
203
+ // 2018/10/24 情報を記しました!

1

誤字

2018/10/24 15:17

投稿

kawano108
kawano108

スコア17

test CHANGED
@@ -1 +1 @@
1
- cellForRowAtのメソッドが呼ばれない原因は?
1
+ cellForItemAtのメソッドが呼ばれない原因は?
test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  collectionViewのcellを表示させるだけのアプリを作っています。
6
6
 
7
- しかし、cellForRowAtのメソッドが呼ばれず、cellを生成することができません。
7
+ しかし、cellForItemAtのメソッドが呼ばれず、cellを生成することができません。
8
8
 
9
9
  もし原因がわかる方がいましたら、教えていただきたいです。
10
10