2
J'ai un code qui est en rupture Swift 2.0:combinant NSCalendarUnit avec OR (tuyau) à Swift 2.0
let formatter = NSDateComponentsFormatter()
formatter.allowedUnits = NSCalendarUnit.Year
formatter.allowedUnits |= .Month
formatter.allowedUnits |= .WeekOfMonth
formatter.allowedUnits |= .Day
formatter.allowedUnits |= .Hour
formatter.allowedUnits |= .Minute
Je reçois l'erreur Binary operator '|=' cannot be applied to 'NSCalenderUnit' operands
.
Quelle est la nouvelle façon de faire ce genre de chose?
essentiellement le même problème (et solution) comme http://stackoverflow.com/questions/30761996/swift-2-0-binary-operator-cannot -be-appliqué-à-deux-uiusernotificationtype. –