title: Push Notifications in Swift
body: <p>I want to make a push notifications, but this code doesn't do what I need. Notifications are also created in place of content.body is always the same text, which is the last element in the foodsForNotifications array. How can I fix this?</p>
  
  <pre><code>    func scheduleLocal() {
      let center = UNUserNotificationCenter.current()
  
      center.removeAllPendingNotificationRequests()
      let content = UNMutableNotificationContent()
  
      for foods in foodForNotifications { // array for content.body
          content.body = foods
      }
  
      content.title = "AXAXAXAXAXAX"
      content.categoryIdentifier = "alarm"
      content.sound = UNNotificationSound.default
  
      for date in datesArr {  // array for date
  
  
          var dateComponents = DateComponents()
  
          let calendar = Calendar.current
          let dateInfo = calendar.dateComponents([.hour, .minute, .second], from: date)
          dateComponents.year = dateInfo.year
          dateComponents.month = dateInfo.month
          dateComponents.day = dateInfo.day
          dateComponents.hour = dateInfo.hour
          dateComponents.minute = dateInfo.minute
          let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true)
  
          let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: trigger)
  
          center.add(request)
      }
  }
  </code></pre>