I have a viewcontroller showing the detail of a book. What I want to do is saving data to database in a background thread before the viewcontroller is poped from the navigationcontroller.
I don't know where to put the logic save data to database, viewWillDisappear
or deinit
are the right choices?