XCalendar
is a swift package for calender view to an iOS application. XCalendar
supports from iOS 13 version. This library has the functionality to navigate between months and selection of dates from the calendar.
import UIKit
import XCalender
class ViewController: UIViewController {
@IBOutlet weak var calenderView: XCalenderView?
@IBOutlet weak var selectedMonth: UILabel?
var month = 0
override func viewDidLoad() {
super.viewDidLoad()
calenderView?.dalegate = self
self.calenderView?.getMonth(by: month)
// Do any additional setup after loading the view.
}
@IBAction func nextPrevAction(sender: UIButton) {
if sender.tag == 0 {
//for prevous month dates
month -= 1
} else {
//for next month dates
month += 1
}
self.calenderView?.getMonth(by: month)
}
}
extension ViewController: XCalenderDelegate {
func didSelected(date: Date) {
self.selectedMonth?.text = date.string(with: "dd MMM yyyy")
}
}
-I'm welcoming the community to make changes to this library. Anyone can raise pullrequest so that we can extend the functionality together.
link |
Stars: 0 |
Last commit: 3 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics