Running one function after another completes

后端 未结 4 1403
余生分开走
余生分开走 2020-12-14 11:45

I am trying to run loadViews() after the pullData() completes and I am wondering what the best way of doing this is? I would like to set a 10 sec timeout on it as well so I

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-14 11:54

    You can achieve like this :-

    func demo(completion: (success: Bool) -> Void) {
         // code goes here
       completion(success: true)
    }
    

提交回复
热议问题