这个Swift 3代码工作直到XCode 8 beta 3:
let calendar = Calendar.current let anchorComponents = calendar.components([Calendar.Unit.day,Calendar.Unit.month,Calendar.Unit.year,Calendar.Unit.hour],from: self)
在Xcode 8 beta 4 Calendar.Unit似乎重命名为Calendar.Component。
let calendar = Calendar.current let anchorComponents = calendar.components([Calendar.Component.day,Calendar.Component.month,Calendar.Component.year,Calendar.Component.hour],from: self)
产生编译器错误,不能将类型为Calendar.Component的值转换为NSCalendar.Unit
我做错什么或是这个bug?