📅 Multiple Calendar for user variable service.
MultiCalendarKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MultiCalendarKit'To use this framework, you need to extension RxSwift
import RxSwift
extension RxSwift.Reactive where Base: UIViewController {
public var viewWillAppear: Observable<Bool> {
return methodInvoked(#selector(UIViewController.viewWillAppear))
.map { $0.first as? Bool ?? false }
}
public var viewWillDisappear: Observable<Bool> {
return methodInvoked(#selector(UIViewController.viewWillDisappear))
.map { $0.first as? Bool ?? false }
}
}The calendar view provided by framework is bind to the lifecycle of the ViewController using it, so requiring the mentioned elements.
First, create a manager object for the desired calendar type, and then pass the required argument values to the initializer of the calendar controller. This will create the necessary components to control the calendar.
private let cellManager: MultiSelectCellManager = .init()
private lazy var cfController: CFController = .init(with: .multiSelectType(self.cellManager), viewWillAppear: self.rx.viewWillAppear.asDriver(onErrorJustReturn: false), viewWillDisappear: self.rx.viewWillDisappear.asDriver(onErrorJustReturn: false))Then, add the calendar view present in the created controller to the desired ViewController where you want to display it.
self.view.addSubview(cfController.calendarView)
cfController.calendarView.snp.makeConstraints { make in
make.leading.trailing.equalToSuperview()
make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top)
make.bottom.equalTo(self.view.safeAreaLayoutGuide.snp.bottom)
}Finally, bind the desired actions to the Relay present in the used manager.
self.cellManager.tappedStartDateRelay
self.cellManager.tappedEndDateRelayPuco, https://wnsxor1993@github.com
MultiCalendarKit is available under the license. See the LICENSE file for more info.