title: How to pass notification data to a View Controller with Swift
body: <p>I receive a notification in App Delegate with a question in the data (userInfo variable), and I need this String to be passed to the View Controller named "Question". I want this String to be shown in this variable <em>@IBOutlet weak var question: UILabel!</em> which is in the Question View Controller.</p>
  
  <pre><code>func userNotificationCenter(_ center: UNUserNotificationCenter,
                              didReceive response: UNNotificationResponse,
                              withCompletionHandler completionHandler: @escaping () -&gt; Void) {
      let userInfo = response.notification.request.content.userInfo
      // Print message ID.
      if let messageID = userInfo[gcmMessageIDKey] {
          print("Message ID: \(messageID)")
      }
  
      // Print full message.
      print(userInfo)
      let storyboard = UIStoryboard(name:"Main", bundle:nil)
      let question_view = storyboard.instantiateViewController(withIdentifier: "Question")
      window?.rootViewController = question_view
  
      completionHandler()
  }
  </code></pre>
  
  <p>How can I pass the data to the View Controller? I've tried to access the variable from there but I didn't work. Thanks!</p>