Latest 0.7.0
Homepage https://github.com/farhad1985/PersianDatePicker
License GPL2
Platforms ios 9.0
Authors

PersianDatePicker

PersianDatePicker written in Swift

Requirements

  • iOS 9.0+
  • Xcode 8.1+
  • Swift 3.0+

Install

you can use in cocoapods

pod 'PersianDatePicker'

PersianDatePicker

StoryBoard

you can use in the storyboard, you add a UIView in your ViewController and inherit from [ PersianDatePickerView ]

PersianDatePicker

Style

you can use pickerStyle for two types .

PersianDatePicker

 persianDatePicker.pickerStyle = .short

for set Font :

 persianDatePicker.font = UIFont(name: "IRANSansMobileFaNum-Light", size: 18)

How to use in the code

It’s very simple.

import PersianDatePicker
@IBOutlet weak var txtDate: UITextField!
    let persianDatePicker = PersianDatePickerView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
    txtDate.inputView = persianDatePicker
    persianDatePicker.onChange = { (year, month, day) in
        self.txtDate.text = "(year)/(month)/(day)"
    }

if you want to have persian date:

     persianDatePickerView.getPersianDate()

and if you want to have gregorian date:

     persianDatePickerView.getGregorianDate()

you can have next day or back day :

     guard let persianDate = persianDatePickerView.getPersianDate() else {return}
     self.persianDatePickerView.nextDay(by: persianDate)

please download example and test it.

License

PersianDatePicker is available under the MIT license. See the LICENSE file for more information.

Latest podspec

{
    "name": "PersianDatePicker",
    "version": "0.7.0",
    "summary": "PersianDatePicker is a PickerView. by : farhad faramarzi",
    "homepage": "https://github.com/farhad1985/PersianDatePicker",
    "authors": {
        "Farhad Faramarzi": "[email protected]"
    },
    "license": {
        "type": "GPL2",
        "file": "LICENSE"
    },
    "source": {
        "git": "https://github.com/farhad1985/PersianDatePicker.git",
        "tag": "0.7.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "PersianDatePicker/*"
}

Pin It on Pinterest

Share This