Я хочу сделать повторный список, как на картинке ниже, для моего приложения будильника в быстром режиме, я пробовал свои силы, но все мои попытки потерпели неудачу, как я могу это сделать, как я могу сэкономить несколько значений в одном атрибуте в базе данных, мне нужен массив, как я могу сделать контрольный список; мой проект почти завершен, осталось только повторить список, который я не смог сделать егоразработка списка повторяющихся списков аварийных сообщений
заранее спасибо
Reminder.swift
verride func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "presentDay" {
if let daysPickerVie
wController = segue.destinationViewController as? Days {
let path = tableView.indexPathForSelectedRow
detailLabel.text = daysPickerViewController.days[(path?.row)!]
}
}
}
Days.swift
class Days: UITableViewController
{
var lastSelectedIndexPath = NSIndexPath(forRow: -1, inSection: 0)
let days = [
"Everyday",
"Saturday",
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"]
var selectedDay:String?
var selectedDayIndex:Int?
var cell:UITableViewCell?
override func viewDidLoad() {
//navigationController?.navigationBar.topItem?.title = "Back"
}
extension Days{
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return days.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("daySelected", forIndexPath: indexPath) as UITableViewCell
cell.accessoryType = .None
cell.textLabel?.text = days[indexPath.row]
selectedDay = days[indexPath.row]
return cell
}
}
extension Days {
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if let cell = tableView.cellForRowAtIndexPath(indexPath) {
if cell.selected {
cell.accessoryType = .Checkmark
}
}
}
override func tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath) {
if let cell = tableView.cellForRowAtIndexPath(indexPath) {
cell.accessoryType = .None
}
}
}
может Прокомментируйте код, что вы пытались –
Это может помочь: http://stackoverflow.com/questions/21481987/repeat-uilocalnotification-on-specific-day –
@ Ramkumar chintala Я добавил код – User