Latest 1.0.1
Homepage https://github.com/tokorom/SSGentleAlertView
License MIT
Platforms ios 5.0, requires ARC
Authors
  • It is gentler than UIAlertView
  • It can be used in the same way as UIAlertView
  • It can be changed the Appearance unlike UIAlertView

Designed by Atsushi Morino

Look and feel

Default

SSGentleAlertViewDefault

Black

SSGentleAlertViewBlack

Native

SSGentleAlertViewNative

Supported UIAlertView’s properties and methods

@property (nonatomic, weak) id delegate;
@property (nonatomic, copy) NSString* title;
@property (nonatomic, copy) NSString* message;
@property (nonatomic, readonly, getter=isVisible) BOOL visible;
@property (nonatomic) NSInteger cancelButtonIndex;
@property (nonatomic, readonly) NSInteger numberOfButtons;

- (id)initWithTitle:(NSString*)title message:(NSString*)message delegate:(id)delegate cancelButtonTitle:(NSString*)cancelButtonTitle otherButtonTitles:(NSString*)otherButtonTitles, ...;
- (void)show;
- (NSInteger)addButtonWithTitle:(NSString*)title;
- (NSString*)buttonTitleAtIndex:(NSInteger)buttonIndex;

Additional functions

/*
 * If set YES to this property, the dialog can be closed in the tap to the background part
 */
@property (nonatomic) BOOL disappearWhenBackgroundClicked;

/*
 * It is possible to select 3 styles (SSGentleAlertViewStyleDefault or SSGentleAlertViewStyleBlack or SSGentleAlertViewStyleNative)
 * when you use the init method
 */
- (id)initWithStyle:(SSGentleAlertViewStyle)style;
- (id)initWithStyle:(SSGentleAlertViewStyle)style title:(NSString*)title message:(NSString*)message delegate:(id)delegate cancelButtonTitle:(NSString*)cancelButtonTitle otherButtonTitles:(NSString*)otherButtonTitles, ...;

Samle code

// #import "SSGentleAlertView.h"

// SSGentleAlertView can be used same way as UIAlertView

SSGentleAlertView* alert = SSGentleAlertView.new;
alert.delegate = self;
alert.title = @"SSGentleAlertView";
alert.message = @"This is GentleAlertView!nUIAlertView is too strong to use for ordinary messages.";
[alert addButtonWithTitle:@"Cancel"];
[alert addButtonWithTitle:@"OK"];
alert.cancelButtonIndex = 0;
[alert show];

Sample for customizing Appearance

SSGentleAlertViewCustomize

// #import "SSGentleAlertView.h"
// #import "SSDialogView.h"

alert.backgroundImageView.image = [UIImage imageNamed:@"dialog_bg"];
alert.dialogImageView.image = nil;

alert.titleLabel.textColor = [UIColor colorWithRed:1.0 green:0.5 blue:0.0 alpha:1.0];
alert.titleLabel.shadowColor = UIColor.clearColor;
alert.messageLabel.textColor = [UIColor colorWithRed:0.4 green:0.2 blue:0.0 alpha:1.0];
alert.messageLabel.shadowColor = UIColor.clearColor;

UIButton* button = [alert buttonBase];
] forState:UIControlStateNormal];
] forState:UIControlStateHighlighted];
;
;
[alert setButtonBase:button];
[alert setDefaultButtonBase:button];

Getting Started – Installing SSGentleAlertView

Please choose a way you prefer.

Using CocoaPods

// Podfile
pod 'SSGentleAlertView'

and

pod install

Using Git

git clone git://github.com/tokorom/SSGentleAlertView.git
// git submodule add git://github.com/tokorom/SSGentleAlertView.git Externals/SSGentleAlertView

and Add SSGentleAlertView subdirectory to your Xcode’s project.

Download a zip archive

Download
https://github.com/tokorom/SSGentleAlertView/archive/master.zip
and Add SSGentleAlertView subdirectory to your Xcode’s project.


English | Japanese

Latest podspec

{
    "name": "SSGentleAlertView",
    "version": "1.0.1",
    "summary": "This is gentler than UIAlertView and This can be changed the Appearance unlike UIAlertView.",
    "homepage": "https://github.com/tokorom/SSGentleAlertView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "tokorom": "[email protected]"
    },
    "source": {
        "git": "https://github.com/tokorom/SSGentleAlertView.git",
        "tag": "1.0.1"
    },
    "source_files": "SSGentleAlertView",
    "requires_arc": true,
    "resources": [
        "SSGentleAlertView/SSGentleAlertViewDefault/SSGentleAlertViewDefault.bundle",
        "SSGentleAlertView/SSGentleAlertViewDefault/SSGentleAlertViewDefault.xib",
        "SSGentleAlertView/SSGentleAlertViewDefault/SSGentleAlertButtonDefault.xib",
        "SSGentleAlertView/SSGentleAlertViewBlack/SSGentleAlertViewBlack.bundle",
        "SSGentleAlertView/SSGentleAlertViewBlack/SSGentleAlertViewBlack.xib",
        "SSGentleAlertView/SSGentleAlertViewBlack/SSGentleAlertButtonBlack.xib",
        "SSGentleAlertView/SSGentleAlertViewNative/SSGentleAlertViewNative.bundle",
        "SSGentleAlertView/SSGentleAlertViewNative/SSGentleAlertViewNative.xib",
        "SSGentleAlertView/SSGentleAlertViewNative/SSGentleAlertButtonNative.xib"
    ],
    "platforms": {
        "ios": "5.0"
    }
}

Pin It on Pinterest

Share This