Answer the question
In order to leave comments, you need to log in
How to hide/show an element before the functions start executing?
How to hide/show an element before the functions start executing?
@IBAction func changeButton(_ sender: Any) {
table.isHidden = true
func1()
func2()
}
Answer the question
In order to leave comments, you need to log in
DECISION:
@IBAction func changeButton(_ sender: Any) {
DispatchQueue.global().async {
DispatchQueue.main.async(){
self.table.isHidden = true
self.activityIndicator.startAnimating()
}
/*Внутри функций работа с сетью, sqlite базой, много циклов*/
self.func1()
self.func2()
DispatchQueue.main.async(){
self.readLovers() - тут подгрузка данных для table, соот., и table.reloadData()
self.activityIndicator.stopAnimating()
self.table.isHidden = false
}
}
}
The code you provided works consistently.
For example code:
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.isHidden = true
print("table is hidden: \(tableView.isHidden)")
self.do1()
self.do2()
}
func do1() {
print("do 1")
}
func do2() {
print("do 2")
}
table is hidden: true
do 1
do 2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question