When receiving a memory warning, those delegate methods get called:
In UIViewController:
func didReceiveMemoryWarning()
Sent to the view controller when the app receives a memory warning.
In AppDelegate:
optional func applicationDidReceiveMemoryWarning(_ application: UIApplication)
Tells the delegate when the app receives a memory warning from the system. [...] Try to clean up as much memory as possible. next step is to terminate app
My question, as a newbie, is how can I "clean up as much memory as possible"? Especially if there are some leaks in my app.
Thank you for your help