enum WeekDay: Int {
case sunday = 1
case monday = 2
case tuesday = 3
case wednesday = 4
case thursday = 5
case friday = 6
case saturday = 7
}
let comp = Calendar.Component.weekday
//1が日曜日7が土曜日で帰ってくる
let weekday = WeekDay(rawValue: NSCalendar.current.component(comp, from: NSDate() as Date))!
switch weekday {
case .sunday:
print("日曜日")
case .monday:
print("月曜日")
case .tuesday:
print("火曜日")
case .wednesday:
print("水曜日")
case .thursday:
print("木曜日")
case .friday:
print("金曜日")
case .saturday:
print("土曜日")
}