GHPopupEditView 1.0.0

GHPopupEditView 1.0.0

测试已测试
语言语言 Obj-CObjective C
许可证 GPL 3
发布日期最后发布2016年12月

xiaopin 维护。



一个用于编辑信息的弹出视图。

预览

  • GIF
  • Preview
  • Preview

使用方法

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 = [text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
    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];

需求

  • iOS 7.0+
  • Xcode 8.0+

安装

手动添加

  • GHPopupEditView 文件夹拖到你的项目中。
  • 导入头文件:#import "GHPopupEditView.h"

许可证

GHPopupEditView 适用于 GPL 许可证 - 详细信息请查看 LICENSE 文件