FSCalendar
FSCalendar copied to clipboard
(Q) How do I insert text or string label into cell?
Hello, WenchaoD
I have a question for you about how to insert text or string label into cell on FSCalendar. As a swift beginner, I've already executed your demo codes and then found fake title when using interface builder. But I have no idea that how to do. So my plan is to populate text with cell from Firebase database like the attached file. Please let me know any tips, APIs and examples. Thanks in advance!
- Jinho
My Development Environment
- Device modal and iOS version - iPhoneX and iOS 11.4.
- Xcode version - xCode 9.4, Swift 4.1
- FSCalendar version - FSCalenda 2.7.9
func calendar(_ calendar: FSCalendar, willDisplay cell: FSCalendarCell, for date: Date, at monthPosition: FSCalendarMonthPosition) {
let labelMy2 = UILabel(frame: CGRect(x: 10, y: 20, width: cell.bounds.width, height: 20))
labelMy2.font = UIFont(name: "Henderson BCG Sans", size: 10)
labelMy2.text = "abc"
labelMy2.layer.cornerRadius = cell.bounds.width/2
labelMy2.textColor = UIColor.init(hex: "#32C77F")
cell.addSubview(labelMy2)
}
Check link : https://stackoverflow.com/questions/62016056/show-event-label-string-on-calendar-view-ios/62047338#62047338
@synabreu Do you have above demo?