jjzjj

errorDescription

全部标签

swift - 在 Swift 中使用具有相同变量名的可选绑定(bind)

我正在学习Swift。我在一本书中看到了这些代码行。importUIKitvarerrorCodeString:String?errorCodeString="404"varerrorDescription:String?iflettheError=errorCodeString,leterrorCodeInteger=Int(theError),errorCodeInteger==404{errorDescription="\(errorCodeInteger+200):resourcewasnotfound."}varupCaseErrorDescription=errorDesc