Created
February 26, 2022 22:39
-
-
Save mitnick78/589d46956e995d5b5b9344cd282314db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct CardView: View { | |
@StateObject var vmLearn: LearnViewModel | |
@State private var isDescription = false | |
var body: some View { | |
ZStack{ | |
RoundedRectangle(cornerRadius: 10).stroke(Color(hex: "E5E6E4"), lineWidth: 1) | |
VStack(spacing: 20){ | |
HStack{ | |
Text(vmLearn.word) | |
Spacer() | |
Image(systemName: "info.circle.fill") | |
.foregroundColor(Color(hex: "957FEF")) | |
.font(.system(size: 20)) | |
.onTapGesture { | |
isDescription = true | |
} | |
Image(systemName: "play.rectangle.fill") | |
.foregroundColor(Color(hex: "957FEF")) | |
.font(.system(size: 20)) | |
} | |
HStack{ | |
Text(vmLearn.word2) | |
}.hLeading() | |
} | |
.padding(10) | |
.hLeading() | |
.popover(isPresented: $isDescription) { | |
Text("Je suis une description") | |
Button { | |
print("d") | |
self.isDescription = false | |
} label: { | |
Text("Fermer") | |
} | |
} | |
} | |
.onAppear(perform: { | |
vmLearn.getLearns() | |
print(vmLearn.learns) | |
}) | |
.background(Color.white) | |
.fixedSize(horizontal: false, vertical: true) | |
.padding([.leading, .trailing],20) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment