Latest 1.0.0
Homepage https://github.com/YuraChudnick/YCActionSheetDatePicker
License MIT
Platforms ios 10.0
Authors

CocoaPods Compatible
Platform
Language

YCActionSheetDatePicker

Installation

For YCBarcodeReader, use the following entry in your Podfile:


pod 'YCActionSheetDatePicker'

Then run pod install.

In any file you’d like to use YCBarcodeReader in, don’t forget to import the framework with import YCActionSheetDatePicker.

Usage

To use this action sheet you need to create YCActionSheetDatePickerVC and set delegate for receive date. Then present created YCActionSheetDatePickerVC.

import UIKit
import YCActionSheetDatePicker

class ViewController: UIViewController {

    @IBAction func showDatePicker(_ sender: Any) {
        present(createActionSheetDatePicker(), animated: true, completion: nil)
    }

    private func createActionSheetDatePicker() -> YCActionSheetDatePickerVC {
        let vc = YCActionSheetDatePickerVC()
        vc.delegate = self
        return vc
    }
}

extension ViewController: YCActionSheetDatePickerDelegate {

    func datePicker(selected date: Date) {
        print(date)
    }

}

Also you can customize and setup DatePicker, Select Button, Title Label programmatically.

import UIKit
import YCActionSheetDatePicker

class ViewController: UIViewController {

    @IBAction func showDatePicker(_ sender: Any) {
        present(createActionSheetDatePicker(), animated: true, completion: nil)
    }

    private func createActionSheetDatePicker() -> YCActionSheetDatePickerVC {
        let vc = YCActionSheetDatePickerVC()
        vc.datePickerView.contentViewCornerRadius = 10
        vc.datePickerView.contentViewInsets = .zero
        vc.datePickerView.selectButtonCornerRadius = 10
        vc.datePickerView.selectButtonInsets = .zero
        vc.datePickerView.titleLabel.text = "Select date"
        vc.datePickerView.titleLabel.font = UIFont.systemFont(ofSize: 15)
        vc.callback = { [weak self] date in
            print(date)
        }
        return vc
    }
}

Author

YuraChudnick, [email protected]

License

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

Latest podspec

{
    "name": "YCActionSheetDatePicker",
    "version": "1.0.0",
    "summary": "ActionSheet with DatePciker.",
    "description": "ActionSheet with DatePciker. Instructions for installationn  are in [the README](https://github.com/YuraChudnick/YCActionSheetDatePicker).",
    "homepage": "https://github.com/YuraChudnick/YCActionSheetDatePicker",
    "license": {
        "type": "MIT",
        "file": "License.md"
    },
    "authors": {
        "Y.Chudnick": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/YuraChudnick/YCActionSheetDatePicker.git",
        "tag": "1.0.0"
    },
    "source_files": [
        "YCActionSheetDatePicker",
        "YCActionSheetDatePicker/*.swift"
    ],
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This