Latest 1.0.2
Homepage https://github.com/JavenZ/DatePickerTextField
License Apache License, Version 2.0 Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Platforms ios , requires ARC
Frameworks UIKit
Authors

DatePickerTextField

一个好用的时间选择框

image

之前做时间选择框的时候,都感觉不方便,需要自己控制它的弹出和收起,添加阴影,并且还需要控制值的获取,遵守相应的代理方法等等,虽然说不复杂,但是这种简单的东西要重复写的话还是比较恶心人的。

导入

  • 手动导入
    • 直接把DatePickerTextField文件夹中的文件导入即可
  • cocoapods导入
    • pod ‘DatePickerTextField’, ‘~> 1.0.2’

使用

#import "MainTableViewController.h"
#import "DatePickerTextField.h"
@interface MainTableViewController ()
@property (weak, nonatomic) IBOutlet DatePickerTextField *ymdhms;

@end

@implementation MainTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //隐藏光标
    self.ymdhms.tintColor = [UIColor clearColor];
    //设置选择的日期格式
    self.ymdhms.type = DateTextFieldTime;
    //设置可选的日期范围
    self.ymdhms.rangeType  = DateTextFieldRangeBefore;

    //注:如果需要在datePicker上加toolBar的话,直接使用iqkeyboardmanager即可
}

只需要配置日期格式和可选日期范围就完成了一个日期选择输入框。可以通过storyboard创建或者通过代码创建,还是比较方便的。

Latest podspec

{
    "name": "DatePickerTextField",
    "version": "1.0.2",
    "summary": "DatePickerTextFieldu9009u62e9u65f6u95f4",
    "description": "DatePickerTextFieldu9009u62e9u65f6u95f4uff0cu5febu901fu9009u62e9",
    "homepage": "https://github.com/JavenZ/DatePickerTextField",
    "license": {
        "type": "Apache License, Version 2.0",
        "text": "    Licensed under the Apache License, Version 2.0 (the "License");n    you may not use this file except in compliance with the License.n    You may obtain a copy of the License atnn    http://www.apache.org/licenses/LICENSE-2.0nn    Unless required by applicable law or agreed to in writing, softwaren    distributed under the License is distributed on an "AS IS" BASIS,n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.n    See the License for the specific language governing permissions andn    limitations under the License.n"
    },
    "authors": {
        "JavenZ": "[email protected]"
    },
    "platforms": {
        "ios": null
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/JavenZ/DatePickerTextField.git",
        "tag": "1.0.2"
    },
    "source_files": "DatePickerTextFieldDemo/DatePickerTextField/*.{h,m}",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This