//
// ContentView.swift
// Lesson4.SwiftUIandContainers
//
// Created by Mereke Dadabayeva on 25.08.21.
//
import SwiftUI
struct ContentView: View {
var body: some View {
//Stack Containing two cards
VStack {
//CN Tower card
ZStack{
Image("toronto").resizable().aspectRatio(contentMode: .fit).cornerRadius(20.0)
//Stack Containing text
VStack(spacing: -25.0) {
Text("CN Tower")
.font(.title)
.fontWeight(.regular)
.foregroundColor(Color.white)
.padding(.all, 30.0)
.background(Color.black).opacity(0.8).cornerRadius(8.0)
Text("Toronto")
.font(.footnote)
.foregroundColor(Color.white)
}
}.padding()
//End of Stack CN Tower Card
//Stack Containing Big Ben Card
ZStack {
Image ("london").resizable().aspectRatio(contentMode:.fit).cornerRadius(20.0)
//Stack containing text
VStack(spacing: -25.0) {
Text("Big Ben")
.font(.title)
.fontWeight(.regular)
.foregroundColor(Color.white)
.padding(.all, 30.0)
.padding(EdgeInsets())
.background(Color.black).opacity(0.8).cornerRadius(8.0)
Text("London")
.font(.footnote)
.foregroundColor(Color.white)
}
}.padding()
//End of Big Ben Card
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
}
View on simulator looks pretty same