@@ -10,49 +10,50 @@ import SwiftNEW
10
10
11
11
struct ContentView : View {
12
12
13
- @State var preview : String = " Normal "
13
+ @State var preview : String = " Simple "
14
14
15
15
// MARK: All States
16
16
@State var showNew : Bool = false
17
- @State var align : HorizontalAlignment = . center
18
- @State var color : Color = . accentColor
19
- @State var size : String = " normal "
20
- #if os(iOS) || os(xrOS)
21
- @State var labelColor : Color = Color ( UIColor . systemBackground)
22
- #elseif os(macOS)
23
- @State var labelColor : Color = Color ( NSColor . windowBackgroundColor)
24
- #endif
25
- @State var label : String = " Show Release Note "
26
- @State var labelImage : String = " arrow.up.circle.fill "
27
- @State var history : Bool = true
28
- @State var data : String = " data "
29
- @State var showDrop : Bool = false
17
+ // Optional
18
+ // @State var align: HorizontalAlignment = .center
19
+ // @State var color: Color = .accentColor
20
+ // @State var size: String = "simple"
21
+ // #if os(iOS) || os(visionOS)
22
+ // @State var labelColor: Color = Color(UIColor.systemBackground)
23
+ // #elseif os(macOS)
24
+ // @State var labelColor: Color = Color(NSColor.windowBackgroundColor)
25
+ // #endif
26
+ // @State var label: String = "Show Release Note"
27
+ // @State var labelImage: String = "arrow.up.circle.fill"
28
+ // @State var history: Bool = true
29
+ // @State var data: String = "data"
30
+ // @State var showDrop: Bool = false
30
31
31
- var normal : some View {
32
- SwiftNEW ( show: $showNew, align : $align , color : $color , size : $size , labelColor : $labelColor , label : $label , labelImage : $labelImage , history : $history , data : $data , showDrop : $showDrop )
32
+ var simple : some View {
33
+ SwiftNEW ( show: $showNew)
33
34
}
34
35
35
36
var mini : some View {
36
37
// MARK: Mini (Toolbar / List only)
37
38
List {
38
39
Section ( header: Text ( " Compatible with Toolbar / List " ) ) {
39
- SwiftNEW ( show: $showNew, align : $align , color : $color , size: . constant( " mini " ) , labelColor : $labelColor , label : $label , labelImage : $labelImage , history : $history , data : $data , showDrop : $showDrop )
40
+ SwiftNEW ( show: $showNew, size: . constant( " mini " ) )
40
41
}
41
42
}
42
43
}
43
44
44
45
var invisible : some View {
45
- SwiftNEW ( show: $showNew, align : $align , color : $color , size: . constant( " invisible " ) , labelColor : $labelColor , label : $label , labelImage : $labelImage , history : $history , data : $data , showDrop : $showDrop )
46
+ SwiftNEW ( show: $showNew, size: . constant( " invisible " ) )
46
47
}
47
48
48
49
var remote : some View {
49
50
// MARK: Remote (>3.0.0) - Firebase Real Time Database Demo (Compatible with json format)
50
- SwiftNEW ( show: $showNew, align : $align , color : $color , size : $size , labelColor : $labelColor , label : $label , labelImage: . constant( " icloud " ) , history : $history , data: . constant( " https://testground-a937f-default-rtdb.firebaseio.com/.json?print=pretty " ) , showDrop : $showDrop )
51
+ SwiftNEW ( show: $showNew, labelImage: . constant( " icloud " ) , data: . constant( " https://testground-a937f-default-rtdb.firebaseio.com/.json?print=pretty " ) )
51
52
}
52
53
53
54
var drop : some View {
54
55
// MARK: Drop (>3.4.0) - Recommended trigger with Remote Notification
55
- SwiftNEW ( show: $showNew, align : $align , color : $color , size : $size , labelColor : $labelColor , label: . constant( " Notification " ) , labelImage: . constant( " bell.badge " ) , history : $history , data: . constant( " https://testground-a937f-default-rtdb.firebaseio.com/.json?print=pretty " ) , showDrop: . constant( true ) )
56
+ SwiftNEW ( show: $showNew, label: . constant( " Notification " ) , labelImage: . constant( " bell.badge " ) , data: . constant( " https://testground-a937f-default-rtdb.firebaseio.com/.json?print=pretty " ) , showDrop: . constant( true ) )
56
57
}
57
58
58
59
var body : some View {
@@ -61,19 +62,19 @@ struct ContentView: View {
61
62
tab
62
63
}
63
64
. navigationViewStyle ( . stack)
64
- #elseif os(macOS) || os(xrOS )
65
+ #elseif os(macOS) || os(visionOS )
65
66
tab. padding ( )
66
67
#endif
67
68
}
68
69
69
70
var tab : some View {
70
- // MARK: Choose either one size (Normal , Mini or Invisible)
71
+ // MARK: Choose either one size (Simple , Mini or Invisible)
71
72
TabView ( selection: $preview) {
72
- normal
73
+ simple
73
74
. tabItem {
74
- Label ( " Normal " , systemImage: " textformat.size.larger " )
75
+ Label ( " Simple " , systemImage: " textformat.size.larger " )
75
76
}
76
- . tag ( " Normal " )
77
+ . tag ( " Simple " )
77
78
mini
78
79
. tabItem {
79
80
Label ( " Mini " , systemImage: " textformat.size.smaller " )
@@ -99,7 +100,7 @@ struct ContentView: View {
99
100
}
100
101
. toolbar {
101
102
if preview == " Mini " {
102
- SwiftNEW ( show: $showNew, align : $align , color : $color , size: . constant( " mini " ) , labelColor : $labelColor , label : $label , labelImage : $labelImage , history : $history , data : $data , showDrop : $showDrop )
103
+ SwiftNEW ( show: $showNew, size: . constant( " mini " ) )
103
104
}
104
105
}
105
106
}
0 commit comments