【问题标题】:How to use https://github.com/bendodson/MonthYearPickerView-Swift library?如何使用 https://github.com/bendodson/MonthYearPickerView-Swift 库?
【发布时间】:2015-09-15 10:02:07
【问题描述】:

我正在创建一个 Swift iOS 应用程序,我必须在其中显示一个接受月份和年份的日期选择器。我在 GitHub 上找到了一个库,它看起来可以解决我的问题,但我不知道如何使用它。任何指导将不胜感激。提前谢谢你。

链接:https://github.com/bendodson/MonthYearPickerView-Swift

【问题讨论】:

  • 你在 Swift 2.0 中运行过这个吗?因为我遇到了一些问题。
  • 我没有收到任何错误..

标签: swift datepicker


【解决方案1】:

试试这个

    let expiryDatePicker = MonthYearPickerView(frame: CGRectZero)
    yourtextField.inputView = expiryDatePicker

【讨论】:

  • @ChetanPurohit:你为选择动作做了什么?在查看了 kalim 的答案后,我现在得到了选择器。但坚持选择
【解决方案2】:

【讨论】:

  • 是的..我已将该 .swift 文件添加到我的项目中,并将 MonthYearPickerView 设置为 UIPickerView 的子类..也添加了给定的代码..它抛出了这个错误:致命错误:init(coder :) 尚未实现:文件 /Users/developer/MonthYearView/MonthYearView/MonthYearPickerView.swift,第 52 行
猜你喜欢
  • 2016-01-04
  • 1970-01-01
  • 2015-10-15
  • 1970-01-01
  • 1970-01-01
  • 2021-10-13
  • 2015-04-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多