Comparable
public extension Comparable
-
Returns the closest value that is contained in the given interval, if the number is already in the interval it returns the same value.
Declaration
Swift
func clamp(min: Self, max: Self) -> SelfParameters
minminimum value of the interval to use.
maxmaximum value of the interval to use.
Comparable Extension Reference