I have a UIDatePicker wich needs to gets validated. I want to check if the weekday from the UIDatePicker is a specific int value.
I use
@IBAction func validateDateTime(sender: AnyObject) {
var date = self.dateTime.date
let formatterWeekday = NSDateFormatter()
formatterWeekday.dateFormat = "e"
let weekday_string = formatterWeekday.stringFromDate(date)
}
to get the weekday but how can I convert it to an int so I can compare it with other int values? I tried it with:
weekday_string.intValue()
but it seems to be that weekday_string is not supporting the intValue method.