I am usign Xcode 15.2. I have been following CodewithChris for a while on youtube. I have managed to crete iunterface for my radio app but i have failed on how to play the radio station link to the app. I need help.
///. import SwiftUI
import AVFoundation
import UIKit
struct ContentView: View {
var body: some View {
ZStack {
Image("RadioB2")
.resizable()
.ignoresSafeArea()
.background(Rectangle()
.foregroundColor(.black))
.ignoresSafeArea()
VStack {
Menu(/*@START_MENU_TOKEN@*/"Menu"/*@END_MENU_TOKEN@*/)
{
/*@START_MENU_TOKEN@*/Text("Menu Item 1")/*@END_MENU_TOKEN@*/
/*@START_MENU_TOKEN@*/Text("Menu Item 2")/*@END_MENU_TOKEN@*/
/*@START_MENU_TOKEN@*/Text("Menu Item 3")
.padding(.trailing)/*@END_MENU_TOKEN@*/
}
.padding(.trailing, 250.0)
.foregroundColor(.white)
Image("logo")
.imageScale(.small)
.foregroundStyle(.tint)
Text("Global Evangelical Church")
.bold()
.foregroundColor(.white)
.padding(/*@START_MENU_TOKEN@*/.all/*@END_MENU_TOKEN@*/)
Spacer()
VStack {
HStack {
Link(destination: URL(string: "https://www.youtube.com/channel/UC4tYNnpAyq8qBTqTajJkc3w")!, label: {
Text("Youtube")
})
.padding(.trailing, 80.0)
.bold()
.foregroundColor(.white)
.navigationBarBackButtonHidden()
Link(destination: URL(string: "https://www.facebook.com/globalchurchus")!, label: {
Text("FaceBook")
})
.padding(.leading, 80.0)
.bold()
.foregroundColor(.white)
}
Button {
func playbutton(){
let urlString = Bundle.main.url(forResource: "https://noasrv.caster.fm:2199/start/opztdowk%22", withExtension: "https")
}
}
label: {
Image("PLAYRADIO")
}
}
}
.padding()
}
}
}
#Preview {
ContentView()
}