ios has a method called “deinit” is there a way to...
# multiplatform
l
ios has a method called “deinit” is there a way to invoke it using kotlin code ?
s
I can't tell you if it's possible to call it from Kotlin. But I can tell you it's a really bad idea to call this method. It's called automatically when some object is deinit/deallocated
l
i dont want to call it manually, i want to override the content of it
s
If you are creating a standalone class (no subclass), I would say just to have a
fun deinit {}
is fine
l
i will try
s
deinit
is a Swift mechanism. The ObjC version is
dealloc
. You might get somewhere with overriding that but I doubt it. https://developer.apple.com/documentation/objectivec/nsobject/1571947-dealloc