Answer the question
In order to leave comments, you need to log in
How to make multiple backgrounds in Xcode?
According to the tutorial, I made an application for the weather and wanted to change the background after that, so that for each city from let cities = [...]
there was its own picture.
in View I see the opportunity to make a background once, how can I add several?
and after the following question, where to prescribe the condition for the appearance of the desired picture? viewDidLoad?
Answer the question
In order to leave comments, you need to log in
You need to break the task into subtasks . Let's formulate:
class ViewController: UIViewController {
var backgroundImageView = UIImageView()
func viewDidLoad() {
super.viewDidLoad()
backgroundImageView.image = UIImage()
}
func changeBackground() {
// Пример смены фона по вызову функции. Объект UIImage должен быть ваш, для примера пустой.
backgroundImageView.image = UIImage()
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question