Skip to content

Commit

Permalink
収録サンプルカレンダー一部修正
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiyasac committed Dec 31, 2016
1 parent 965e22c commit 84368d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Binary file not shown.
18 changes: 9 additions & 9 deletions handMadeCalendarAdvance/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class ViewController: UIViewController {
var dayCellLists: [String?] = []

//日本の祝祭日判定用のインスタンス
var holidayObj: CalculateCalendarLogic = CalculateCalendarLogic()
let holidayObj: CalculateCalendarLogic = CalculateCalendarLogic()

override func viewDidLoad() {
super.viewDidLoad()
Expand Down Expand Up @@ -242,25 +242,25 @@ extension ViewController: UICollectionViewDataSource {

let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CalendarCell", for: indexPath) as! CalendarCell

switch (indexPath as NSIndexPath).section {
switch indexPath.section {

case 0:

//曜日を表示する
cell.textLabel!.text = CalendarSetting.weekList[(indexPath as NSIndexPath).row]
cell.textLabel!.textColor = CalendarSetting.getCalendarColor((indexPath as NSIndexPath).row, holiday: false)
cell.textLabel!.text = CalendarSetting.weekList[indexPath.row]
cell.textLabel!.textColor = CalendarSetting.getCalendarColor(indexPath.row, holiday: false)
return cell

case 1:

//該当年月の日付を表示する
let day: String? = dayCellLists[(indexPath as NSIndexPath).row]
let day: String? = dayCellLists[indexPath.row]

if isCellUsing((indexPath as NSIndexPath).row) {

let holiday: Bool = holidayObj.judgeJapaneseHoliday(year: targetYear, month: targetMonth, day: Int(day!)!)

cell.textLabel!.textColor = CalendarSetting.getCalendarColor((indexPath as NSIndexPath).row, holiday: holiday)
cell.textLabel!.textColor = CalendarSetting.getCalendarColor(indexPath.row, holiday: holiday)
cell.textLabel!.text = day

} else {
Expand All @@ -284,10 +284,10 @@ extension ViewController: UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {

//日付が入るセルならば処理をする
if isCellUsing((indexPath as NSIndexPath).row) {
if isCellUsing(indexPath.row) {

let day: String? = dayCellLists[(indexPath as NSIndexPath).row]
print("\(targetYear)\(targetMonth)\(day!)")
let day: String? = dayCellLists[indexPath.row]
print("\(targetYear!)\(targetMonth!)\(day!)")
}
}

Expand Down

0 comments on commit 84368d5

Please sign in to comment.