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

store cgpoint in userdefaults iOS swift