Swift UI Test

xcode / app

Posted by ETHAN KIM on March 28, 2023 · 1 min read
Swift

Preview


Content View (Swift UI)

//
//  ContentView.swift
//  L1 Demo
//
//  Created by Ethan Kim on 2023/03/30.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        ZStack {
            Image("background-wood-cartoon")
                .resizable()
                .ignoresSafeArea()
            
            VStack{
                Spacer()
                Image("logo")
                Spacer()
                HStack{
                    Spacer()
                    Image("card2")
                    Spacer()
                    Image("card3")
                    Spacer()
                }
                Spacer()
                Image("button")
                Spacer()
                HStack{
                    Spacer()
                    VStack{
                        Text("Player")
                            .font(.headline)
                            .padding(.bottom, 10)
                        Text("0")
                    }
                    Spacer()
                    VStack{
                        Text("CPU")
                            .font(.headline)
                            .padding(.bottom, 10)
                        Text("0")
                    }
                    Spacer()
                }
                .foregroundColor(.white)
                Spacer()
            }
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}