Latest 1.0.7
Homepage https://github.com/remember17/WHTimePicker
License MIT
Platforms ios 7.0, requires ARC
Dependencies Masonry
Frameworks UIKit
Authors

好用的时间选择器, 支持cocoapods, 可以直接在项目中 pod ‘WHTimePicker’
如果没找到, 请先pod setup, 然后再pod ‘WHTimePicker’

!注意:需要用到 Masonry 框架

在WHTimePicker.h文件中导入了#import "Masonry.h"
如果你的项目中没有Masonry,会自动帮你导入Masonry

img

使用方法

  1. 导入头文件

    a>> 直接在本网页下载使用:#import "WHTimePicker.h"
    b>> 或者利用CocoaPods安装到项目中:#import <WHTimePicker.h>
  2. 添加代理

    @interface ViewController () <WHPickerDelegate>
  3. 初始化创建WHTimePicker

    - (void)setupTimePicker{
    // 快速创建
    WHTimePicker *timePicker = [WHTimePicker timePickerWithType:DateArray];
    timePicker.delegate = self;
    // 显示时间选择器
    [timePicker show];
    
    // 顶部确定栏背景颜色,默认天蓝色
    picker.topTitleColor = [UIColor lightGrayColor];
    // 顶部"确定","类型","取消"按钮的文字颜色,默认白色
    picker.topBackColor = [UIColor blackColor];
    }
  4. 实现代理方法一

    /** 代理方法一 返回选择的字符串*/
    - (void)getSelectedString:(NSString *)string {
    NSLog(@"你选择了%@",string);
    ;
    }
  5. 实现代理方法二
    /** 代理方法二 时间选择器消失的时候回调*/
    - (void)timePickerDisappare {
    NSLog(@"时间选择器消失了~");
    }

MIT LICENSE

Latest podspec

{
    "name": "WHTimePicker",
    "version": "1.0.7",
    "summary": "u597du7528u7684u65f6u95f4u9009u62e9u5668.",
    "homepage": "https://github.com/remember17/WHTimePicker",
    "license": "MIT",
    "authors": {
        "wuhao": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/remember17/WHTimePicker.git",
        "tag": "1.0.7"
    },
    "source_files": [
        "WHTimePicker",
        "WHTimePicker/*.{h,m}"
    ],
    "frameworks": "UIKit",
    "requires_arc": true,
    "dependencies": {
        "Masonry": []
    }
}

Pin It on Pinterest

Share This