diff --git a/FlinkChallenge/FlinkChallenge.xcodeproj/project.pbxproj b/FlinkChallenge/FlinkChallenge.xcodeproj/project.pbxproj index c01df9f..2d129bf 100644 --- a/FlinkChallenge/FlinkChallenge.xcodeproj/project.pbxproj +++ b/FlinkChallenge/FlinkChallenge.xcodeproj/project.pbxproj @@ -22,7 +22,6 @@ BD6A5E6E23FCBC01003B1E4D /* CharacterDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD6A5E6D23FCBC01003B1E4D /* CharacterDetailView.swift */; }; BD6A5E7123FCEB6C003B1E4D /* EpisodeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD6A5E7023FCEB6C003B1E4D /* EpisodeController.swift */; }; BD6A5E7323FCEBA0003B1E4D /* Episode.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD6A5E7223FCEBA0003B1E4D /* Episode.swift */; }; - BD6A5E7523FCFD98003B1E4D /* EpisodeModalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD6A5E7423FCFD98003B1E4D /* EpisodeModalView.swift */; }; BD6A5E7723FD003A003B1E4D /* SearchBarUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD6A5E7623FD003A003B1E4D /* SearchBarUIView.swift */; }; BD810CEF23FDB95F00D7853A /* AdvancedFilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD810CEE23FDB95F00D7853A /* AdvancedFilterView.swift */; }; BD810D3723FDD82B00D7853A /* CharacterFilteringController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD810D3623FDD82B00D7853A /* CharacterFilteringController.swift */; }; @@ -64,7 +63,6 @@ BD6A5E6D23FCBC01003B1E4D /* CharacterDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterDetailView.swift; sourceTree = ""; }; BD6A5E7023FCEB6C003B1E4D /* EpisodeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EpisodeController.swift; sourceTree = ""; }; BD6A5E7223FCEBA0003B1E4D /* Episode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Episode.swift; sourceTree = ""; }; - BD6A5E7423FCFD98003B1E4D /* EpisodeModalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EpisodeModalView.swift; sourceTree = ""; }; BD6A5E7623FD003A003B1E4D /* SearchBarUIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchBarUIView.swift; sourceTree = ""; }; BD810CEE23FDB95F00D7853A /* AdvancedFilterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedFilterView.swift; sourceTree = ""; }; BD810D3623FDD82B00D7853A /* CharacterFilteringController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterFilteringController.swift; sourceTree = ""; }; @@ -172,7 +170,6 @@ BD6A5E6823FC8F01003B1E4D /* CharacterFeedView.swift */, BD6A5E6B23FC9ADF003B1E4D /* CardView.swift */, BD6A5E6D23FCBC01003B1E4D /* CharacterDetailView.swift */, - BD6A5E7423FCFD98003B1E4D /* EpisodeModalView.swift */, BD6A5E7623FD003A003B1E4D /* SearchBarUIView.swift */, BD810CEE23FDB95F00D7853A /* AdvancedFilterView.swift */, BD810D3823FDDC4200D7853A /* CharacterFilterView.swift */, @@ -372,7 +369,6 @@ BD810D3723FDD82B00D7853A /* CharacterFilteringController.swift in Sources */, BD6A5E6C23FC9ADF003B1E4D /* CardView.swift in Sources */, BD6A5E6923FC8F02003B1E4D /* CharacterFeedView.swift in Sources */, - BD6A5E7523FCFD98003B1E4D /* EpisodeModalView.swift in Sources */, BD6A5E7323FCEBA0003B1E4D /* Episode.swift in Sources */, BD6A5E7723FD003A003B1E4D /* SearchBarUIView.swift in Sources */, BD6A5E7123FCEB6C003B1E4D /* EpisodeController.swift in Sources */, diff --git a/FlinkChallenge/FlinkChallenge/Views/CharacterDetailView.swift b/FlinkChallenge/FlinkChallenge/Views/CharacterDetailView.swift index 6705909..97d484e 100644 --- a/FlinkChallenge/FlinkChallenge/Views/CharacterDetailView.swift +++ b/FlinkChallenge/FlinkChallenge/Views/CharacterDetailView.swift @@ -142,14 +142,11 @@ struct CharacterDetail: View { Text("Episodes").font(.title).bold() ScrollView { VStack { - ForEach (episodes ,id: \.self) { episode in + ForEach (episodes ,id: \.id) { episode in Button(action: { - print("wow") self.show_modal = true }) { EpisodeView(episode: episode) - }.sheet(isPresented: self.$show_modal) { - EpisodeModalView(episode: episode) } } } diff --git a/FlinkChallenge/FlinkChallenge/Views/EpisodeModalView.swift b/FlinkChallenge/FlinkChallenge/Views/EpisodeModalView.swift deleted file mode 100644 index 08126d6..0000000 --- a/FlinkChallenge/FlinkChallenge/Views/EpisodeModalView.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// EpisodeModalView.swift -// FlinkChallenge -// -// Created by Fernando Martin Garcia Del Angel on 18/02/20. -// Copyright © 2020 Fernando Martin Garcia Del Angel. All rights reserved. -// - -import SwiftUI - -struct EpisodeModalView: View { - var episode : Episode - var body: some View { - VStack { - Text(episode.name!).font(.largeTitle).bold().multilineTextAlignment(.center) - Text(episode.episode!) - .font(.subheadline) - .fontWeight(.semibold) - Text("This episode aired on \(episode.air_date!)") - .font(.body) - Text("\(episode.characters?.count ?? 0) character\(episode.characters?.count ?? 0 > 1 ? "s" : "") appeared on this episode") - } - } -} - -struct EpisodeModalView_Previews: PreviewProvider { - static var previews: some View { - EpisodeModalView(episode: Episode()) - } -}