Git Product home page Git Product logo

opinionzalertview's Introduction

OpinionzAlertView

CI Status Version License Platform

Introduction

Beautiful customizable alert view with blocks. Choose from predefined icons for info, warning, success and error alerts. Customize color or set your desired image.

Preview

Preview

Installation

###Cocoapods

OpinionzAlertView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'OpinionzAlertView'

###Manual

  1. Add the OpinionzAlertView code into your project.

Usage

NOTE: prompt it after your view did appeared

###Example

To run the example project, clone the repo, and run pod install from the Example directory first.

//
//  ViewController.m
//  Demo
//
//  Created by Opinionz.io on 18/08/15.
//  Copyright (c) 2015 Opinionz.io. All rights reserved.
//

#import "ViewController.h"

#import <OpinionzAlertView/OpinionzAlertView.h>

- (IBAction)buttonHandlerAlert:(id)sender {

    OpinionzAlertView *alertView = [[OpinionzAlertView alloc] initWithTitle:@"Title"
                                                                    message:@"message"
                                                          cancelButtonTitle:@"Cancel"
                                                          otherButtonTitles:nil];

    //    alertView = [[OpinionzAlertView alloc] initWithTitle:@"Title"
    //                                                 message:@"message"
    //                                       cancelButtonTitle:@"Cancel"
    //                                       otherButtonTitles:nil
    //                                 usingBlockWhenTapButton:^(OpinionzAlertView *alertView, NSInteger buttonIndex) {
    //                                     
    //                                     NSLog(@"Tapped button at index : %li", (long)buttonIndex);
    //                                     NSLog(@"buttonTitle: %@", [alertView buttonTitleAtIndex:buttonIndex]);
    //                                 }];

    [alertView show];
}

Configuration

Set title, message, cancelButtonTitle and otherButtonTitles.

Properties

The OpinionzAlertView has the following properties:

@property (nonatomic, strong) UIColor *color;

Color of header backgound

@property (nonatomic, strong) UIImage *icon;

Icon on header

@property (nonatomic, assign) OpinionzAlertIcon iconType;

Or you can choose icon type

typedef enum : NSUInteger {
    OpinionzAlertIconInfo = 1,
    OpinionzAlertIconWarning,
    OpinionzAlertIconSuccess,
    OpinionzAlertIconQuestion,
    OpinionzAlertIconStar,
    OpinionzAlertIconHeart
} OpinionzAlertIcon;
@property (nonatomic, assign) id<OpinionzAlertViewDelegate> delegate;

Alert view delegate

@property (nonatomic, copy) OpinionzPopupViewTapButtonBlock buttonDidTappedBlock;

Alert view tap block

Methods

The OpinionzAlertView class has following methods:

- (instancetype)initWithTitle:(NSString *)title
                      message:(NSString *)message
            cancelButtonTitle:(NSString *)cancelButtonTitle
            otherButtonTitles:(NSArray *)otherButtonTitles;

- (instancetype)initWithTitle:(NSString *)title
                      message:(NSString *)message
                     delegate:(id /*<OpinionzAlertViewDelegate>*/)delegate
            cancelButtonTitle:(NSString *)cancelButtonTitle
            otherButtonTitles:(NSArray *)otherButtonTitles;

- (instancetype)initWithTitle:(NSString *)title
                      message:(NSString *)message
            cancelButtonTitle:(NSString *)cancelButtonTitle
            otherButtonTitles:(NSArray *)otherButtonTitles
      usingBlockWhenTapButton:(OpinionzPopupViewTapButtonBlock)tapButtonBlock;

- (void)show;

- (void)dismiss;

- (NSString *)buttonTitleAtIndex:(NSInteger)buttonIndex;

Supported OS & SDK Versions

  • Supported build target - iOS 7.0 (Xcode 6.2)

ARC Compatibility

OpinionzAlertView requires ARC.

Author

Opinionz.io, [email protected]

License

OpinionzAlertView is available under the MIT license. See the LICENSE file for more info.

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.