I use this code to get the current date
let date = Date()
let formatter = DateFormatter()
formatter.dateFormat = "yyyy.MM.dd"
let result = formatter.string(from: date)
Any idea on how can I get the date in the past, for example a day or a year before the current date?