多数 App 都有手机注册,选择“号码所属区域”(例如+86,+1 等)是个不起眼、却不可缺少的功能,可竟然没有发现 iOS 有现成可用的(找了一阵子没找到,如果有更好的,告诉俺哈)。只能自己造一个,分享给大家。
https://github.com/everettjf/EVTPhoneAreaCodeViewController
使用比较简单。
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];
