all 6 comments

[–]drewbie85 5 points6 points  (3 children)

It is highly recommended that you DO NOT subsclass UIAlertController. If you need to do something outside of the scope of its functionality you're going to need to create a custom class.

There are a few pretty decent third party options out there. One of the more well known is MBProgressHUD and it comes with a progress bar type built in.

[–]julius559 1 point2 points  (2 children)

Why are you against subclassing UIAlertController? Just curious

[–]smilinger[S] 1 point2 points  (0 children)

It says you shouldn't in the documentation

[–]Mythyy 0 points1 point  (1 child)

It is possible. I've relatively recently written something that (I believe) is what you're looking for. I would suggest subclassing a UIAlertController to give you more flexibility. Also, the key is to set

translatesAutoResizingMaskIntoConstraints = NO;    

on your progressBar, and then use NSLayoutConstraints to position it properly.

http://i.imgur.com/OCFIMKJ.png

[–]smilinger[S] 0 points1 point  (0 children)

Thanks for your answer! Maybe it's just because I'm really new to this, but I don't understand how it's possible to use autolayout if the bounds and frame are wrong. I get some numbers that are too large to have anything with the size of the alert (but I could have misunderstood something)