この Swift 3 コードは、XCode 8 ベータ 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)
コンパイラエラーを生成しますcannot convert value of type Calendar.Component to NSCalendar.Unit
私は何か間違ったことをしていますか、それともこれはバグですか?