Link to home
Start Free TrialLog in
Avatar of FaheemAhmadGul
FaheemAhmadGulFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Converting a string to NSDate format using Swift

In an IOS Swift application I have a function that is returning a date as a string like ("2016-04-18"). I need help with Swift code for a function that will take this string or any other string in this format (for any other date) and convert it into NSDate and return me that date as  a string in the following format "18 April 2016".
So if I give this function any other date in the format "2016-03-03" then I will get back "3 March 2016".
Thank you for your help.
ASKER CERTIFIED SOLUTION
Avatar of Hamidreza Vakilian
Hamidreza Vakilian

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FaheemAhmadGul

ASKER

Brilliant!!
Worked perfectly. I am very grateful.