I have variable startTime and endTime. In the collectionCell me need to display the start time and end time, but I need to between the start time and the end time was still the time range.
For example:
The day has 24 hours. My startTime is 06:00 and my endTime is 13:00. Me need to display range from 06:00 to 13:00 and in collectionCell i want to see it so:
06:00
07:00
08:00
09:00
10:00
11:00
12:00
13:00
Can I have it display? And how to do it?
My code:
var startTime: String = "06:00"
var endTime: String = "13:00"
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return // what need is there to write?
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "timeCell", for: indexPath) as! BookingTimeCell
cell.timeLabel.text = // what need is there to write?
return cell
}