Adding delay between execution of two following lines

前端 未结 7 1811
陌清茗
陌清茗 2020-12-07 13:15

I need to add delay between the execution of two lines in a(same) function. Is there is any favorable options to do this?

Note: I don\'t need two di

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 13:34

    [checked 27 Nov 2020 and confirmed to be still accurate with Xcode 12.1]

    The most convenient way these days: Xcode provides a code snippet to do this where you just have to enter the delay value and the code you wish to run after the delay.

    1. click on the + button at the top right of Xcode.
    2. search for after
    3. It will return only 1 search result, which is the desired snippet (see screenshot). Double click it and you're good to go.

提交回复
热议问题