File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ private extension ExtendedDatePicker {
67
67
. contentShape ( Circle ( ) )
68
68
}
69
69
70
+ if options. spaceOutSymbols {
71
+ Spacer ( )
72
+ }
73
+
70
74
Group {
71
75
if let header = options. header {
72
76
header ( model. selectedDate)
@@ -79,6 +83,10 @@ private extension ExtendedDatePicker {
79
83
isPickerPresented = true
80
84
}
81
85
86
+ if options. spaceOutSymbols {
87
+ Spacer ( )
88
+ }
89
+
82
90
if shouldShowButtons {
83
91
Button {
84
92
model. didPressForward ( )
Original file line number Diff line number Diff line change @@ -5,19 +5,23 @@ import SwiftUI
5
5
public struct ExtendedDatePickerOptions {
6
6
let backSymbol : Image
7
7
let forwardSymbol : Image
8
+ // Push forward and back symbols to the edge.
9
+ let spaceOutSymbols : Bool
8
10
let header : ( ( Date ) -> AnyView ) ?
9
11
let spacing : CGFloat ?
10
12
let shouldUseWheelStyleDatePicker : ( ) -> Bool
11
13
12
14
public init (
13
15
backSymbol: Image = . init( systemName: " chevron.left " ) ,
14
16
forwardSymbol: Image = . init( systemName: " chevron.right " ) ,
17
+ spaceOutSymbols: Bool = false ,
15
18
header: ( ( Date ) -> AnyView ) ? = nil ,
16
19
spacing: CGFloat ? = nil ,
17
20
shouldUseWheelStyleDatePicker: Bool = true
18
21
) {
19
22
self . backSymbol = backSymbol
20
23
self . forwardSymbol = forwardSymbol
24
+ self . spaceOutSymbols = spaceOutSymbols
21
25
self . header = header
22
26
self . spacing = spacing
23
27
self . shouldUseWheelStyleDatePicker = {
You can’t perform that action at this time.
0 commit comments