質問編集履歴
4
ソースコード修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,12 +2,14 @@
|
|
2
2
|
ビルドを行うと、シミュレーターには何も表示されず、コンソールにて下記エラー?が発生してしまいました。
|
3
3
|
こちらの解決方法をご教示いただけませんでしょうか。
|
4
4
|
```ここに言語を入力
|
5
|
-
2022-07-0
|
6
|
-
2022-07-0
|
7
|
-
2022-07-0
|
8
|
-
2022-07-0
|
9
|
-
2022-07-0
|
10
|
-
2022-07-0
|
5
|
+
2022-07-03 16:49:56.998366+0900 memoAppFIrebase5[21445:209925] 9.2.0 - [FirebaseAnalytics][I-ACS023007] Analytics v.9.2.0 started
|
6
|
+
2022-07-03 16:49:57.000873+0900 memoAppFIrebase5[21445:209925] 9.2.0 - [FirebaseAnalytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
|
7
|
+
2022-07-03 16:49:57.047346+0900 memoAppFIrebase5[21445:209941] 9.2.0 - [FirebaseAnalytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
|
8
|
+
2022-07-03 16:49:57.105290+0900 memoAppFIrebase5[21445:209926] 9.2.0 - [FirebaseAnalytics][I-ACS023012] Analytics collection enabled
|
9
|
+
2022-07-03 16:49:57.106062+0900 memoAppFIrebase5[21445:209926] 9.2.0 - [FirebaseAnalytics][I-ACS023220] Analytics screen reporting is enabled. Call Analytics.logEvent(AnalyticsEventScreenView, parameters: [...]) to log a screen view event. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist
|
10
|
+
2022-07-03 16:49:57.603793+0900 memoAppFIrebase5[21445:209925] [boringssl] boringssl_metrics_log_metric_block_invoke(153) Failed to log metrics
|
11
|
+
2022-07-03 16:50:12.012043+0900 memoAppFIrebase5[21445:210216] [boringssl] boringssl_metrics_log_metric_block_invoke(153) Failed to log metrics
|
12
|
+
2022-07-03 16:50:12.307355+0900 memoAppFIrebase5[21445:210216] [boringssl] boringssl_metrics_log_metric_block_invoke(153) Failed to log metrics
|
11
13
|
|
12
14
|
```
|
13
15
|
|
3
ソースコードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -115,6 +115,18 @@
|
|
115
115
|
self.text = dic["text"] as! String
|
116
116
|
}
|
117
117
|
}
|
118
|
-
|
118
|
+
```
|
119
|
+
```Podflle
|
120
|
+
# Uncomment the next line to define a global platform for your project
|
121
|
+
# platform :ios, '9.0'
|
119
122
|
|
123
|
+
target 'memoAppFIrebase5' do
|
124
|
+
# Comment the next line if you don't want to use dynamic frameworks
|
125
|
+
use_frameworks!
|
126
|
+
pod 'Firebase/Analytics'
|
127
|
+
pod 'FirebaseFirestore'
|
128
|
+
|
129
|
+
# Pods for memoAppFIrebase5
|
130
|
+
|
131
|
+
end
|
120
132
|
```
|
2
ソースコードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
```
|
13
13
|
|
14
14
|
追記ソースコード
|
15
|
-
```
|
15
|
+
```mainTableViewController.swift
|
16
16
|
import UIKit
|
17
17
|
import Firebase
|
18
18
|
|
1
ソースコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,3 +10,111 @@
|
|
10
10
|
2022-07-02 18:39:04.455597+0900 memoAppFIrebase5[46794:304620] [boringssl] boringssl_metrics_log_metric_block_invoke(153) Failed to log metrics
|
11
11
|
|
12
12
|
```
|
13
|
+
|
14
|
+
追記ソースコード
|
15
|
+
```ここに言語を入力
|
16
|
+
import UIKit
|
17
|
+
import Firebase
|
18
|
+
|
19
|
+
class mainTableViewController: UITableViewController {
|
20
|
+
|
21
|
+
var memos: [Memo]! = []
|
22
|
+
|
23
|
+
override func viewDidLoad() {
|
24
|
+
super.viewDidLoad()
|
25
|
+
print("成功")
|
26
|
+
}
|
27
|
+
|
28
|
+
override func viewWillAppear(_ animated: Bool) {
|
29
|
+
super.viewWillAppear(animated)
|
30
|
+
|
31
|
+
let data = Firestore.firestore()
|
32
|
+
data.collection("memos").getDocuments {[self] (snap, err) in
|
33
|
+
if let err = err {
|
34
|
+
print("エラーだよ")
|
35
|
+
return
|
36
|
+
} else {
|
37
|
+
for document in snap!.documents {
|
38
|
+
let data = document.data()
|
39
|
+
let memo = Memo.init(dic: data)
|
40
|
+
self.memos.append(memo)
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
self.tableView.reloadData()
|
45
|
+
}
|
46
|
+
|
47
|
+
// MARK: - Table view data source
|
48
|
+
|
49
|
+
override func numberOfSections(in tableView: UITableView) -> Int {
|
50
|
+
// #warning Incomplete implementation, return the number of sections
|
51
|
+
return 1
|
52
|
+
}
|
53
|
+
|
54
|
+
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
55
|
+
// #warning Incomplete implementation, return the number of rows
|
56
|
+
return self.memos.count
|
57
|
+
}
|
58
|
+
|
59
|
+
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
60
|
+
let cell = tableView.dequeueReusableCell(withIdentifier: "tableViewCell", for: indexPath)
|
61
|
+
let memo = memos[indexPath.row]
|
62
|
+
|
63
|
+
let nameLabel = cell.viewWithTag(1) as! UILabel
|
64
|
+
nameLabel.text = memo.name
|
65
|
+
|
66
|
+
let textLabel = cell.viewWithTag(2) as! UILabel
|
67
|
+
textLabel.text = memo.text
|
68
|
+
|
69
|
+
return cell
|
70
|
+
}
|
71
|
+
|
72
|
+
```
|
73
|
+
```AppDelegate.swift
|
74
|
+
import UIKit
|
75
|
+
import Firebase
|
76
|
+
|
77
|
+
@main
|
78
|
+
class AppDelegate: UIResponder, UIApplicationDelegate {
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
83
|
+
FirebaseApp.configure()
|
84
|
+
return true
|
85
|
+
}
|
86
|
+
|
87
|
+
// MARK: UISceneSession Lifecycle
|
88
|
+
|
89
|
+
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
|
90
|
+
// Called when a new scene session is being created.
|
91
|
+
// Use this method to select a configuration to create the new scene with.
|
92
|
+
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
93
|
+
}
|
94
|
+
|
95
|
+
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
|
96
|
+
// Called when the user discards a scene session.
|
97
|
+
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
|
98
|
+
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
|
99
|
+
}
|
100
|
+
|
101
|
+
|
102
|
+
}
|
103
|
+
```
|
104
|
+
```Memo.swift
|
105
|
+
|
106
|
+
import Foundation
|
107
|
+
import Firebase
|
108
|
+
|
109
|
+
struct Memo {
|
110
|
+
var name: String = ""
|
111
|
+
var text: String = ""
|
112
|
+
|
113
|
+
init(dic: [String: Any]){
|
114
|
+
self.name = dic["name"] as! String
|
115
|
+
self.text = dic["text"] as! String
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
|
120
|
+
```
|