Latest 0.1.2
Homepage https://github.com/zhenxingliu/DatePickerDialogSwift
License MIT
Platforms ios 9.0
Dependencies Hue
Authors

CI Status
Version
License
Platform

例子

截图

DatePickerDialogSwiftDatePickerDialogSwiftDatePickerDialogSwiftDatePickerDialogSwift

代码

func datePickerTapped() {
let locale = Locale(identifier: "zh")
let currentDate = Date()
var dateComponents = DateComponents()
dateComponents.month = -3
let threeMonthAgo = Calendar.current.date(byAdding: dateComponents, to: currentDate)
dateComponents.month = 12
let nextYearMonthAgo = Calendar.current.date(byAdding: dateComponents, to: currentDate)

let datePicker = LWDatePickerDialog(textColor: .red,
buttonColor: .red,
font: UIFont.boldSystemFont(ofSize: 17),
locale:locale ,
showCancelButton: true)
datePicker.show("选择日期",
doneButtonTitle: "确定",
cancelButtonTitle: "取消",
minimumDate: threeMonthAgo,
maximumDate: nextYearMonthAgo,
datePickerMode: .date) { (date) in
if let dt = date {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd"
self.textField.text = formatter.string(from: dt)
}
}
}

更多使用方法可以参照:DatePickerDialog-iOS-Swift做的一些个性化改进。

要求

Swift: 4.0
iOS:10.0及以上

安装

pod 'DatePickerDialogSwift'

Author

zhenxingLiu, [email protected]

特别感谢

@Squimer的工作,我的项目就是在它的DatePickerDialog-iOS-Swift做的一些个性化改进。

License

DatePickerDialogSwift is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "DatePickerDialogSwift",
    "version": "0.1.2",
    "summary": "u4e00u4e2au7b80u5355u6613u7528u7684u65e5u671fu9009u62e9u63a7u4ef6",
    "description": "u4e00u4e2au7b80u5355u6613u7528u7684u65e5u671fu9009u62e9u63a7u4ef6,u6b64u65e5u671fu63a7u4ef6u53c2u7167uff0chttps://github.com/squimer/DatePickerDialog-iOS-Swift/blob/master/Sources/DatePickerDialog.swiftu6240u6539u5199",
    "homepage": "https://github.com/zhenxingliu/DatePickerDialogSwift",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "zhenxingLiu": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zhenxingliu/DatePickerDialogSwift.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "DatePickerDialogSwift/Classes/**/*",
    "dependencies": {
        "Hue": [
            "~> 3.0.0"
        ]
    }
}

Pin It on Pinterest

Share This