Skip to content

Commit 7964e90

Browse files
committed
migrate to swift 5
1 parent 147f302 commit 7964e90

5 files changed

Lines changed: 35 additions & 21 deletions

File tree

CalendarDateRangePickerViewController/Classes/CalendarDateRangePickerCell.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class CalendarDateRangePickerCell: UICollectionViewCell {
6767
selectedView?.backgroundColor = selectedColor
6868
selectedView?.layer.cornerRadius = height / 2
6969
self.addSubview(selectedView!)
70-
self.sendSubview(toBack: selectedView!)
70+
self.sendSubviewToBack(selectedView!)
7171

7272
label.textColor = UIColor.white
7373
}
@@ -79,7 +79,7 @@ class CalendarDateRangePickerCell: UICollectionViewCell {
7979
halfBackgroundView = UIView(frame: CGRect(x: width / 2, y: 0, width: width / 2, height: height))
8080
halfBackgroundView?.backgroundColor = highlightedColor
8181
self.addSubview(halfBackgroundView!)
82-
self.sendSubview(toBack: halfBackgroundView!)
82+
self.sendSubviewToBack(halfBackgroundView!)
8383

8484
addRoundHighlightView()
8585
}
@@ -91,7 +91,7 @@ class CalendarDateRangePickerCell: UICollectionViewCell {
9191
halfBackgroundView = UIView(frame: CGRect(x: 0, y: 0, width: width / 2, height: height))
9292
halfBackgroundView?.backgroundColor = highlightedColor
9393
self.addSubview(halfBackgroundView!)
94-
self.sendSubview(toBack: halfBackgroundView!)
94+
self.sendSubviewToBack(halfBackgroundView!)
9595

9696
addRoundHighlightView()
9797
}
@@ -103,7 +103,7 @@ class CalendarDateRangePickerCell: UICollectionViewCell {
103103
roundHighlightView?.backgroundColor = highlightedColor
104104
roundHighlightView?.layer.cornerRadius = height / 2
105105
self.addSubview(roundHighlightView!)
106-
self.sendSubview(toBack: roundHighlightView!)
106+
self.sendSubviewToBack(roundHighlightView!)
107107
}
108108

109109
func highlight() {

CalendarDateRangePickerViewController/Classes/CalendarDateRangePickerViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class CalendarDateRangePickerViewController: UICollectionViewController {
4343
collectionView?.backgroundColor = UIColor.white
4444

4545
collectionView?.register(CalendarDateRangePickerCell.self, forCellWithReuseIdentifier: cellReuseIdentifier)
46-
collectionView?.register(CalendarDateRangePickerHeaderView.self, forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, withReuseIdentifier: headerReuseIdentifier)
46+
collectionView?.register(CalendarDateRangePickerHeaderView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: headerReuseIdentifier)
4747
collectionView?.contentInset = collectionViewInsets
4848

4949
if minimumDate == nil {
@@ -58,11 +58,11 @@ public class CalendarDateRangePickerViewController: UICollectionViewController {
5858
self.navigationItem.rightBarButtonItem?.isEnabled = selectedStartDate != nil && selectedEndDate != nil
5959
}
6060

61-
func didTapCancel() {
61+
@objc func didTapCancel() {
6262
delegate.didCancelPickingDateRange()
6363
}
6464

65-
func didTapDone() {
65+
@objc func didTapDone() {
6666
if selectedStartDate == nil || selectedEndDate == nil {
6767
return
6868
}
@@ -132,7 +132,7 @@ extension CalendarDateRangePickerViewController {
132132

133133
override public func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
134134
switch kind {
135-
case UICollectionElementKindSectionHeader:
135+
case UICollectionView.elementKindSectionHeader:
136136
let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: headerReuseIdentifier, for: indexPath) as! CalendarDateRangePickerHeaderView
137137
headerView.label.text = getMonthLabel(date: getFirstDateForSection(section: indexPath.section))
138138
return headerView

Example/Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 12 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)