Adding some controls to UIAlertView
was deprecated in iOS7 using addSubview
method. As I know Apple promised to add contentView
property.
iOS 7 is released now and I see that this property is not added. That is why I search for some custom solution with ability to add progress bar to this alertView. Something for example similar to TSAlertView, but more ready for using in iOS 7.
I wrote a full implementation of UIAlertView that mimics the complete UIAlertView API, but adds the contentView property we've all wanted for so long: SDCAlertView.
Here is a project on Github to add any UIView to an UIAlertView-looking dialog on iOS7.
(Copied from this StackOverflow thread.)
There wont be
UIAlertView
with custom views in iOS7, norcontentView
which Apple changed its mind about, soaddSubview
is impossible now inUIAlertView
.A good alternative will be SVProgressHUD, according to many threads in Apple's forum.
Edit:
There is officially no
addSubview
nor subclassing forUIAlertView
in iOS7.Other good alternatives:
ios-custom-alertview by wimagguc
MZFormSheetController.
For IOS7
For those who love simple and effective methods with out having to write lines of code. Here is a cool solution without using any other private frame works for adding subviews to ios 7 alert views,i.e.
[alertView setValue:imageView forKey:@"accessoryView"];
Sample code for better understanding,
Hope it helps some one,thanks :)
You can find simple solution without extra classes here
It is based on setting accessoryView for ordinary UIAlertView.