I got a code snippet from one of the other threads, but I was wondering if someone could help me convert this function so that it prints out the day in this format: "dd-MM-yyyy". At the moment it's only printing the day. 

```
func getLast7Dates()
{
  let cal = Calendar.current
  var date = cal.startOfDay(for: Date())
  var days = [Int]()

  for i in 1 ... 7 {
    let day = cal.component(.day, from: date)
    days.append(day)
    date = cal.date(byAdding: .day, value: -1, to: date)!
  }

print(days)
}

```

I know I will need to use:

```
let dateFormatter = DateFormatter()

dateFormatter.dateFormat = "dd-MM-yyyy"

```

But I don't know where to put it in the function as this is my first time working with dates.

Thanks for your help :)