Rename DynamicObjectID -> PersistentID

This commit is contained in:
John Estropia
2026-07-27 15:23:39 +09:00
parent 13093d72d4
commit 16c5bb3e15
23 changed files with 146 additions and 120 deletions
@@ -37,12 +37,18 @@ extension Advanced.EvolutionDemo {
modelVersion: Advanced.EvolutionDemo.V3.name,
entities: [
Entity<Advanced.EvolutionDemo.V3.Creature>("Creature")
],
versionLock: [
"Creature": [0x23cc88fece8e3ee0, 0xe37ecbcbe52eab30, 0xd3cc2e5f39a37f16, 0x79feebe14f602495]
]
),
CoreStoreSchema(
modelVersion: Advanced.EvolutionDemo.V4.name,
entities: [
Entity<Advanced.EvolutionDemo.V4.Creature>("Creature")
],
versionLock: [
"Creature": [0xe7eaceec2a84d084, 0xac104aa167d8afe8, 0x6651e5ece419d490, 0xf73ec7f3512197de]
]
)
],
@@ -51,7 +51,7 @@ extension Modern.PokedexDemo {
Sample 2: Importing a single JSON data into an `ImportableUniqueObject` whose `ImportSource` is a JSON `Dictionary`
*/
private static func importSpecies(
for detailsPersistentID: DynamicObjectID<Modern.PokedexDemo.Details>,
for detailsPersistentID: PersistentID<Modern.PokedexDemo.Details>,
from data: Data
) async throws -> ObjectSnapshot<Modern.PokedexDemo.Species> {
@@ -88,7 +88,7 @@ extension Modern.PokedexDemo {
Sample 3: Importing a list of JSON data into `ImportableUniqueObject`s whose `ImportSource` are JSON `Dictionary`s
*/
private static func importForms(
for detailsPersistentID: DynamicObjectID<Modern.PokedexDemo.Details>,
for detailsPersistentID: PersistentID<Modern.PokedexDemo.Details>,
from dataArray: [Data]
) async throws {
@@ -289,7 +289,7 @@ extension Modern.PokedexDemo {
private func fetchSpecies(
key: String,
detailsPersistentID: DynamicObjectID<Modern.PokedexDemo.Details>,
detailsPersistentID: PersistentID<Modern.PokedexDemo.Details>,
speciesURL: URL
) async {
@@ -331,7 +331,7 @@ extension Modern.PokedexDemo {
private func fetchFormsIfNeeded(
key: String,
detailsPersistentID: DynamicObjectID<Modern.PokedexDemo.Details>,
detailsPersistentID: PersistentID<Modern.PokedexDemo.Details>,
species: ObjectSnapshot<Modern.PokedexDemo.Species>
) {
@@ -363,7 +363,7 @@ extension Modern.PokedexDemo {
}
private func fetchForms(
detailsPersistentID: DynamicObjectID<Modern.PokedexDemo.Details>,
detailsPersistentID: PersistentID<Modern.PokedexDemo.Details>,
formsURLs: [URL]
) async {
+25 -2
View File
@@ -24,15 +24,18 @@ extension Menu {
if self.horizontalSizeClass == .compact {
NavigationStack {
self.menuList
}
}
else {
NavigationSplitView(
sidebar: {
self.menuList
},
detail: {
Menu.PlaceholderView()
}
)
@@ -48,14 +51,16 @@ extension Menu {
ForEach(Menu.Section.allCases, id: \.self) { section in
SwiftUI.Section(
SwiftUI::Section(
content: {
ForEach(section.routes) { route in
NavigationLink(
destination: {
route.destination
LazyDestination {
route.destination
}
},
label: {
Menu.ItemView(
@@ -78,5 +83,23 @@ extension Menu {
.navigationTitle("CoreStore Demos")
.listStyle(.sidebar)
}
// MARK: - LazyDestination
private struct LazyDestination<Content: View>: View {
init(@ViewBuilder content: @escaping () -> Content) {
self.content = content
}
var body: some View {
self.content()
}
private let content: () -> Content
}
}
}