Latest 0.1.1
Homepage https://github.com/zhhlmr/ZHPopupView
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

A simple iOS Pop up View to display alert or dialog

Alt text

Usage

Alert View
ZHPopupView *popupView = [ZHPopupView popupNomralAlertViewInView:nil
                                                 backgroundStyle:ZHPopupViewBackgroundType_SimpleOpacity
                                                           title:@"Tips"
                                                         content:@"Confirm to delete/remove?"
                                                    buttonTitles:@[@"Cancel", @"Confirm"]
                                             confirmBtnTextColor:nil otherBtnTextColor:nil
                                              buttonPressedBlock:^(NSInteger btnIdx) {

                                              }];
[popupView present];
Dialog View
ZHPopupView *popupView = [ZHPopupView popUpDialogViewInView:nil
                                                    iconImg:[UIImage imageNamed:@"correct_icon"]
                                            backgroundStyle:ZHPopupViewBackgroundType_SimpleOpacity
                                                      title:@"Lorem Ipsum"
                                                    content:kRandomText
                                               buttonTitles:@[@"Cancel", @"Confirm"]
                                        confirmBtnTextColor:nil otherBtnTextColor:nil
                                         buttonPressedBlock:^(NSInteger btnIdx) {

                                         }];
[popupView present];

Properties

@property(nonatomic, strong) NSString *headTitle;// Title string
@property(nonatomic, strong) NSString *content; // Content String
@property(nonatomic, strong) UIImage *headIconImg; // head Icon Img

@property(nonatomic, strong) UIColor *headTitleColor; // Title Color
@property(nonatomic, strong) UIColor *contentTextColor; // Content Text Color

@property(nonatomic, assign) CGFloat headTitleFontSize;// Title font size
@property(nonatomic, assign) CGFloat contentTextFontSize;// Content font size

@property(nonatomic, assign) NSTextAlignment contentTextAlignment;// Content text Alignment
@property(nonatomic, assign) NSTextAlignment headTextAlignment; // Title Text Alignment

Callback


@property(nonatomic, copy) void (^buttonPressedBlock)(NSInteger btnIdx); // Button Click/Pressed callback

Background Display Type


typedef enum {

    ZHPopupViewBackgroundType_SimpleOpacity = 0, // Default
    ZHPopupViewBackgroundType_Blur = 1 // With Radius 10.0f , will adding setting property about blur effect

} ZHPopupViewBackgroundType;

Example

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

Requirements

Installation

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

pod "ZHPopupView"

Author

zhhlmr, [email protected]

License

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

Latest podspec

{
    "name": "ZHPopupView",
    "version": "0.1.1",
    "summary": "A simple iOS Pop up View to display alert or dialog",
    "description": "Simple iOS Pop up View to display alert or dialog, with blur/normal fade in display mode",
    "homepage": "https://github.com/zhhlmr/ZHPopupView",
    "license": "MIT",
    "authors": {
        "zhhlmr": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zhhlmr/ZHPopupView.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ZHPopupView/Classes/**/*"
}

Pin It on Pinterest

Share This