Latest 1.0.0
Homepage https://github.com/xiaopin/GHPopupEditView
License GPL v3
Platforms ios 7.0, requires ARC
Authors

[Build]()
[Pod Version]()
[Platform]()
[Device]()
[License]()

A popup view for editing information.

Preview

  • GIF
  • Preview
  • Preview

Usage

GHPopupEditView *popupView = [[GHPopupEditView alloc] init];
[popupView setTitle:@"edit nickname"];
[popupView setPlaceholderString:@"Please enter a nickname"];
[popupView setKeyboardType:UIKeyboardTypeDefault];
[popupView setOKButtonThemeColor:[UIColor orangeColor]];
[popupView setShouldChangeHandler:^(UITextField *textField, NSRange range, NSString *replacementString) {
    if (range.length == 0) { // add
        NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", @"[\w_]+"];
        return [predicate evaluateWithObject:replacementString];
    }
    return YES;
}];
[popupView setVerifyHandler:^(NSString *text) {
    NSString *nickname = ];
    if (nickname.length == 0) {
        return @"Nickname can not be empty.";
    }
    return @"";
}];
[popupView setCompletionHandler:^(NSString *text) {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:[NSString stringWithFormat:@"hello %@.", text] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
    [alert show];
}];
[popupView show];

Requirements

  • iOS 7.0+
  • Xcode 8.0+

Installation

Add manually:

  • Drag GHPopupEditView folder to your project.
  • Import header file: #import "GHPopupEditView.h"

Installation with CocoaPods

Podfile

platform :ios, '7.0'

target 'TargetName' do
    pod 'GHPopupEditView', '~> 1.0.0'
end

Then, run the following command:

$ pod install

License

GHPopupEditView is licensed under the GPL License – see the LICENSE file for details

Latest podspec

{
    "name": "GHPopupEditView",
    "version": "1.0.0",
    "summary": "A popup view for editing information.",
    "homepage": "https://github.com/xiaopin/GHPopupEditView",
    "license": "GPL v3",
    "authors": {
        "xiaopin": "[email protected]"
    },
    "social_media_url": "http://www.0daybug.com",
    "requires_arc": true,
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/xiaopin/GHPopupEditView.git",
        "tag": "1.0.0"
    },
    "source_files": "GHPopupEditView/*.{h,m}"
}

Pin It on Pinterest

Share This