23 lines
393 B
Swift
23 lines
393 B
Swift
import SwiftUI
|
|
|
|
extension View {
|
|
|
|
public func numberPad() -> some View {
|
|
#if os(iOS)
|
|
self.keyboardType(.numberPad)
|
|
#else
|
|
self
|
|
#endif
|
|
}
|
|
|
|
// The decimal pad autocompletes too quickly in the simulator, needs tested on an actual
|
|
// device.
|
|
public func decimalPad() -> some View {
|
|
#if os(iOS)
|
|
self.keyboardType(.decimalPad)
|
|
#else
|
|
self
|
|
#endif
|
|
}
|
|
}
|