I am new to iOS development. I am trying to convert a date value which is in string format(2024-09-22) to 22 Sep 2024.
But I am getting:
Cannot call value of non-function type 'String?'
while doing date formatting.
I am getting this error in dateFormatter.dateFormat(from : dateString)
.
I have tried a below code for the formatting.
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "dd-MMM-yyyy"
dateFormatter.timeZone = TimeZone.current
dateFormatter.locale = Locale.current
let convertedDate = dateFormatter.dateFormat(from : dateString)
Could someone help me to solve this issue?