Post

Replies

Boosts

Views

Activity

Calendar gregorian (fixed) behaves differently from gregorian (current)
I am trying to get the weekdaySymbols from fixed calendar gregorian but it keeps returning the same result as shortWeekdaySymbols. The same applies for standaloneWeekdaySymbols. Calendar.current	// gregorian (current) let gregorian =  Calendar(identifier: .gregorian)   // gregorian (fixed) Calendar.current.weekdaySymbols  // ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] gregorian.weekdaySymbols	 // ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] Calendar.current.standaloneWeekdaySymbols   // ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] Calendar.current.shortWeekdaySymbols	 // ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] gregorian.standaloneWeekdaySymbols	 // ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] gregorian.shortWeekdaySymbols	 // ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
2
0
1.2k
Jan ’21
Swift Decimal binary integer generic initializer fatal error
I am trying to use initialize a Decimal type using its generic binary integer exactly initializer but it keeps crashing with a fatal error regardless of the value used: Code to reproduce the issue: let binaryInteger = -10 let decimal = Decimal(exactly: binaryInteger) // error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0). Is it a known bug?
3
0
491
Oct ’22