Latest 1.0.9
Homepage https://github.com/90candy/YWChooseAddressView
License MIT
Platforms ios 8.0, requires ARC
Dependencies FMDB
Authors

Pod
Platform
License
Author

高仿淘宝地区选择器、编辑与新增地址UI

一、UI效果图

图片名称图片名称图片名称

二、具体功能:

1、可直接从通讯录获取联系人信息(姓名、电话)

2、可是用封装好的高仿淘宝UI直接进行新增或编辑地址信息

三、推荐使用CocoaPods方式集成

1、在podfile文件中添加,然后执行 pod install操作

pod 'YWChooseAddressView', '~> 1.0.8'

2、在基类或者将要使用的界面导入YWAddressDataTool,本地初始化地区信息数据库

#import "YWAddressDataTool.h"

- (void)viewDidLoad {
    [super viewDidLoad];
    // 开启异步线程初始化数据
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        // 预加载地区信息到本地数据库(避免UI卡顿)
        [[YWAddressDataTool sharedManager] requestGetData];
    });
}

3、如果使用高仿淘宝UI则直接导入YWUI文件夹中的YWAddressViewController.h

// 这里传入需要编辑的地址信息(如果为新增地址则无需传入model)
YWAddressViewController *addressVC = [[YWAddressViewController alloc] init];
YWAddressInfoModel *model = [YWAddressInfoModel alloc];
model.phoneStr = @"18888888888";
model.nameSrt = @"袁伟";
model.areaAddress = @"四川省成都市武侯区";
model.detailAddress = @"下一站都市B座406";
model.isDefaultAddress = YES; // 如果是默认地址则传入YES
addressVC.model = model;
// 保存后的地址回调
addressVC.addressBlock = ^(YWAddressInfoModel *model) {
    NSLog(@"用户地址信息填写回调:");
    NSLog(@"姓名:%@", model.nameStr);
    NSLog(@"电话:%@", model.phoneStr);
    NSLog(@"地区:%@", model.areaAddress);
    NSLog(@"详细地址:%@", model.detailAddress);
    NSLog(@"是否设为默认:%@", model.isDefaultAddress ? @"是" : @"不是");
};
[self.navigationController pushViewController:addressVC animated:YES];

4、如果使用高仿淘宝UI则还需在Info.plist中添加通讯录权限

key值:Privacy - Contacts Usage Description
value值:如果不允许,则无法从通讯录中选择联系人信息

简书地址:https://www.jianshu.com/p/cd7b97a53603

图片名称

Latest podspec

{
    "name": "YWChooseAddressView",
    "version": "1.0.9",
    "summary": "u9ad8u4effu6dd8u5b9du5730u533au9009u62e9u5668u3001u7f16u8f91u4e0eu65b0u589eu5730u5740UI",
    "description": "u9ad8u4effu6dd8u5b9du5730u533au9009u62e9u5668u3001u7f16u8f91u5730u5740UIu3001u65b0u589eu5730u5740UI",
    "homepage": "https://github.com/90candy/YWChooseAddressView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u963fu552fu4e0du77e5u9053": "[email protected]"
    },
    "social_media_url": "https://www.jianshu.com/u/0f7d26d766f4",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/90candy/YWChooseAddressView.git",
        "tag": "1.0.9"
    },
    "source_files": "YWChooseAddress/YWChooseAddressView/**/*.{h,m}",
    "resources": "YWChooseAddress/YWChooseAddressView/Resource/*.{png,json,xib}",
    "requires_arc": true,
    "dependencies": {
        "FMDB": []
    }
}

Pin It on Pinterest

Share This