-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MainView Changed, now we can interact with the episodes.
- Loading branch information
Showing
9 changed files
with
104 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// AllEpisodesView.swift | ||
// BBTGuide | ||
// | ||
// Created by Jesus Sanz on 6/1/23. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct AllEpisodesView: View { | ||
@EnvironmentObject var episodesVM:EpisodesViewModel | ||
@State var path = NavigationPath() | ||
|
||
var body: some View { | ||
NavigationStack(path: $path) { | ||
List { | ||
ForEach(episodesVM.seasonsSection, id:\.self) { episodes in | ||
DisclosureGroup { | ||
ForEach(episodes) { episode in | ||
NavigationLink(value: episode) { | ||
EpisodeCell(detailVM: DetailViewModel(episode: episode)) | ||
} | ||
} | ||
} label: { | ||
SeasonCell(season: episodes) | ||
} | ||
} | ||
.swipeActions(edge: .leading, allowsFullSwipe: true) { | ||
Button { | ||
} label: { | ||
Image(systemName: "eye.circle.fill") | ||
} | ||
} | ||
.tint(.green) | ||
} | ||
.listStyle(.sidebar) | ||
.navigationDestination(for: Episode.self) { episode in | ||
EpisodeDetailView(detailVM: DetailViewModel(episode: episode)) | ||
} | ||
.navigationTitle("The Big Bang Theory") | ||
.searchable(text: $episodesVM.search) | ||
} | ||
} | ||
} | ||
|
||
struct AllEpisodesView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
AllEpisodesView() | ||
.environmentObject(EpisodesViewModel()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters