title: How do I call “application didRegisterForRemoteNotificationsWithDeviceToken” outside of AppDelegate
body: <p>I want to save my users tokens id into my database using POST request in Swift.</p>
  
  <p>I use this function</p>
  
  <pre><code>    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {
      // Override point for customization after application launch.
  
      let types: UIUserNotificationType = [.Alert, .Badge, .Sound]
  
      let settings: UIUserNotificationSettings = UIUserNotificationSettings( forTypes: types, categories: nil )
  
      application.registerUserNotificationSettings( settings )
      application.registerForRemoteNotifications()
  
      return true
  }
  
  func application( application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData ) {
  
      let characterSet: NSCharacterSet = NSCharacterSet( charactersInString: "&lt;&gt;" )
  
      let deviceTokenString: String = ( deviceToken.description as NSString )
          .stringByTrimmingCharactersInSet( characterSet )
          .stringByReplacingOccurrencesOfString( " ", withString: "" ) as String
  
      print("token=" + deviceTokenString )
  
  }
  </code></pre>
  
  <p>Question = How do I call didRegisterForRemoteNotificationsWithDeviceToken outside of the AppDelegate class?</p>