Различные фоновые режимы в iOS - PullRequest
0 голосов
/ 20 декабря 2018

Чтобы распознать мое приложение, введенное Фоновый режим [Один короткий щелчок кнопки «Домой»] Я использую эту функцию:

func applicationDidEnterBackground(_ application: UIApplication) {
    //...
}

Но как узнать, что мое приложение вошло ПриложениеРежим переключения [Два коротких нажатия кнопки Home]?В этом случае метод applicationDidEnterBackground не вызывается.

1 Ответ

0 голосов
/ 20 декабря 2018

Попробуйте это:

    func applicationWillResignActive(_ application: UIApplication) {
        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
    }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...