Latest 0.2.1
Homepage https://github.com/hijamoya/PickerViewCell
License Apache License, Version 2.0
Platforms ios 9.0
Authors

Language Swift 5.0

We provide two types of UITableViewCell:

1. DatePickerTableViewCell: when you make this cell `becomeFirstResponder`, it will invoke a UIDatePicker and then you can use the delegate function to get the value of the picker.

2. PickerTableViewCell: when you make this cell `becomeFirstResponder`, it will invoke a UIPickerView. You should specify your datasource and delegate.

Demo

Demo

Installation

pod 'PickerViewCell'

Useage

Make your table view cell be the cells we provided, and just invoke becomeFirstResponder when the cell is selected.

  override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    tableView.deselectRow(at: indexPath, animated: true)
    if let cell = tableView.cellForRow(at: indexPath) as? DatePickerTableViewCell {
      cell.delegate = self
      if !cell.isFirstResponder {
        _ = cell.becomeFirstResponder()
      }
    } else if let cell = tableView.cellForRow(at: indexPath) as? PickerTableViewCell {
      cell.delegate = self
      cell.dataSource = self
      if !cell.isFirstResponder {
        _ = cell.becomeFirstResponder()
      }
    }
  }

Latest podspec

{
    "name": "PickerViewCell",
    "version": "0.2.1",
    "summary": "A library implement the UITableViewCell with a UIDatePicker or a UIPickerView.",
    "description": "We provide two type of UITableViewCell:n1. DatePickerTableViewCell: when you make this cell becomeFirstResponder, it will invoke a UIDatePicker and then you can use the delegate function to get the value of the picker.n2.PickerTableViewCell: when you make this cell becomeFirstResponder, it will invoke a UIPickerView. You should specify your datasource and delegate.",
    "homepage": "https://github.com/hijamoya/PickerViewCell",
    "screenshots": "https://i.imgur.com/9H2FfFa.png",
    "license": {
        "type": "Apache License, Version 2.0",
        "file": "LICENSE"
    },
    "authors": {
        "jam_hsu": "[email protected]"
    },
    "source": {
        "git": "https://github.com/hijamoya/PickerViewCell.git",
        "tag": "0.2.1"
    },
    "platforms": {
        "ios": "9.0"
    },
    "swift_version": "5.0",
    "source_files": "PickerViewCell/Classes/**/*"
}

Pin It on Pinterest

Share This