Git Product home page Git Product logo

ssgentlealertview's Introduction

SSGentleAlertView

  • 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];
[button setBackgroundImage:[SSDialogView resizableImage:[UIImage imageNamed:@"dialog_btn_normal"]] forState:UIControlStateNormal];
[button setBackgroundImage:[SSDialogView resizableImage:[UIImage imageNamed:@"dialog_btn_pressed"]] forState:UIControlStateHighlighted];
[button setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
[button setTitleColor:UIColor.whiteColor 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

ssgentlealertview's People

Contributors

tokorom avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.