-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
please note, that configure is invoked in two places for a reason, at least according to the [docs](https://patchthecode.com/jtapplecalendar-home/calendar-from-scratch/): > These 2 functions should contain the same code, therefore it is wise > to have a shared function to reduce code duplication. The only > difference between these two functions should be the first line of code > (the dequeuing code). Reasons for the 2 functions having the same code > are found [here under problem#1](patchthecode/JTAppleCalendar#553).
- Loading branch information
1 parent
264fee6
commit c32f4ad
Showing
3 changed files
with
132 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// DayCell.swift | ||
// CalendarPOC | ||
// | ||
// Created by Nathan Mattes on 07.02.20. | ||
// Copyright © 2020 Nathan Mattes. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import JTAppleCalendar | ||
|
||
class DayCell: JTACDayCell { | ||
static let reuseIdentifier = "CalendarCell" | ||
|
||
let dateLabel: UILabel | ||
|
||
override init(frame: CGRect) { | ||
|
||
dateLabel = UILabel(frame: .zero) | ||
dateLabel.translatesAutoresizingMaskIntoConstraints = false | ||
|
||
super.init(frame: frame) | ||
|
||
contentView.addSubview(dateLabel) | ||
|
||
let constraints = [ | ||
dateLabel.centerXAnchor.constraint(equalTo: contentView.centerXAnchor), | ||
dateLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor) | ||
] | ||
|
||
NSLayoutConstraint.activate(constraints) | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters