Skip to content

WCAlertView is deliverd from UIAlertView. It's support customization and blocks.

License

Notifications You must be signed in to change notification settings

m1entus/WCAlertView

Repository files navigation

WCAlertView

For iOS 8 and above support use my UIAlertController category which works simillar

UIAlertController-MZStyle

iOS 7 and above not supported !

In iOS7, the UIAlertView window does not appear in -[UIApplication windows]. In fact, the UIAlertView itself is never added to any window, -[UIAlertView window] is always nil. Instead, the alert view manages a variety of undocumented views placed in -[UIApplication keyWindow] with no reference back to the alert view.

More informaction on freecoder blog

Stackoverflow issue

Info

WCAlertView is a subclass from UIAlertView with possibility of customization.

You can easly customize your UIAlertView.

How To Use

There are a couple of predefined styles, you might use them instead of writing your own.

WCAlertView supports blocks.

You might set default appearance for all WCAlertView's:

[WCAlertView setDefaultStyle:WCAlertViewStyleWhite];

Set default appearnce block for all WCAlertView's inside AppDelegate (similar to UIAppearance proxy)

[WCAlertView setDefaultCustomiaztonBlock:^(WCAlertView *alertView) {
        alertView.labelTextColor = [UIColor colorWithRed:0.11f green:0.08f blue:0.39f alpha:1.00f];
        alertView.labelShadowColor = [UIColor whiteColor];
        
        UIColor *topGradient = [UIColor colorWithRed:1.0f green:1.0f blue: