私はすぐに私のアラームアプリのための下の画像のようなリピートリストを作りたい、私は最善を尽くしたが、すべての試みは失敗した、どのように私はそれを行うことができます、データベース内の1つの属性の複数の値、配列が必要ですか、どのようにチェックリストを行うことができますか?私のプロジェクトはほぼ完了して、残された唯一の事は、私がアラームを繰り返す日リストを作成する
Days.swift Reminder.swiftverride 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)!]
}
}
}
事前
で
感謝を作るために失敗を繰り返しリストです
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