Giter VIP home page Giter VIP logo

ewaddresspicker-oc's Introduction

EWAddressPicker-OC

996.icu

OC.地址选择器

前言:

原本为Swift版本AddressPicker.,因为有朋友需要一个OC版本,所以将其改写.但是由于有段时间没用OC了,所以可能会出现优化问题,这里我还是建议参考Swift版本.另如果发现任何问题请向我反馈,我好及时修改,谢谢.

实现效果:

controller弹出时:半透明背景渐变展示.地址选择器从下方弹出.

地址选择器:以省份,城市,地区三级进行选择,数据来自本地plist文件.有12个热门城市供快速选择,选择错误可以回选.

选择地区时进行将数据回调到上一控制器,点击页面空白区域退出controller.

controller消失时:背景渐变消失,地址选择器向下退出.


效果图预览

使用方法:

将EWAddressPicker文件夹拖入项目,调用时:

EWAddressViewController *VC = [[EWAddressViewController alloc]init];
///保证弹出viewController背景色为透明
self.definesPresentationContext = YES;
VC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
///block弱引用防止循环引用.
__weak typeof(self) weakSelf = self;
VC.backLocationString = ^(NSString *address, NSString *province, NSString *city, NSString *area) {
    // 返回选择数据,地址,省,市,区
    weakSelf.showLabel.text = address;
};
[self presentViewController:VC animated:true completion:nil];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.