A control for incrementing or decrementing a value.
음량 버튼으로 소리를 조정하는 것처럼 + - 를 통해 값 증감을 컨트롤
By default, pressing and holding a stepper’s button increments or decrements the stepper’s value repeatedly. The rate of change depends on how long the user continues pressing the control. To turn off this behavior, set the autorepeat property to false.
: 버튼을 누르거나 꾹 누르고 있으면 값이 변함. 오래 누르면 값이 계속 커지거나 작아지는데 이걸 막고 싶으면 autorepeat property를 false로 바꾸면 됨
The maximum value must be greater than or equal to the minimum value. If you set a maximum or minimum value that would break this invariant, both values are set to the new value. For example, if the minimum value is 200 and you set a maximum value of 100, then both the minimum and maximum become 200.
: 값의 최댓값은 최솟값 이상이어야 함
Stepper 설정
var isContinuous: Bool
If true, the stepper sends value change events immediately as the value changes during user interaction. If false, the stepper sends a value change event after user interaction ends.
The default value for this property is true.
: 사용자가 값을 변경할 때 바로 값을 변경할 것인지 사용자가 값을 다 변경한 후에 값을 변경할 것인지
var autorepeat: Bool
var wraps: Bool
If true, incrementing beyond maximumValue sets value to minimumValue; likewise, decrementing below minimumValue sets value to maximumValue. If false, the stepper doesn’t increment beyond maximumValue nor does it decrement below minimumValue but rather holds at those values.
The default value for this property is false.
: 예를 들어 stpper의 max 값이 10 인데 그 이상 증가 버튼이 눌릴 경우, wraps 값이 true 이면 최댓값이 최솟값으로 넘어가 최솟값부터 다시 시작 -> 0부터 다시 시작; 반대로 stpper 값이 이미 최솟값 0인데 감소 버튼이 더 눌린다면 최댓값 10으로 넘어가 다시 줄어듦
default 값은 false 임
var minimumValue: Double
var maximumValue: Double
var stepValue: Double
The step, or increment, value for the stepper : 얼마만큼 증가할지 결정하는 값
Stepper 값에 접근
var value: Double
'FE 공부 > Swift' 카테고리의 다른 글
Swift _ ProgressView (0) | 2022.11.15 |
---|---|
Swift _ Activity Indicator View (0) | 2022.11.15 |
Swift _ Switch button (0) | 2022.11.15 |
Swift _ Generics (0) | 2022.10.11 |
Swift _ Protocols (0) | 2022.10.11 |
댓글