I know it's all with the weak strong reference when presenting the viewController in the parent view ... correct me please if I'm wrong
this is an example how I do it
let viewHolder = viewClass()
func presentView() {
self.present(viewHolder, animated: true) {
}
}
see my memory monitor only from open and dismiss the same view over and over
weak var viewHolder = viewClass()
func presentView() {
self.present(viewHolder!, animated: true) {
}
}
but this would give me a crash
Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value
and dismiss the viewClass this way (inside itself off)
func dismissPage() {
self.dismiss(animated: true)
}
any help would be appreciated thanks
Use deint method and check weather it is called or not after dismiss your viewcontroller.
if your using any kind of blocks or closure to work done then use [weak self] in side your closure.