This commit is contained in:
John Estropia
2020-08-18 12:05:20 +09:00
parent 72f36e7237
commit 0f3455a4a4
13 changed files with 557 additions and 104 deletions

View File

@@ -72,7 +72,9 @@ extension Menu {
Menu.ItemView(
title: "Pokedex API",
subtitle: "Importing JSON data from external source",
destination: { EmptyView() }
destination: {
Modern.PokedexDemo.MainView()
}
)
}
Section(header: Text("Classic (NSManagedObject subclasses)")) {
@@ -127,23 +129,11 @@ extension Menu {
}
.listStyle(GroupedListStyle())
.navigationBarTitle("CoreStore Demos")
Menu.DetailView()
Menu.PlaceholderView()
}
.navigationViewStyle(DoubleColumnNavigationViewStyle())
}
}
fileprivate struct DetailView: View {
var selectedDate: Date?
var body: some View {
Group {
Text("Detail view content goes here")
}
.navigationBarTitle(Text("Detail"))
}
}
}
#if DEBUG

View File

@@ -0,0 +1,44 @@
//
// Demo
// Copyright © 2020 John Rommel Estropia, Inc. All rights reserved.
import Combine
import CoreStore
import SwiftUI
// MARK: - Menu
extension Menu {
// MARK: - Menu.PlaceholderView
struct PlaceholderView: UIViewControllerRepresentable {
// MARK: UIViewControllerRepresentable
typealias UIViewControllerType = UIViewController
func makeUIViewController(context: Self.Context) -> UIViewControllerType {
return UIStoryboard(name: "LaunchScreen", bundle: nil).instantiateInitialViewController()!
}
func updateUIViewController(_ uiViewController: UIViewControllerType, context: Self.Context) {}
static func dismantleUIViewController(_ uiViewController: UIViewControllerType, coordinator: Void) {}
}
}
#if DEBUG
struct _Demo_Menu_PlaceholderView_Preview: PreviewProvider {
// MARK: PreviewProvider
static var previews: some View {
return Menu.PlaceholderView()
}
}
#endif