gpt4 book ai didi

swift - 在 swift 中使用 switch 语句的 bool 函数

转载 作者:行者123 更新时间:2023-11-28 13:55:37 29 4
gpt4 key购买 nike

<分区>

我正在尝试使用 switch 语句获取 bool 结果,但我猜我的代码中有问题

class func login(username: String , password: String) -> Bool {
let url = "http://127.0.0.1:3000/login/"+username+"/"+password
Alamofire.request(url).responseJSON { response in
switch response.result {
case .failure:
// print(error)
return false
case .success:
// print(value)
return true
}
}
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com