这就是你如何实现这个目标:
func methodOne() { //Method one code here methodTwo() } func methodTwo() { //Method Two code here. }
根据您的评论,以下是使用异步代码时的等待方式:
func methodOne() { //Code goes here methodTwo { () -> () in //Method two has finished } } func methodTwo(completion: () -> ()) { //Code goes here completion() }