String = "-"
@Published var surName: String = "-"
@Published var secondName: String = "-"
@Published var contracts: [ContractDatum] = []
@Published var balance: String = "-"
@Published var startPeriod: String = "-"
@Published var endPeriod: String = "-"
@Published var monthPayment: String = "-"
@Published var recomendetPayment: Int = 0
@Published var isLoading = false
func getData() {
let app_topken = UserDefaults.standard.value(forKey: "authToken")
if ((app_topken) != nil) {
self.isLoading = true
HomeService().getUserInfo(app_token: app_topken as! String) { UserInfoResponse in
DispatchQueue.main.async {
self.firstName = UserInfoResponse.firstName ?? "-"
self.secondName = UserInfoResponse.secondName ?? "-"
self.surName = UserInfoResponse.surName ?? "-"
self.contracts = UserInfoResponse.contractData ?? []
self.isLoading = false
}
}
}
}
}
А где переменная модели во View? Скинь скрин. плиз
Обсуждают сегодня