Creating a method to perform animations and wait for completion using a semaphore in objective c

后端 未结 5 1615
没有蜡笔的小新
没有蜡笔的小新 2020-12-12 01:02

I am trying to create a method which makes use of UIView\'s \"+animateWithDuration:animations:completion\" method to perform animations, and wait for completion. I am well a

5条回答
  •  天命终不由人
    2020-12-12 01:29

    As Jonah said, there is no way to do that on the main thread. If you do not want to have nested blocks, there is nothing bad with it, but I understand your wish, simply put a method inside the block and the inner block then in the method. If you need closures in the inner block, you can pass them as an argument.

    Doing so will enlarge your love to nested blocks. ;-)

提交回复
热议问题