TimeZone(abbreviation: "GMT+1") ?? TimeZone.current
如果我试图避免可选,如果由于某种原因产生 nil,我该如何在这里断言(内联)TimeZone(abbreviation: "GMT+1")
?
像这样的东西
TimeZone(abbreviation: "GMT+1") ?? (assertionFailure("what weird runtime have you've got????"), TimeZone.current)
(这显然不能编译)