Instance Method
input(after:)
iOS 18.0+
iPadOS 18.0+
Mac Catalyst 18.0+
macOS 15.0+
tvOS 18.0+
watchOS 11.0+
The next input value after the given input.
func input(after input: Self.FormatInput) -> Self.FormatInput?
Return Value
The next “greater” input value that can be represented by FormatInput or an underlying representation the format style uses internally.
Discussion
Use this function to determine if the return value provided by discreteInput(before:) is precise enough for your use case for any input y:
guard let x = style.discreteInput(before: y) else {
return
}
let z = style.input(after: x) ?? y
If the distance between x and z is too large for the precision you require, you may want to manually probe format(_:) at a higher rate in that interval, as there is no guarantee for what the output will be in that interval.