Detecting user inactivity in iOS application in Swift
how to detect the inactivity of the user in our app and perform actions? In our case , disconnecting the user. Step: - 1 First Commend //@UIApplicationMain in AppDelegate Step:- 2 Create one UIApplication Swift File(NSObject File) Coding in UIApplication File Playground - noun: a place where people can play import UIKit extension NSNotification . Name { public static let TimeOutUserInteraction: NSNotification . Name = NSNotification . Name (rawValue: "MTopoUserUIApplication" ) } class MTopoUserUIApplication: UIApplication { static let ApplicationDidTimoutNotification = "AppTimout" // The timeout in seconds for when to fire the idle timer. let timeoutInSeconds: TimeInterval = 10 var idleTimer: Timer ? // Listen ...