Skip to content

Commit 147f302

Browse files
author
Miraan Tabrez
committed
Change delegate method names
1 parent ce37a01 commit 147f302

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

CalendarDateRangePickerViewController/Classes/CalendarDateRangePickerViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import UIKit
1010

1111
public protocol CalendarDateRangePickerViewControllerDelegate {
12-
func didTapCancel()
13-
func didTapDoneWithDateRange(startDate: Date!, endDate: Date!)
12+
func didCancelPickingDateRange()
13+
func didPickDateRange(startDate: Date!, endDate: Date!)
1414
}
1515

1616
public class CalendarDateRangePickerViewController: UICollectionViewController {
@@ -59,14 +59,14 @@ public class CalendarDateRangePickerViewController: UICollectionViewController {
5959
}
6060

6161
func didTapCancel() {
62-
delegate.didTapCancel()
62+
delegate.didCancelPickingDateRange()
6363
}
6464

6565
func didTapDone() {
6666
if selectedStartDate == nil || selectedEndDate == nil {
6767
return
6868
}
69-
delegate.didTapDoneWithDateRange(startDate: selectedStartDate!, endDate: selectedEndDate!)
69+
delegate.didPickDateRange(startDate: selectedStartDate!, endDate: selectedEndDate!)
7070
}
7171

7272
}

Example/CalendarDateRangePickerViewController/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ class ViewController: UIViewController {
3030

3131
extension ViewController : CalendarDateRangePickerViewControllerDelegate {
3232

33-
func didTapCancel() {
33+
func didCancelPickingDateRange() {
3434
self.navigationController?.dismiss(animated: true, completion: nil)
3535
}
3636

37-
func didTapDoneWithDateRange(startDate: Date!, endDate: Date!) {
37+
func didPickDateRange(startDate: Date!, endDate: Date!) {
3838
let dateFormatter = DateFormatter()
3939
dateFormatter.dateFormat = "EEEE, MMM d, yyyy"
4040
label.text = dateFormatter.string(from: startDate) + " to " + dateFormatter.string(from: endDate)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Just implement the delegate methods:
2828

2929
```swift
3030
protocol CalendarDateRangePickerViewControllerDelegate {
31-
func didTapCancel()
32-
func didTapDoneWithDateRange(startDate: Date!, endDate: Date!)
31+
func didCancelPickingDateRange()
32+
func didPickDateRange(startDate: Date!, endDate: Date!)
3333
}
3434
```
3535

0 commit comments

Comments
 (0)