forked from AparokshaUI/adwaita-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TransitionDemo.swift
42 lines (35 loc) · 878 Bytes
/
TransitionDemo.swift
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
33
34
35
36
37
38
39
40
41
42
//
// TransitionDemo.swift
// Adwaita
//
// Created by david-swift on 12.10.23.
//
// swiftlint:disable missing_docs no_magic_numbers
import Adwaita
struct TransitionDemo: View {
@State private var firstView = true
var view: Body {
VStack {
if firstView {
Text("First View")
.transition(.slideDown)
.accent()
} else {
Text("Second View")
.transition(.slideUp)
.success()
}
}
.modifyContent(Text.self) { $0.title2().padding() }
.card()
.frame(maxWidth: 200)
.padding()
Button("Toggle View") {
firstView.toggle()
}
.pill()
.padding()
.frame(maxWidth: 100)
}
}
// swiftlint:enable missing_docs no_magic_numbers