How to hide/show the element before the commencement of the functions?

How to hide/show the element before the commencement of the functions?
@IBAction func changeButton(_ sender: Any) {

table.isHidden = true
func1()
func2()
 }


table.IsHidden = true Executes only after the two functions. How to make at the beginning of the disappeared item, and then performed the function? In the function of networking.
March 23rd 20 at 19:31
2 answers
March 23rd 20 at 19:33
Solution
SOLUTION:
@IBAction func changeButton(_ sender: Any) {
 DispatchQueue.global().async {
DispatchQueue.main.async(){
 self.table.isHidden = true
self.activityIndicator.startAnimating()
}

/*In functions networking, sqlite database, a lot of cycles*/
self.func1()
self.func2()

DispatchQueue.main.async(){
 self.readLovers() - then load data to table, RHR., and table.reloadData()
self.activityIndicator.stopAnimating()
 self.table.isHidden = false
}

}
 }
so you have in the background running) - Victor.Kihn commented on March 23rd 20 at 19:36
@Victor.Kihn, well, I wrote the code here as it is in the above.. - earnest_Cormier commented on March 23rd 20 at 19:39
@earnest_Cormier, so I just said -
code is executed sequentially, looking for a problem in another
. - Victor.Kihn commented on March 23rd 20 at 19:42
@Victor.Kihn, this is a brilliant answer, brilliant in futility :) - earnest_Cormier commented on March 23rd 20 at 19:45
This is not a solution. You UI background updated. Only update UI in the main thread can. - Clare_Jenkins6 commented on March 23rd 20 at 19:48
@earnest_Cormier, hmm. - Victor.Kihn commented on March 23rd 20 at 19:51
@Clare_Jenkins6, well, the code works as intended. If I understood well in the threads here would not be writing and crutches (in Your opinion) did not.
If you know how, please write on the example above. - earnest_Cormier commented on March 23rd 20 at 19:54
@Victor.Kihn, I offend You it didn't just have a problem need a solution, not a repetition of what the problem is. - earnest_Cormier commented on March 23rd 20 at 19:57
@earnest_Cormier, you gave the code - I said that's not the problem.
It's like "why is my elephant is not all elephants are able to walk." "Oh, and I his legs cut off, and you don't understand, you worthless counselor"

P. S. I Feel that you are a beginner. Would have listened to me, I dare yourself to call an experienced. - Victor.Kihn commented on March 23rd 20 at 20:00
@earnest_CormierI side with Ivan, he said why the problem is not your code, and another said we need more information to find the problem. But you gem rolled a noble) - Clare_Jenkins6 commented on March 23rd 20 at 20:03
@Clare_Jenkins6what more information?
There is a VC there is a button changeButton, it hides the table and two functions with networking - what information is needed?
Ivan said that he still needs to determine the problem, nor the solution to the problem could not afford. - earnest_Cormier commented on March 23rd 20 at 20:06
@Victor.Kihn, ignore it. It's as dead a poultice. - Travis commented on March 23rd 20 at 20:09
March 23rd 20 at 19:35
The code that you gave, 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")
}

Displays in the console:
table is hidden: true
do 1
do 2

I just wrote a draft.
The problem is not the order of execution of functions - he's consistent. To help, need more information.

UPD: the Author of ham.
I brought all that you can. Entirely to throw the contents of the functions of the meaning has not.
If you close the functions table.isHidden = true works.
I don't understand why is not running consistently.
Tried to add self., as You have in the example is the same, not rabit.

+ does not work, and such a scheme:
table.isHidden = true - not working
 func1 () works
 func2() - triggered
table.isHidden = false - not working


Clicking the button should hide the table functions and the table needs to return - that's the essence of the idea. - earnest_Cormier commented on March 23rd 20 at 19:38
I gave the example from your question, everything is done consistently (how else?). Look for a problem in another. - Victor.Kihn commented on March 23rd 20 at 19:41
@Victor.Kihn, )) did I already. But because otherwise it was done. - earnest_Cormier commented on March 23rd 20 at 19:44

Find more questions by tags Swift