본문 바로가기
모바일앱/iOS

Progress Bar(2)

by GeekCode 2022. 2. 17.
반응형

UIProgressView 구현 방법

  • 핵심
    • progressView.progress = 0.1: progress의 위치 (0 ~ 1)
    • progressView.setProgress(_:animated:): progress의 위치 + 애니메이션 적용 (0 ~ 1)

 

https://ios-development.tistory.com/741

 

[iOS - swift] UIProgressView (로딩, 프로그래스 바)

UIProgressView Loading이 얼마나 지속되는지 알 수 있는 경우 UIProgressView를 사용 Loading이 얼마나 지속될지 알 수 없는 경우는 Spinner (UIActivityIndicatorView) 사용 UIProgressView 구현 방법 핵심 pr..

ios-development.tistory.com

다른 분들은 타이머를 이용해 하는 분들이 많았지만

 

저같은 경우는 남은 시간을 API 호출을 통해 계속  호출받는데

 

.progress = 0.1

.setprogress(Float(남은시간)), animated:true)

 

부드럽게 애니메이션이 올라가는 장면을 만들 수있다.

.setprogress 혹은 이게 들어간 함수는 view will appear함수를 타는게 용이하다.

반응형

'모바일앱 > iOS' 카테고리의 다른 글

component와 split 함수 그리고 map함수  (0) 2022.03.07
노치 부분까지 레이아웃 설정하는 방법  (0) 2022.02.24
JSON이란  (0) 2022.02.23
App의 생명주기  (0) 2022.02.22
Progress Bar  (0) 2022.02.16
xib의 이름으로 화면전환하기 (present)  (0) 2022.02.14
serial(직렬)과 Concurrent(동시)  (0) 2022.01.17
Operation  (0) 2022.01.15