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