【发布时间】:2017-09-13 14:32:01
【问题描述】:
我在 swift 中遇到了强制展开问题,我一直在修复所有问题。所以我强制展开,但我收到此错误“条件绑定的初始化程序必须具有可选类型,而不是'日期'。这是代码。
if let createdat = (object?.object(forKey: "createdAt") as? String){
if let pastDate = Date(timeIntervalSinceNow: TimeInterval(createdat)!)//Here is where I get the error{
}
}
【问题讨论】: