测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
发布最新发布 | 2016年6月 |
由 everettjf 维护。
轻松将电话区号选择功能添加到您的应用程序中。
EVTPhoneAreaCodeViewController *vc = [[EVTPhoneAreaCodeViewController alloc]init];
vc.completion = ^(NSString *name, NSString *code){
UIButton *b = sender;
[b setTitle:[NSString stringWithFormat:@"+%@ %@",code,name] forState:UIControlStateNormal];
};
[self.navigationController pushViewController:vc animated:YES];
您可以通过提供主题类来自定义很多属性。
@interface EVTPhoneAreaCodeViewControllerTheme : NSObject
// Background
@property (strong,nonatomic) UIColor *backgroundColor;
// Section
@property (strong,nonatomic) UIColor *sectionBackgroundColor;
@property (strong,nonatomic) UIColor *sectionForegroundColor;
@property (assign,nonatomic) CGFloat sectionHeight;
@property (strong,nonatomic) UIFont *sectionFont;
// Section Index
@property (strong,nonatomic) UIColor *sectionIndexBackgroundColor;
@property (strong,nonatomic) UIColor *sectionIndexColor;
// TableView
@property (strong,nonatomic) UIColor *tableViewBackgroundColor;
@property (strong,nonatomic) UIColor *tableViewSeparatorColor;
// ViewController
@property (copy,nonatomic) NSString *title;
@property (copy,nonatomic) NSString *titleEn;
// SearchBar
@property (copy,nonatomic) NSString *searchBarPlaceHolder;
@property (copy,nonatomic) NSString *searchBarPlaceHolderEn;
@property (strong,nonatomic) UIColor *searchBarTintColor;
@property (strong,nonatomic) UIColor *searchBarBackgroundColor;
+ (EVTPhoneAreaCodeViewControllerTheme*)defaultTheme;
+ (EVTPhoneAreaCodeViewControllerTheme*)whiteTheme;
+ (EVTPhoneAreaCodeViewControllerTheme*)grayTheme;
+ (EVTPhoneAreaCodeViewControllerTheme*)greenTheme;
+ (EVTPhoneAreaCodeViewControllerTheme*)redTheme;
+ (EVTPhoneAreaCodeViewControllerTheme*)orangeTheme;
@end
EVTPhoneAreaCodeViewControllerTheme *theme = [[EVTPhoneAreaCodeViewControllerTheme alloc]init];
EVTPhoneAreaCodeViewController *vc = [[EVTPhoneAreaCodeViewController alloc]init];
vc.theme = theme;
//...
要运行示例项目,请先从存储库中克隆,然后在 Example 目录中首先运行 pod install
>= iOS 7.0
EVTPhoneAreaCodeViewController 可通过 CocoaPods 获得。要安装它,只需将以下行添加到您的 Podfile 中
pod "EVTPhoneAreaCodeViewController"
everettjf, [email protected]
EVTPhoneAreaCodeViewController 可以在 MIT 许可证下获得。请参阅 LICENSE 文件以获取更多信息。