Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Navigation Issue in AnimationListView in the Sample Project #2528

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Example/Example/AnimationListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@ struct AnimationListView: View {
.frame(height: 50)
}
}
.navigationDestination(for: Item.self) { item in
switch item {
case .animation(_, let animationPath):
AnimationPreviewView(animationSource: .local(animationPath: animationPath))
case .remoteAnimations(let name, let urls):
AnimationPreviewView(animationSource: .remote(urls: urls, name: name))
case .animationList(let listContent):
AnimationListView(content: listContent)
case .controlsDemo:
ControlsDemoView()
case .swiftUIInteroperability:
SwiftUIInteroperabilityDemoView()
case .lottieViewLayoutDemo:
LottieViewLayoutDemoView()
}
}
}
}
.navigationTitle(content.name)
.navigationDestination(for: Item.self) { item in
switch item {
case .animation(_, let animationPath):
AnimationPreviewView(animationSource: .local(animationPath: animationPath))
case .remoteAnimations(let name, let urls):
AnimationPreviewView(animationSource: .remote(urls: urls, name: name))
case .animationList(let listContent):
AnimationListView(content: listContent)
case .controlsDemo:
ControlsDemoView()
case .swiftUIInteroperability:
SwiftUIInteroperabilityDemoView()
case .lottieViewLayoutDemo:
LottieViewLayoutDemoView()
}
}
}

func makeThumbnailAnimation(for item: Item) async throws -> LottieAnimationSource? {
Expand Down
Loading