diff --git a/Sources/Vexillographer/FlagControl/FlagTextField+FloatingPoint.swift b/Sources/Vexillographer/FlagControl/FlagTextField+FloatingPoint.swift index 80529bd..97dfb1d 100644 --- a/Sources/Vexillographer/FlagControl/FlagTextField+FloatingPoint.swift +++ b/Sources/Vexillographer/FlagControl/FlagTextField+FloatingPoint.swift @@ -18,13 +18,13 @@ import Vexil extension FlagTextField where Value.BoxedValueType: BinaryFloatingPoint { init(configuration: FlagControlConfiguration) { - self = Self( + self.init( configuration: configuration, formatted: \.asString, editingFormat: { $0 }, ) #if os(iOS) || os(tvOS) - .keyboardType(.decimalPad) + keyboardType = .decimalPad #endif } @@ -56,13 +56,13 @@ extension FlagControlConfiguration: FloatingPointTextFieldRepresentable where Va extension FlagTextField { init(configuration: FlagControlConfiguration) where Value == Wrapped?, Wrapped.BoxedValueType: BinaryFloatingPoint { - self = Self( + self.init( configuration: configuration, formatted: \.asStringOrEmpty, editingFormat: { $0 }, ) #if os(iOS) || os(tvOS) - .keyboardType(.decimalPad) + keyboardType = .decimalPad #endif } diff --git a/Sources/Vexillographer/FlagControl/FlagTextField+Integer.swift b/Sources/Vexillographer/FlagControl/FlagTextField+Integer.swift index befd298..5cd9294 100644 --- a/Sources/Vexillographer/FlagControl/FlagTextField+Integer.swift +++ b/Sources/Vexillographer/FlagControl/FlagTextField+Integer.swift @@ -18,13 +18,13 @@ import Vexil extension FlagTextField where Value.BoxedValueType: BinaryInteger { init(configuration: FlagControlConfiguration) { - self = Self( + self.init( configuration: configuration, formatted: \.asString, editingFormat: { $0.filter(\.isNumber) }, ) #if os(iOS) || os(tvOS) - .keyboardType(.numberPad) + keyboardType = .numberPad #endif } @@ -56,13 +56,13 @@ extension FlagControlConfiguration: IntegerFlagTextFieldRepresentable where Valu extension FlagTextField { init(configuration: FlagControlConfiguration) where Value == Wrapped?, Wrapped.BoxedValueType: BinaryInteger { - self = Self( + self.init( configuration: configuration, formatted: \.asStringOrEmpty, editingFormat: { $0.filter(\.isNumber) }, ) #if os(iOS) || os(tvOS) - .keyboardType(.numberPad) + keyboardType = .numberPad #endif } diff --git a/Sources/Vexillographer/FlagControl/FlagTextField.swift b/Sources/Vexillographer/FlagControl/FlagTextField.swift index 4f95764..bf85a6b 100644 --- a/Sources/Vexillographer/FlagControl/FlagTextField.swift +++ b/Sources/Vexillographer/FlagControl/FlagTextField.swift @@ -27,7 +27,7 @@ struct FlagTextField: View { private var format: (String) -> String private var editingFormat: (String) -> String #if os(iOS) || os(tvOS) - private var keyboardType = UIKeyboardType.default + var keyboardType = UIKeyboardType.default #endif @State