File tree Expand file tree Collapse file tree 6 files changed +16
-1
lines changed
Layout Containers/Collection Containers Expand file tree Collapse file tree 6 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ import PackageDescription
6
6
let package = Package (
7
7
name: " LiveViewNative " ,
8
8
platforms: [
9
- . iOS( " 16.0 " )
9
+ . iOS( " 16.0 " ) ,
10
+ . macOS( " 13.0 " ) ,
10
11
] ,
11
12
products: [
12
13
// Products define the executables and libraries a package produces, and make them visible to other packages.
Original file line number Diff line number Diff line change @@ -56,8 +56,10 @@ struct BuiltinRegistry {
56
56
Link ( element: element, context: context)
57
57
case " divider " :
58
58
Divider ( )
59
+ #if !os(macOS)
59
60
case " edit-button " :
60
61
EditButton ( )
62
+ #endif
61
63
case " toggle " :
62
64
Toggle ( element: element, context: context)
63
65
case " phx-form " :
Original file line number Diff line number Diff line change @@ -45,10 +45,12 @@ private extension SwiftUI.List {
45
45
switch element. attributeValue ( for: " style " ) {
46
46
case nil , " plain " :
47
47
self . listStyle ( . plain)
48
+ #if !os(macOS)
48
49
case " grouped " :
49
50
self . listStyle ( . grouped)
50
51
case " inset-grouped " :
51
52
self . listStyle ( . insetGrouped)
53
+ #endif
52
54
default :
53
55
fatalError ( " Invalid list style ' \( element. attributeValue ( for: " name " ) !) ' " )
54
56
}
Original file line number Diff line number Diff line change @@ -26,8 +26,10 @@ struct SecureField<R: CustomRegistry>: TextFieldProtocol {
26
26
. focused ( $isFocused)
27
27
. applyTextFieldStyle ( textFieldStyle)
28
28
. applyAutocorrectionDisabled ( disableAutocorrection)
29
+ #if !os(macOS)
29
30
. textInputAutocapitalization( autocapitalization)
30
31
. applyKeyboardType ( keyboard)
32
+ #endif
31
33
. applySubmitLabel( submitLabel)
32
34
. onChange ( of: isFocused, perform: handleFocus)
33
35
}
Original file line number Diff line number Diff line change @@ -22,8 +22,10 @@ struct TextField<R: CustomRegistry>: TextFieldProtocol {
22
22
. focused ( $isFocused)
23
23
. applyTextFieldStyle ( textFieldStyle)
24
24
. applyAutocorrectionDisabled ( disableAutocorrection)
25
+ #if !os(macOS)
25
26
. textInputAutocapitalization( autocapitalization)
26
27
. applyKeyboardType ( keyboard)
28
+ #endif
27
29
. applySubmitLabel( submitLabel)
28
30
. onChange ( of: isFocused, perform: handleFocus)
29
31
}
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ extension TextFieldProtocol {
91
91
}
92
92
}
93
93
94
+ #if !os(macOS)
94
95
var autocapitalization : TextInputAutocapitalization ? {
95
96
switch element. attributeValue ( for: " autocapitalization " ) {
96
97
case " sentences " :
@@ -105,7 +106,9 @@ extension TextFieldProtocol {
105
106
return nil
106
107
}
107
108
}
109
+ #endif
108
110
111
+ #if !os(macOS)
109
112
var keyboard : UIKeyboardType ? {
110
113
switch element. attributeValue ( for: " keyboard " ) {
111
114
case " ascii-capable " :
@@ -134,6 +137,7 @@ extension TextFieldProtocol {
134
137
return nil
135
138
}
136
139
}
140
+ #endif
137
141
138
142
var submitLabel : SubmitLabel ? {
139
143
switch element. attributeValue ( for: " submit-label " ) {
@@ -196,6 +200,7 @@ extension View {
196
200
}
197
201
}
198
202
203
+ #if !os(macOS)
199
204
@ViewBuilder
200
205
func applyKeyboardType( _ keyboardType: UIKeyboardType ? ) -> some View {
201
206
if let keyboardType {
@@ -204,6 +209,7 @@ extension View {
204
209
self
205
210
}
206
211
}
212
+ #endif
207
213
208
214
@ViewBuilder
209
215
func applySubmitLabel( _ submitLabel: SubmitLabel ? ) -> some View {
You can’t perform that action at this time.
0 commit comments