🌀 오픈 라이브러리 NVActivityIndicatorView 를 활용한 튜토리얼
출처 : https://github.com/ninjaprox/NVActivityIndicatorView
- 다음과 같은 activity indicator 를 제공한다.
- initializer
- DispatchQueue 를 사용해보았다.
let indicator = NVActivityIndicatorView(frame: CGRect(x: 160, y: 300, width: 50, height: 50), type: .ballRotateChase, color: .black, padding: 0)
self.view.addSubview(indicator)
DispatchQueue.main.async {
indicator.startAnimating()
print("isAnimating : \(indicator.isAnimating)")
}
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
indicator.stopAnimating()
print("isAnimating : \(indicator.isAnimating)")
}