使用SwiftDate的日历视图

时间:2014-10-18 15:00:07

标签: ios iphone xcode swift calendar

我从github Swift Date(https://github.com/haginile/SwiftDate)下载了该项目,如何在xcode的视图中导入日历,从而显示日历? 谢谢大家的回复。

1 个答案:

答案 0 :(得分:1)

我下载了源代码并创建了一个新项目,然后将所有源文件拖到新项目中。我添加了一个功能并进行了测试。它奏效了。

func test() {
    var d1 = Date(year : 2014, month : 5, day : 15)
    var d2 = Date(string : "2014-05-15")
    d1 = d1 + 1
    if (d2 > d1) {
        println("d2 is greater than d1")
    } else {
        println("d2 is smaller than d1")
    }
}
相关问题