ContentView
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import SwiftUI struct ContentView: View { @State private var uniqueId: String = "" var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text(uniqueId) Button("Generar UUID") { uniqueId = generarUUID() } .padding() } .padding() } } func generarUUID() -> String { let uuid = UUID() return uuid.uuidString } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } |