mirror of
https://github.com/kean/Pulse.git
synced 2026-05-30 21:07:33 +00:00
Add analytics view to the demo
This commit is contained in:
@@ -8,7 +8,7 @@ import Pulse
|
||||
import SwiftUI
|
||||
|
||||
final class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
|
||||
private let tableView = UITableView(frame: .zero, style: .grouped)
|
||||
private let tableView = UITableView(frame: .zero, style: .insetGrouped)
|
||||
private var sections: [MenuSection] = []
|
||||
|
||||
override func viewDidLoad() {
|
||||
@@ -30,15 +30,23 @@ final class ViewController: UIViewController, UITableViewDataSource, UITableView
|
||||
]),
|
||||
MenuSection(title: "Components", footer: "Demonstrates how you can push individual PulseUI screens into an existing navigation (UINavigationController or NavigationView)", items: [
|
||||
MenuItem(title: "ConsoleView", action: { [unowned self] in
|
||||
let vc = UIHostingController(rootView: ConsoleView(store: .mock))
|
||||
let vc = UIHostingController(rootView: ConsoleView(store: .mock).closeButtonHidden())
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}),
|
||||
MenuItem(title: "ConsoleView (Logs)", action: { [unowned self] in
|
||||
let vc = UIHostingController(rootView: ConsoleView(store: .mock, mode: .logs))
|
||||
let vc = UIHostingController(rootView: ConsoleView(store: .mock, mode: .logs).closeButtonHidden())
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}),
|
||||
MenuItem(title: "ConsoleView (Network)", action: { [unowned self] in
|
||||
let vc = UIHostingController(rootView: ConsoleView(store: .mock, mode: .network))
|
||||
let vc = UIHostingController(rootView: ConsoleView(store: .mock, mode: .network).closeButtonHidden())
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
})
|
||||
]),
|
||||
MenuSection(title: "Custom Views", footer: "Custom views into the underlying logger data", items: [
|
||||
MenuItem(title: "User Analytics", action: { [unowned self] in
|
||||
let view = DebugAnalyticsView()
|
||||
.environment(\.managedObjectContext, LoggerStore.mock.viewContext)
|
||||
let vc = UIHostingController(rootView: view)
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
})
|
||||
]),
|
||||
|
||||
Reference in New Issue
Block a user