昨天處理好傳值的部分了,今天就來將新增畫面完成吧。
我們在輸入設定完後,新增畫面的Cell裡會略顯設定的內容,就要對Cell的顯示稍微修改一下。
switch indexPath.row {
case 0:
let repeatWeek = addPageValue.pageValue.repeatDayCheck
if repeatWeek[0] && repeatWeek[1] && repeatWeek[2] && repeatWeek[3] && repeatWeek[4] && repeatWeek[5] && repeatWeek[6] {
cell.showLabel.text = "每天"
} else if !repeatWeek[0] && repeatWeek[1] && repeatWeek[2] && repeatWeek[3] && repeatWeek[4] && repeatWeek[5] && !repeatWeek[6] {
cell.showLabel.text = "平日"
} else if repeatWeek[0] && !repeatWeek[1] && !repeatWeek[2] && !repeatWeek[3] && !repeatWeek[4] && !repeatWeek[5] && repeatWeek[6] {
cell.showLabel.text = "週末"
} else if !repeatWeek[0] && !repeatWeek[1] && !repeatWeek[2] && !repeatWeek[3] && !repeatWeek[4] && !repeatWeek[5] && !repeatWeek[6] {
cell.showLabel.text = "永不"
} else {
let week = ["日,", "一,", "二,", "三,", "四,", "五,", "六,"]
var showDay = "每週"
for i in 0...6 {
if repeatWeek[i] {
showDay.append(week[i])
}
}
showDay.removeLast(1)
cell.showLabel.text = showDay
}
這樣就能大概看到哪幾天會重複。
case 1:
cell.showLabel.text = addPageValue.pageValue.labelText
附註的內容。
case 2:
cell.showLabel.text = addPageValue.pageValue.soundSource[addPageValue.pageValue.soundSelect]
以及選擇的鈴聲。
這樣就完成新增畫面與設定畫面的同步了,明天來把所有資料存進Realm吧。