I try to chain different functions. Go to the next function only when each one is completed.
I could find different ways to do that. For instance:
I tried and all that works well with two functions but also they became complicated when there are several functions and a lot of code.
I am looking for a solution that could help to keep the code clean and organized especially when there are several function.
For instance that keeps the code in the right order but it needs to add a way to go to the next func only when each one is completed.
override func viewDidLoad() {
super.viewDidLoad()
first()
}
func first () {
print("first")
second()
}
func second () {
print("second")
third()
}
func third () {
print("third")
}