diff --git a/PodcastsClone.xcodeproj/project.pbxproj b/PodcastsClone.xcodeproj/project.pbxproj index 850cdee..d70fb32 100644 --- a/PodcastsClone.xcodeproj/project.pbxproj +++ b/PodcastsClone.xcodeproj/project.pbxproj @@ -7,6 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + EC8CF6202A13A4F200BE6FD5 /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EC8CF61F2A13A4F200BE6FD5 /* Colors.xcassets */; }; + EC8CF6232A13A59400BE6FD5 /* LibraryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC8CF6222A13A59400BE6FD5 /* LibraryView.swift */; }; + EC8CF6252A13A7F000BE6FD5 /* Podcast.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC8CF6242A13A7F000BE6FD5 /* Podcast.swift */; }; ECB23B932A0E33B000A1C62B /* PodcastsCloneApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB23B922A0E33B000A1C62B /* PodcastsCloneApp.swift */; }; ECB23B972A0E33B200A1C62B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ECB23B962A0E33B200A1C62B /* Assets.xcassets */; }; ECB23B9A2A0E33B200A1C62B /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ECB23B992A0E33B200A1C62B /* Preview Assets.xcassets */; }; @@ -16,6 +19,9 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + EC8CF61F2A13A4F200BE6FD5 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = ""; }; + EC8CF6222A13A59400BE6FD5 /* LibraryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryView.swift; sourceTree = ""; }; + EC8CF6242A13A7F000BE6FD5 /* Podcast.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Podcast.swift; sourceTree = ""; }; ECB23B8F2A0E33B000A1C62B /* PodcastsClone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PodcastsClone.app; sourceTree = BUILT_PRODUCTS_DIR; }; ECB23B922A0E33B000A1C62B /* PodcastsCloneApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PodcastsCloneApp.swift; sourceTree = ""; }; ECB23B962A0E33B200A1C62B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -36,6 +42,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + EC8CF6212A13A57400BE6FD5 /* Model */ = { + isa = PBXGroup; + children = ( + EC8CF6242A13A7F000BE6FD5 /* Podcast.swift */, + ); + path = Model; + sourceTree = ""; + }; ECB23B862A0E33B000A1C62B = { isa = PBXGroup; children = ( @@ -55,6 +69,8 @@ ECB23B912A0E33B000A1C62B /* PodcastsClone */ = { isa = PBXGroup; children = ( + EC8CF6212A13A57400BE6FD5 /* Model */, + EC8CF61F2A13A4F200BE6FD5 /* Colors.xcassets */, ECB23BA42A0E45CC00A1C62B /* Views */, ECB23B922A0E33B000A1C62B /* PodcastsCloneApp.swift */, ECB23B962A0E33B200A1C62B /* Assets.xcassets */, @@ -77,6 +93,7 @@ ECB23BA02A0E3FDF00A1C62B /* MainView.swift */, ECB23BA22A0E455300A1C62B /* PodcastDetailView.swift */, ECB23BA52A0E4C0B00A1C62B /* EpisodeViewCell.swift */, + EC8CF6222A13A59400BE6FD5 /* LibraryView.swift */, ); path = Views; sourceTree = ""; @@ -139,6 +156,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + EC8CF6202A13A4F200BE6FD5 /* Colors.xcassets in Resources */, ECB23B9A2A0E33B200A1C62B /* Preview Assets.xcassets in Resources */, ECB23B972A0E33B200A1C62B /* Assets.xcassets in Resources */, ); @@ -153,7 +171,9 @@ files = ( ECB23BA12A0E3FDF00A1C62B /* MainView.swift in Sources */, ECB23BA62A0E4C0B00A1C62B /* EpisodeViewCell.swift in Sources */, + EC8CF6252A13A7F000BE6FD5 /* Podcast.swift in Sources */, ECB23BA32A0E455300A1C62B /* PodcastDetailView.swift in Sources */, + EC8CF6232A13A59400BE6FD5 /* LibraryView.swift in Sources */, ECB23B932A0E33B000A1C62B /* PodcastsCloneApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/PodcastsClone/Colors.xcassets/Contents.json b/PodcastsClone/Colors.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/PodcastsClone/Colors.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/PodcastsClone/Model/Podcast.swift b/PodcastsClone/Model/Podcast.swift new file mode 100644 index 0000000..9749d39 --- /dev/null +++ b/PodcastsClone/Model/Podcast.swift @@ -0,0 +1,20 @@ +// +// Podcast.swift +// PodcastsClone +// +// Created by etudiant on 2023-05-16. +// + +import Foundation + +class Podcast { + var title: String + var length: Int + var id: Int + + init(title: String = "test title", length: Int = 400, id: Int) { + self.title = title + self.length = length + self.id = id + } +} diff --git a/PodcastsClone/Views/LibraryView.swift b/PodcastsClone/Views/LibraryView.swift new file mode 100644 index 0000000..d7d0fb0 --- /dev/null +++ b/PodcastsClone/Views/LibraryView.swift @@ -0,0 +1,36 @@ +// +// LibraryView.swift +// PodcastsClone +// +// Created by etudiant on 2023-05-16. +// + +import SwiftUI + + + + +struct LibraryView: View { + // some random stuff + var podcasts = + [ + Podcast(id: 0), + Podcast(id: 1), + Podcast(id: 2) + ]; + + var body: some View { + NavigationStack{ + List(podcasts, id: \.id) { currentPodcast in + //PodcastDetailView(podcast: currentPodcast) + PodcastDetailView() + } + } + } +} + +struct LibraryView_Previews: PreviewProvider { + static var previews: some View { + LibraryView() + } +} diff --git a/PodcastsClone/Views/PodcastDetailView.swift b/PodcastsClone/Views/PodcastDetailView.swift index d20e541..b2223e4 100644 --- a/PodcastsClone/Views/PodcastDetailView.swift +++ b/PodcastsClone/Views/PodcastDetailView.swift @@ -8,6 +8,7 @@ import SwiftUI struct PodcastDetailView: View { + var body: some View { ScrollView { VStack(alignment: .leading) {