-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCardify.swift
More file actions
32 lines (28 loc) · 740 Bytes
/
Cardify.swift
File metadata and controls
32 lines (28 loc) · 740 Bytes
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
31
32
//
// Cardify.swift
// MemorizeDIY
//
// Created by Bob on 29.09.2023.
//
import SwiftUI
struct Cardify: ViewModifier {
var isFaceUp: Bool
func body(content: Content) -> some View {
ZStack {
if !isFaceUp {
RoundedRectangle(cornerRadius: 10)
.fill(MemorizeViewModel.themeModel.activeTheme.primaryColor)
}
else {
RoundedRectangle(cornerRadius: 10)
.stroke(MemorizeViewModel.themeModel.activeTheme.primaryColor, lineWidth: 5)
content
}
}
}
}
extension View {
func cardify(_ isFaceUp: Bool) -> some View {
self.modifier(Cardify(isFaceUp: isFaceUp))
}
}