iOS-国家代码选择功能github开源分享

来源:互联网 发布:梦幻西游175魔化生数据 编辑:程序博客网 时间:2024/06/04 01:13

三行代码集成国家区号选择功能

功能运行效果如图:
这里写图片描述

开源链接:
https://github.com/qxuewei/XWCountryCode

使用方法:

1.导入XWCountryCode类

2.在需要选择国家代码的事件中

 XWCountryCodeController *CountryCodeVC = [[XWCountryCodeController alloc] init];    //CountryCodeVC.deleagete = self;    //block    [CountryCodeVC toReturnCountryCode:^(NSString *countryCodeStr) {        //在此处实现最终选择后的界面处理        [self.countryCodeLB setText:countryCodeStr];    }];    [self presentViewController:CountryCodeVC animated:YES completion:nil];

界面传值提供了代理和block两种方式,自由选择

0 0
原创粉丝点击