"applicationWillTerminate" method will be called only when application is not in suspended state while being terminated.
To understand this, considering currently your application is in foreground active state, go through following two cases:
Case 1: When you single tap Home button, app directly goes to suspended state by calling methods - (1) applicationWillResignActive and then (2) applicationDidEnterBackground.
Now when you try to quit/terminate app, by double tapping home button and then swiping up the current app screen from recent app screens, app is in suspended state. So, "applicationWillTerminate" method will not be called.
Case 2: When you double tap Home button, app goes to inactive state by calling method - (1) applicationWillResignActive.
Now when you try to quit/terminate app, by swiping up the current app screen from recent app screens, app is in inactive state (not in suspended state) while being terminated. So, "applicationWillTerminate" method will be called.
Look what Apple say:
For more info on this look - Apple's Official Documentation on applicationWillTerminate(_:)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…