//
// ContentView.swift
// (wilsonoey) ios pemula
//
// Created by user233987 on 3/20/23.
//
import SwiftUI
struct TVGroup: Identifiable {
var id = UUID()
var name : String
var description : String
var pictureurl : String
}
let TVGroups: [TVGroup] = [
TVGroup(
name: "GTV",
description: "Tes1",
pictureurl: "https://www.transtv.co.id/livetv/anytv/GTV_live_streaming_tv.jpg"
),
TVGroup(
name: "Indosiar",
description: "Tes1",
pictureurl: "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c8/Indosiar_2015.svg/300px-Indosiar_2015.svg.png"
),
TVGroup(
name: "Kompas TV",
description: "Tes1",
pictureurl: "https://www.transtv.co.id/livetv/anytv/GTV_live_streaming_tv.jpg"
),
TVGroup(
name: "Metro TV",
description: "Tes1",
pictureurl: "https://www.transtv.co.id/livetv/anytv/GTV_live_streaming_tv.jpg"
),
TVGroup(
name: "RCTI",
description: "Tes1",
pictureurl: "https://www.transtv.co.id/livetv/anytv/GTV_live_streaming_tv.jpg"
),
TVGroup(
name: "SCTV",
description: "Tes1",
pictureurl: "https://www.transtv.co.id/livetv/anytv/GTV_live_streaming_tv.jpg"
),
TVGroup(
name: "Trans 7",
description: "Tes1",
pictureurl: "https://www.transtv.co.id/livetv/anytv/GTV_live_streaming_tv.jpg"
),
TVGroup(
name: "Trans TV",
description: "Tes1",
pictureurl: "https://www.transtv.co.id/livetv/anytv/GTV_live_streaming_tv.jpg"
),
TVGroup(
name: "TV One",
description: "Tes1",
pictureurl: "https://www.transtv.co.id/livetv/anytv/GTV_live_streaming_tv.jpg"
),
TVGroup(
name: "TVRI",
description: "Tes1",
pictureurl: "https://www.transtv.co.id/livetv/anytv/GTV_live_streaming_tv.jpg"
),
]
struct ContentView: View {
var body: some View {
NavigationView{
List(TVGroups){TVGroup in
HStack{
ZStack{
AsyncImage(
url: URL(string: TVGroup.pictureurl),
content: {image in
image
.resizable()
.frame(maxWidth: 50, maxHeight: 50)
},
placeholder: {
ProgressView()
}
)
}
Text(TVGroup.name)
}
}.navigationTitle("TV List")
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}