-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContentView.swift
More file actions
86 lines (75 loc) 路 2.53 KB
/
Copy pathContentView.swift
File metadata and controls
86 lines (75 loc) 路 2.53 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//
// ContentView.swift
// RouterExample
//
// Created by burt on 2021/03/05.
//
import SwiftUI
import Router
struct ContentView: View {
@EnvironmentObject
var router: Router
@State
var count = 1
var body: some View {
VStack(spacing: 48) {
Button("Go to Red") {
router.route("myapp://color?color=red", .push)
}
Text("\(count)")
.font(.title)
Button("Go to Counter Sheet") {
//router.route("myapp://color?color=red", .sheet)
router.builder()
.route("myapp://counter")
.presentation(mode: .sheet)
.binding(name: "count", to: $count)
.go()
}
Button("FormSheet") {
router.builder()
.route("myapp://counter")
.presentation(mode: .formSheet)
.binding(name: "count", to: $count)
.go()
}
Button("currentContext") {
router.builder()
.route("myapp://counter")
.presentation(mode: .currentContext)
.transition(style: .crossDissolve)
.binding(name: "count", to: $count)
.go()
}
Button("overCurrentContext") {
router.builder()
.route("myapp://counter")
.presentation(mode: .overCurrentContext)
.transition(style: .crossDissolve)
.binding(name: "count", to: $count)
.go()
}
Button("fullscreen") {
router.builder()
.route("myapp://counter")
.presentation(mode: .fullscreen)
.transition(style: .crossDissolve)
.binding(name: "count", to: $count)
.go()
}
Button("overFullscreen") {
router.builder()
.route("myapp://counter")
.presentation(mode: .overFullscreen)
.transition(style: .crossDissolve)
.binding(name: "count", to: $count)
.go()
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}