import Subsonic import SwiftUI struct ContentView: View { let names = ["Jingle", "Mathys"] var body: some View { NavigationView { ScrollView{ ForEach(names, id: \.self) {name in Button { play(sound: "\(name).m4a") } label: { Image(name) .resizable() .scaledToFit() .cornerRadius(25) .padding(.horizontal) } } } .navigationTitle("Friend Smile") } .navigationViewStyle(.stack) } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter