@@ -59,12 +59,14 @@ struct ViewConfigurationDemo_Previews: PreviewProvider {
59
59
}
60
60
61
61
struct ViewConfigurationDemoContainerConfiguration : ContainerConfigurationProtocol {
62
- var queueType : ContainerViewQueueType = . oneByOne
62
+ var queueType : ContainerViewQueueType = . multiple
63
63
var displayType : ContainerViewDisplayType = . stacking
64
64
65
65
var insets : EdgeInsets {
66
66
. init( top: 30 , leading: 30 , bottom: 30 , trailing: 30 )
67
67
}
68
+
69
+ var displayOrder : ContainerDisplayOrder = . descending
68
70
}
69
71
70
72
extension ContainerConfigurationProtocol where Self == ViewConfigurationDemoContainerConfiguration {
@@ -74,23 +76,23 @@ extension ContainerConfigurationProtocol where Self == ViewConfigurationDemoCont
74
76
}
75
77
76
78
class ViewConfigurationDemoContainerViewConfiguration : ContainerViewConfigurationProtocol {
77
- var alignment : Alignment ? {
79
+ var alignment : Alignment ? = {
78
80
[ . leading, . topLeading, . bottomLeading, . center, . bottom, . topTrailing, . bottomTrailing, . top, . trailing] . randomElement ( )
79
- }
81
+ } ( )
80
82
81
- var shadowStyle : ContainerViewShadowStyle ? {
83
+ var shadowStyle : ContainerViewShadowStyle ? = {
82
84
let color : Color = [ . blue, . green, . brown, . black] . randomElement ( ) ?? . red
83
85
let x = CGFloat . random ( in: - 5 ... 5 )
84
86
let y = CGFloat . random ( in: - 5 ... 5 )
85
87
let radius = CGFloat . random ( in: 5 ... 14 )
86
88
return [ . radius( radius) , . disable, . custom( color, 10 , x, y) ] . randomElement ( )
87
- }
89
+ } ( )
88
90
89
91
var dismissGesture : ContainerViewDismissGesture ? {
90
92
. tap
91
93
}
92
94
93
- var transition : AnyTransition ? {
95
+ var transition : AnyTransition ? = {
94
96
let t1 : AnyTransition = . opacity
95
97
let t2 : AnyTransition = . move( edge: . trailing) . combined ( with: . opacity)
96
98
let t3 : AnyTransition = . slide. combined ( with: . opacity)
@@ -99,16 +101,14 @@ class ViewConfigurationDemoContainerViewConfiguration: ContainerViewConfiguratio
99
101
let t6 : AnyTransition = . asymmetric( insertion: t4, removal: t1)
100
102
let t7 : AnyTransition = . asymmetric( insertion: t2, removal: t4)
101
103
return [ t1, t2, t3, t4, t5, t6, t7] . randomElement ( )
102
- }
104
+ } ( )
103
105
104
- var autoDismiss : ContainerViewAutoDismiss ? {
105
- . seconds( 2 )
106
- }
106
+ var autoDismiss : ContainerViewAutoDismiss ? = . seconds( 2 )
107
107
108
- var animation : Animation ? {
108
+ var animation : Animation ? = {
109
109
let speed = Double . random ( in: 0.3 ... 1.5 )
110
110
return [ . easeIn, . easeInOut, . linear, . spring( ) . speed ( speed) , . interactiveSpring( ) ] . randomElement ( )
111
- }
111
+ } ( )
112
112
}
113
113
114
114
extension ContainerViewConfigurationProtocol where Self == ViewConfigurationDemoContainerViewConfiguration {
0 commit comments