YFCalendar 0.1.2

YFCalendar 0.1.2

测试已测试
语言语言 SwiftSwift
许可 MIT
发布上次发布2016 年 8 月
SPM支持 SPM

yangfan 维护。



  • pushian

YFCalendar

Demo Gif

示例

要运行示例项目,首先克隆仓库,然后在 Example 目录中运行 pod install

要求

安装

YFCalendar 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile 中

pod "YFCalendar"

如何使用

初始化

var calendarView = YFCalendarView()
calendarView.calendarViewDelegate = self

代理函数

  • 根据 DateType 和 DateState 设置日期标签的一般颜色。
optional func calendarView(calenderView: YFCalendarView, setGeneralColor dateType: DateType, dateState: DateState) -> UIColor?
  • 根据 DateType 和 DateState 设置日期标签的一般字体。
optional func calendarView(calenderView: YFCalendarView, SetGeneralFont dateType: DateType, dateState: DateState) -> UIFont?
  • 设置选择日期时背景圆圈的一般边框颜色。
optional func calendarView(calenderView: YFCalendarView, SetSelectionCircleBorderColor dateType: DateType) -> UIColor?
  • 设置选择日期时背景圆圈的一般填充颜色。
optional func calendarView(calenderView: YFCalendarView, SetSelectionCircleFillColor dateType: DateType) -> UIColor?
  • 定义在滚动到新月份时是否自动选择第一天。
optional func calendarView(calenderView: YFCalendarView, autoSelectTheFirstDateOfTheNewMonth mode: SelectionMode) -> Bool
  • 在新月份将要在视图中呈现之前会调用。
optional func calendarView(calenderView: YFCalendarView, willPresentTheMonth theMonth: YFMonthView) -> Void
  • 在新月份已在视图中呈现之后会调用。
optional func calendarView(calenderView: YFCalendarView, didPresentTheMonth theMonth: YFMonthView) -> Void
  • 在日期被选择后会调用。
optional func calendarView(calenderView: YFCalendarView, didSelectADay selectedDay: YFDayView) -> Void
  • 在日期被取消选择后会调用。
optional func calendarView(calenderView: YFCalendarView, didDeselectADay deselectedDay: YFDayView) -> Void
  • 为特定一天自定义日期标签的颜色。这将覆盖一般设置。
optional func calendarView(calenderView: YFCalendarView, customizeColorForTheDay theDay: YFDayView, dateState: DateState) -> UIColor?
  • 为特定一天自定义日期标签的字体。这将覆盖一般设置。
optional func calendarView(calenderView: YFCalendarView, customizeFontForTheDay theDay: YFDayView, dateState: DateState) -> UIFont?
  • 为特定日期选择时自定义背景圆圈的边框颜色。这将覆盖一般设置。
optional func calendarView(calenderView: YFCalendarView, customizeSelectionCircleBorderColorForTheDay theDay: YFDayView) -> UIColor?
  • 为特定日期选择时自定义背景圆圈的填充颜色。这将覆盖一般设置。
optional func calendarView(calenderView: YFCalendarView, customizeSelectionCircleFillColorForTheDay theDay: YFDayView) -> UIColor?
  • 为特定一天自定义日期视图。这将覆盖一般设置。
optional func calendarView(calenderView: YFCalendarView, customizeContentViewForTheDay theDay: YFDayView, dateState: DateState) -> UIView?
  • 在初始化期间在特定日期添加点。
optional func calendarView(calenderView: YFCalendarView, initializeDotsForTheDay theDay: YFDayView) -> [UIColor]?
  • 禁用特定日期的用户交互。
optional func calendarView(calenderView: YFCalendarView, disableUserInteractionForTheDay theDay: YFDayView) -> Bool
  • 设置日历视图的选择模式。默认值是 .Single。
optional func calendarViewSetDateSelectionMode(calenderView: YFCalendarView) -> SelectionMode
  • 设置日历视图的滚动方向。默认值是 .Horizontal。
optional func calendarViewSetScrollDirection(calenderView: YFCalendarView) -> CalendarScrollDirection
  • 控制日期选择的动画。默认值为 true。
optional func calendarViewTurnOnSelectionAnimation(calenderView: YFCalendarView) -> Bool
  • 如果设置为 true,当用户在月份之外点击日期时,视图会自动滚动到相应的月份。默认值为 true。
optional func calendarViewAutoScrollToTheNewMonthWhenTabTheDateOutsideOfTheCurrentMonth(calenderView: YFCalendarView) -> Bool
  • 是否显示当前月份以外的日期。默认值是 true。
optional func calendarViewShowDateOutsideOfTheCurrentMonth(calenderView: YFCalendarView) -> Bool
  • 初始化日历视图时是否自动选择今天。默认值是 true。
optional func calendarViewAutoSelectToday(calenderView: YFCalendarView) -> Bool
  • 定义选中日期时背景圆的半径。
optional func calendarViewSetSelectionCircleRadius(calenderView: YFCalendarView) -> CGFloat
  • 定义选中日期时背景圆的边框宽度。
optional func calendarViewSetSelectionCircleBorderWidth(calenderView: YFCalendarView) -> CGFloat
  • 定义添加到日期上的小点的半径。
optional func calendarViewSetDotMarkRadius(calenderView: YFCalendarView) -> CGFloat
  • 定义点从日期标签中心到 y 轴的距离。
optional func calendarViewSetDotMarkOffsetFromDateCenter(calenderView: YFCalendarView) -> CGFloat
  • 定义两个点之间的距离。
optional func calendarViewSetDistanceBetweenDots(calenderView: YFCalendarView) -> CGFloat
  • 如果点的选中颜色设置为 nil,则在选择模式下点的颜色将与未选中模式相同。
optional func calendarViewSetDotMarkSelectedColor(calenderView: YFCalendarView) -> UIColor?
  • 定义日期标签上方的顶线的颜色。
optional func calendarViewSetTopLineColor(calenderView: YFCalendarView) -> UIColor?
  • 定义日期标签上方顶线的厚度。
optional func calendarViewSetTopLineThickness(calenderView: YFCalendarView) -> CGFloat
  • 是否显示日期标签上方的顶线。
optional func calendarViewShowTopLine(calenderView: YFCalendarView) -> Bool

作者

pushian, [email protected]

许可证

YFCalendar 可在 MIT 许可证下使用。有关更多信息,请参阅 LICENSE 文件。