본문 바로가기
FE 공부/Swift

Swift _ Activity Indicator View

by 꼬질꼬질두부 2022. 11. 15.

 

로딩 화면에서 많이 보이는 이 친구

 

 

A view that shows that a task is in progress.

로딩이 얼마나 지속될 지 모르는 경우 -> Activity Indicator 이용
로딩이 얼마나 지속될 지 아는 경우 -> progress view 이용

 

You control when an activity indicator animates by calling the startAnimating() and stopAnimating() methods. To automatically hide the activity indicator when animation stops, set the hidesWhenStopped property to true.

: 메서드를 호출해서 Activity Indicator가 활성화되는 시기를 컨트롤

 


Managind an Activity Indicator

 

func startAnimating()

Starts the animation of the progress indicator. : stopAnimating()이 나오기 전까지 indicator 활성화

 

func stopAnimating()

Stops the animation of the progress indicator. : indicator 활성화 멈춤
 

var isAnimating: Bool

A Boolean value indicating whether the activity indicator is currently running its animation. 

 : indicator 활성화가 되고 있는지를 알려주는지 bool 값

 

var hidesWhenStopped: Bool

A Boolean value that controls whether the activity indicator is hidden when the animation is stopped.

 : indicator 활성화가 멈췄을 때 activity indicator를 숨길지 말지 컨트롤 하는 bool 값


Activity Indicator appearance 설정

var style: UIActivityIndicatorView.Style
The basic appearance of the activity indicator.

 

var color: UIColor!
The color of the activity indicator.

'FE 공부 > Swift' 카테고리의 다른 글

Swift _ StackView  (0) 2022.11.15
Swift _ ProgressView  (0) 2022.11.15
Swift _ Stepper  (0) 2022.11.15
Swift _ Switch button  (0) 2022.11.15
Swift _ Generics  (0) 2022.10.11

댓글