diff --git a/MobileFort/MobileFort/Common.swift b/MobileFort/MobileFort/Common.swift index f6d6086..b7e0418 100644 --- a/MobileFort/MobileFort/Common.swift +++ b/MobileFort/MobileFort/Common.swift @@ -4,6 +4,12 @@ enum PostType: String, Decodable { case picture } +struct Media: Decodable, Identifiable { + let id: Int + + let url: String +} + struct Post: Decodable, Identifiable { let id: Int @@ -11,4 +17,6 @@ struct Post: Decodable, Identifiable { let content: String let postType: PostType + + let media: [Media] } diff --git a/MobileFort/MobileFort/ContentView.swift b/MobileFort/MobileFort/ContentView.swift index f4d32de..2eaf518 100644 --- a/MobileFort/MobileFort/ContentView.swift +++ b/MobileFort/MobileFort/ContentView.swift @@ -14,6 +14,12 @@ struct ProfileView: View { if post.title != nil { Text(post.title!) } + + VStack { + ForEach(post.media) { media in + Text(media.url) + } + } } } }.navigationBarTitle(username + "'s Feed").onAppear {