I'm building a chart that has bars with onTap that calls a function to display totals. The function has the below code but doesn't like the alert present, "Use of unresolved identifier "present" error appears.
At the top of my code I have import UIKit and my function is as below:
func displayTotals(monthSelected: Int, monthTotalQty: Int, monthTotalCurrency: Int){
let alert = UIAlertController(title: "\(monthSelected) Totals", message: "Quantity \(monthTotal) | Total \(monthTotalCurrency)", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Ok", style: .destructive) { _ in
return
})
present(alert, animated: true)
}