Cut Out Shape with Animation

后端 未结 5 1379
盖世英雄少女心
盖世英雄少女心 2020-11-30 19:11

I want to do something similar to the following:

How to mask an image in IOS sdk?

I want to cover the entire screen with translucent black. Then, I want to c

5条回答
  •  不知归路
    2020-11-30 19:49

    If you just want something that is plug and play, I added a library to CocoaPods that allows you to create overlays with rectangular/circular holes, allowing the user to interact with views behind the overlay. It is a Swift implementation of similar strategies used in other answers. I used it to create this tutorial for one of our apps:

    Tutorial using the TAOverlayView

    The library is called TAOverlayView, and is open source under Apache 2.0.

    Note: I haven't implemented moving holes yet (unless you move the entire overlay as in other answers).

提交回复
热议问题