enum HttpResponse{
case success(Int,Data)
case fail(Int,Error)
}
switch response{
// 可以将关联值绑定新的变量或常量
case let .success(statusCode,data):
print(statusCode)
case let .fail(statusCode,error):
print(statusCode)
}
if case let HttpResponse.success(statusCode,data) = response {
}