Get weekdays in english iOS swift

 Problem:

I had one date with me.I want to get the day name in english.


 Solution:

extension Date {

    func getWeekDaysEng() -> [String] {

        var calendar = Calendar(identifier: .gregorian)

        calendar.locale = Locale(identifier: "en_US_POSIX")

        return calendar.weekdaySymbols

    }

}

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift