You need to precise your spec a little.
How many days do you want to present ? Only the selected month ?
One way to do : create a scrollView
each day is a 2 lines label that you set with the correct day name and number
enable user interaction for each label, so that user can tap it
Or you can subclass UISegmentedControl.
Creating images as
lun
1
class PickerSegmentedControl: UISegmentedControl {
var allImages : [UIImage] = [] // To be set before calling. Must be the right size
func commonInit() {
let numberOfDays = self.numberOfSegments
for i in 0..numberOfDays where i allImages.count {
self.setImage(allImages[i], forSegmentAt: i)
}
}
override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
commonInit()
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: