@@ -9,33 +9,56 @@ import SwiftUI
99import SwiftNEW
1010
1111struct ContentView : View {
12- // MARK: - All States
12+
13+ @State var preview : String = " Normal "
14+
15+ // MARK: All States
1316 @State var showNew : Bool = false
1417 @State var align : HorizontalAlignment = . center
1518 @State var color : Color = . accentColor
1619 @State var size : String = " normal "
1720 @State var labelColor : Color = Color ( UIColor . systemBackground)
1821 @State var label : String = " Show Release Note "
1922 @State var labelImage : String = " arrow.up.circle.fill "
23+ @State var history : Bool = true
24+ @State var data : String = " data "
25+
2026 var body : some View {
2127 NavigationView {
22- // MARK: Choose either one size (Normal, Mini or invisible)
2328
24- // MARK: Normal
25- SwiftNEW ( show: $showNew, align: $align, color: $color, size: $size, labelColor: $labelColor, label: $label, labelImage: $labelImage)
29+ // MARK: Choose either one size (Normal, Mini or Invisible)
2630
27- . toolbar {
28- ToolbarItemGroup ( placement: . navigationBarLeading) {
29- // MARK: Invisible
30- SwiftNEW ( show: $showNew, align: $align, color: $color, size: . constant( " invisible " ) , labelColor: $labelColor, label: $label, labelImage: $labelImage)
31- }
32- ToolbarItemGroup ( placement: . navigationBarTrailing) {
33- // MARK: Mini
34- SwiftNEW ( show: $showNew, align: $align, color: $color, size: . constant( " mini " ) , labelColor: $labelColor, label: $label, labelImage: $labelImage)
35- }
31+ TabView ( selection: $preview) {
32+
33+ // MARK: - Normal
34+ SwiftNEW ( show: $showNew, align: $align, color: $color, size: $size, labelColor: $labelColor, label: $label, labelImage: $labelImage, history: $history, data: $data)
35+
36+ // Don't copy tabItem
37+ . tabItem { Text ( " Normal " ) } . tag ( " Normal " )
38+
39+ // MARK: - Mini (Toolbar only)
40+ Text ( " Compatible with Toolbar " )
41+ . tabItem { Text ( " Mini " ) } . tag ( " Mini " )
42+
43+ // MARK: - Invisible
44+ SwiftNEW ( show: $showNew, align: $align, color: $color, size: . constant( " invisible " ) , labelColor: $labelColor, label: $label, labelImage: $labelImage, history: $history, data: $data)
3645
46+ // Don't copy tabItem
47+ . tabItem { Text ( " Invisible " ) } . tag ( " Invisible " )
48+
49+ // MARK: - Remote Test (>3.0.0)
50+ // Firebase Real Time Database Demo
51+ 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 " ) )
52+
53+ // Don't copy tabItem
54+ . tabItem { Text ( " Remote " ) } . tag ( " Remote " )
55+
56+ }
57+ . toolbar {
58+ if preview == " Mini " {
59+ SwiftNEW ( show: $showNew, align: $align, color: $color, size: . constant( " mini " ) , labelColor: $labelColor, label: $label, labelImage: $labelImage, history: $history, data: $data)
3760 }
38-
61+ }
3962 }
4063 #if os(iOS)
4164 . navigationViewStyle( . stack)
0 commit comments