File tree Expand file tree Collapse file tree
CalendarDateRangePickerViewController/Classes
Example/CalendarDateRangePickerViewController Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import UIKit
1010
1111public protocol CalendarDateRangePickerViewControllerDelegate {
12- func didTapCancel ( )
13- func didTapDoneWithDateRange ( startDate: Date ! , endDate: Date ! )
12+ func didCancelPickingDateRange ( )
13+ func didPickDateRange ( startDate: Date ! , endDate: Date ! )
1414}
1515
1616public 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}
Original file line number Diff line number Diff line change @@ -30,11 +30,11 @@ class ViewController: UIViewController {
3030
3131extension 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)
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ Just implement the delegate methods:
2828
2929``` swift
3030protocol CalendarDateRangePickerViewControllerDelegate {
31- func didTapCancel ()
32- func didTapDoneWithDateRange (startDate : Date! , endDate : Date! )
31+ func didCancelPickingDateRange ()
32+ func didPickDateRange (startDate : Date! , endDate : Date! )
3333}
3434```
3535
You can’t perform that action at this time.
0 commit comments