Reputation: 14400
i am having issue with closing UIViewcontroller
which is attached and opened from uiNavigationController , when i close/reopen the B UIViewcontroller
the memory get increased every time i open it , but when i close it nothing happened the memory wont go down .
I've tried the following codes all same :
DispatchQueue.main.async {[weak self] in
guard let strongSelf = self else { return }
strongSelf.navigationController?.pushViewController(vc, animated: true)
}
and
DispatchQueue.main.async {[unowned self] in
self.navigationController?.pushViewController(vc, animated: true)
}
and
self.navigationController?.pushViewController(vc, animated: true)
the B UIViewctonroller
has only 1 image in storyboard no code is there .
anyidea how to release Closed "pop" UIVIewcontroller from memory ?
Upvotes: 1
Views: 1208
Reputation: 578
Try to avoid using strong properties for IBOutlets.
if your using self in your code make sure it's an optional self, using the [weak self] Swift Blocks It will be be released if there are no other strong pointers to it
Upvotes: 1