Answer the question
In order to leave comments, you need to log in
What are some smarter ways to implement Swift code?
The second day I study swift. I'm learning the basics and I want to know right away how to "should". How else can this code be implemented?
Answer the question
In order to leave comments, you need to log in
The simplest docks by language .
if let letData = data, let letError = error {
print("Информация получена, но с ошибками. \nИнформация: \(letData!) \nОшибки: \(letError!)")
} else if let letData = data {
print("Информация получена без ошибок: \n\(letData!)")
} else if let letError = error {
print("Информация не получена, косяк известен: \(letError!)")
} else {
print("Ошибок нет, но и инфы нет")
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question