iOS/Swift 5-minute Tips: Activity Indicator on any ViewController

iOS/Swift 5-minute Tips: Activity Indicator on any ViewController

Accelebrate

5 лет назад

15,650 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@reemnote
@reemnote - 31.08.2023 12:02

شكراً لك, أضفته إلى مشروعي بنجاح وبسهولة! هذا المحتوى جيد

Ответить
@burhandundar5531
@burhandundar5531 - 26.06.2023 01:46

Really useful content. Thanks to this great video I added activity indicator into my project successfully. Thank you!

Ответить
@waheedafolabi6929
@waheedafolabi6929 - 21.09.2022 22:21

Though old, yet helpful!

Ответить
@lydlydlydlyd
@lydlydlydlyd - 19.08.2022 23:35

thanks

Ответить
@williamfarhang965
@williamfarhang965 - 18.05.2022 12:40

Mine doesn't stop

Ответить
@asherazeem3282
@asherazeem3282 - 19.12.2021 00:48

Great video. I have a question. When we remove view from super view but doesn't stop activity indicator. So will it stop or not?. Or will it effect on memory usage.

Ответить
@cminero07
@cminero07 - 18.11.2021 21:13

Thank you, very clean solution, I was wondering how to apply this in navigation controller to overlay the nav bar too

Ответить
@ZhouHaibo
@ZhouHaibo - 21.06.2021 09:25

Thank you, that is a great video. Is this aView act like a container View? And I'd like to put that aView property inside the extension closure, but it seems Apple not allow it.

Ответить
@ZhouHaibo
@ZhouHaibo - 21.06.2021 09:25

Thank you, that is a great video. Is this aView act like a container View? And I'd like to put that aView property inside the extension closure, but it seems Apple not allow it.

Ответить
@moenyo3977
@moenyo3977 - 15.04.2021 09:16

thank sir

Ответить
@AndreyB-rc1ij
@AndreyB-rc1ij - 28.02.2021 16:49

Nice and easy decision! Thank you! Well explanation!

Ответить
@user-tw4ut5kl4z
@user-tw4ut5kl4z - 16.12.2020 18:24

ty so much

Ответить
@tolbahamdi92
@tolbahamdi92 - 02.07.2020 01:49

GENIUS!!! THANK YOU , really helpful
if view controller have navigation bar , aView not appear above navigation bar , what problem ??

Ответить
@yoellanda1303
@yoellanda1303 - 25.05.2020 04:40

you have one more subscriber, thank you for the tip :D

Ответить
@timkrupen8880
@timkrupen8880 - 07.04.2020 19:31

Hi, thank you very much for this tutorial. Alas, it won't show. I have multiple viewControllers, where the data gets loaded from the database during segue preparation, so I wanted to have an indicator there. Therefore, I have put as follows:
self.showSpinner()
self.performSegue(...)
self.removeSpinner()

the code gets executed (I checked it with a print statement), yet there is no sign of the spinner or the view with a darker background. Do you have any idea what could be wrong?

Ответить
@lucaguitarplayer
@lucaguitarplayer - 04.04.2020 17:46

GENIUS!!! THANK YOU!!

Ответить
@profgallaugher
@profgallaugher - 29.03.2020 05:47

Thanks - really helpful. Quick question: I tried something similar using a private activity indicator, instead of a private view, e.g.: private var activityIndicator = UIActivityIndicatorView(). I added the indicator to the subview: onView.addSubview(activityIndicator), centered the activity indicator based on the onPoint view passed in, and instead of removing the view + setting it to nil, I just did: activityIndicator.stopAnimating(). I suspect I'm overlooking something (retain cycle) that prompted you to use the view and add the activityIndicator to the view, instead of the activityIndicator directly. My code works, but am wondering if I've forgotten something important. Thanks again for sharing knowledge in a very useful tutorial!

Ответить
@willasaskara
@willasaskara - 19.01.2020 21:16

this is what I'm looking for, Thanks you saved my day

Ответить
@simpleaspossible6777
@simpleaspossible6777 - 15.01.2020 06:54

this works also
func showLoading() {
guard let activityLoading = view.viewWithTag(1234) as? UIActivityIndicatorView else {
// create activity loading for first time
let activityLoading = UIActivityIndicatorView(style: .gray)
activityLoading.tag = 1234
view.addSubview(activityLoading)
activityLoading.startAnimating()
activityLoading.snp.makeConstraints { make in
make.center.equalTo(view)
}
return
}
if activityLoading.isAnimating == false {
activityLoading.startAnimating()
}
}

func dismissLoading() {
guard let activityLoading = view.viewWithTag(1234) as? UIActivityIndicatorView else { return }
if activityLoading.isAnimating == true {
activityLoading.stopAnimating()
}
}

Ответить
@khalilnooruddin8933
@khalilnooruddin8933 - 10.11.2019 22:11

this is a great presentation on handling the spin activity indicator. well presented.

Ответить
@mehrankamalifard27
@mehrankamalifard27 - 04.08.2019 22:43

thanks

Ответить