Swift
[Swift] 왜 struct 는 deinit 을 지원하지 않는 것일까?
insub4067
2023. 2. 4. 12:55
결론 : deinit 은 Reference Count 가 0이 될때 실행되는 함수인데 struct 는 복사 타입이라 애초에 지원하지 않습니다.
Why don't structs have deinitializers in Swift like classes?
I was just going through the Swift documentation of deinitializers and found that they only exist for classes. So I was just wondering why structs in Swift don't have deinitializers?
stackoverflow.com