Skip to content

Commit ffb94bc

Browse files
committed
Add analytics view to the demo
1 parent 8525da7 commit ffb94bc

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Demo/Integrations/ViewController.swift

+12-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Pulse
88
import SwiftUI
99

1010
final class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
11-
private let tableView = UITableView(frame: .zero, style: .grouped)
11+
private let tableView = UITableView(frame: .zero, style: .insetGrouped)
1212
private var sections: [MenuSection] = []
1313

1414
override func viewDidLoad() {
@@ -30,15 +30,23 @@ final class ViewController: UIViewController, UITableViewDataSource, UITableView
3030
]),
3131
MenuSection(title: "Components", footer: "Demonstrates how you can push individual PulseUI screens into an existing navigation (UINavigationController or NavigationView)", items: [
3232
MenuItem(title: "ConsoleView", action: { [unowned self] in
33-
let vc = UIHostingController(rootView: ConsoleView(store: .mock))
33+
let vc = UIHostingController(rootView: ConsoleView(store: .mock).closeButtonHidden())
3434
self.navigationController?.pushViewController(vc, animated: true)
3535
}),
3636
MenuItem(title: "ConsoleView (Logs)", action: { [unowned self] in
37-
let vc = UIHostingController(rootView: ConsoleView(store: .mock, mode: .logs))
37+
let vc = UIHostingController(rootView: ConsoleView(store: .mock, mode: .logs).closeButtonHidden())
3838
self.navigationController?.pushViewController(vc, animated: true)
3939
}),
4040
MenuItem(title: "ConsoleView (Network)", action: { [unowned self] in
41-
let vc = UIHostingController(rootView: ConsoleView(store: .mock, mode: .network))
41+
let vc = UIHostingController(rootView: ConsoleView(store: .mock, mode: .network).closeButtonHidden())
42+
self.navigationController?.pushViewController(vc, animated: true)
43+
})
44+
]),
45+
MenuSection(title: "Custom Views", footer: "Custom views into the underlying logger data", items: [
46+
MenuItem(title: "User Analytics", action: { [unowned self] in
47+
let view = DebugAnalyticsView()
48+
.environment(\.managedObjectContext, LoggerStore.mock.viewContext)
49+
let vc = UIHostingController(rootView: view)
4250
self.navigationController?.pushViewController(vc, animated: true)
4351
})
4452
]),

0 commit comments

Comments
 (0)