Observe object's deinit from outside of object
- I want to observe deinit of target object, but there are cases where I can't implement deinit. Therefore, I made
DeinitObserver. - Swift 객체 외부에서 객체가 해제되는 것 감지하기
- In your Xcode project, navigate to File > Swift Packages > Add Package Dependancy...
- Paste the following into the URL field: https://github.com/cozzin/DeinitObserver
import DeinitObserver
DeinitObserver(for: target){print("target did deinit!")}.observe()