Latest 0.4.0
Homepage https://github.com/AlphaDog13/RXCalendarView
License MIT
Platforms ios 8.0, requires ARC
Frameworks Foundation, UIKit

内容

样例

RXCalendarView RXCalendarView RXCalendarView

需要

  • iOS 8.0+
  • Xcode 9.0+
  • Swift 3.0+

使用

CocoaPods

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
pod 'RXCalendarView', '~> 0.4.0'
end

开始

初始化

class ViewController: UIViewController, RXCalendarDelegate, RXCalendarDataSource {

//月历
lazy var calendarView: RXCalendarContainerView = {
    let view: RXCalendarContainerView = RXCalendarContainerView(frame: CGRect.zero, scrollDirection: RXCalendarScrollDirection.scrollVertical)
    view.dataSource = self
    view.delegate = self
    view.translatesAutoresizingMaskIntoConstraints = false
    return view
}()

//年历
lazy var yearCalendarView: RXYearScrollView = {
    let view: RXYearScrollView = RXYearScrollView(frame: CGRect.zero, year: "2020", scrollDirection: RXCalendarScrollDirection.scrollHorizonal)
    view.translatesAutoresizingMaskIntoConstraints = false
    view.yearScrollViewDelegate = self
    return view
}()

RXCalendarDataSource

func signDateInMonth(view: RXCalendarView) -> [String]  //需标记的日期 [yyyy-MM-dd]
func rxCalendarSelectColor() -> UIColor                 //选中颜色
func rxCalendarSignColor() -> UIColor                   //标记颜色
func rxCalendarNotInMonthColor() -> UIColor             //非当月颜色

RXCalendarDelegate

func calendarAction(_ dayInfo: RXDateObject)            //选中日期信息
func didScrollToNextMonth(_ monthInfo: RXMonthObject)   //当前月份信息

RXYearScrollViewDelegate

func yearScrollView(currentYear yearStr: String)             //当前显示年份
func yearScrollViewSelect(didSelectMonth monthStr: String)   //选择月份

相关类

RXDateObject

@objc open var dayStr: String           //dd
@objc open var dateStr: String          //yyyy-MM-dd
@objc open var isToday: Bool            //是否 今日
@objc open var isInCurrentMonth: Bool   //是否 当月日期
@objc open var isSign: Bool             //是否 标记
@objc open var isSelected: Bool         //是否 选中

RXMonthObject

@objc open var monthStr: String     //yyyy-MM      
@objc open var monthStartDateStr    //本月开始日期
@objc open var monthEndDateStr      //本月结束日期
@objc open var calendarSize         //单月viewSize

License

RXCalendarView is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "RXCalendarView",
    "version": "0.4.0",
    "summary": "An Calendar",
    "homepage": "https://github.com/AlphaDog13/RXCalendarView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "AlphaDog13",
    "source": {
        "git": "https://github.com/AlphaDog13/RXCalendarView.git",
        "tag": "0.4.0"
    },
    "source_files": "RXCalendarView/*.swift",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This