CalendarView 1.1.2

CalendarView 1.1.2

LangLanguage SwiftSwift
License MIT
ReleasedLast Release Feb 2016
SPMSupports SPM

Maintained by Nate Armstrong, Nate Armstrong.



To run the example project, clone the repo, and run pod install from the CalendarViewDemo directory first.


  • iOS 8.3+
  • Xcode 6.3


CalendarView is available through Carthage and CocoaPods. To install it, simply add the following line to your Podfile:

pod "CalendarView"




Use the CalendarView class in code:

let calendar = CalendarView(frame: CGRectMake(0, 0, CGRectGetWidth(view.frame), 320))

or as an outlet (supports auto layout)

@IBOutlet weak var calendar: CalendarView!

Select specific date

The selected date is the current date by default. You can select any date by using the selectDate(date: Moment) method.

let date: NSDate = MY_NSDATE


A CalendarView’s delegate is notified of two events:

calendarDidSelectDate(date: Moment) // called when user taps a date
calendarDidPageToDate(date: Moment) // called when users swipes month

The CalendarView class uses SwiftMoment for date manipulation.

Example use of delegate calls

extension ViewController: CalendarViewDelegate {

  func calendarDidSelectDate(date: Moment) {
    title = date.format(dateFormat: "MMMM d, yyyy")

  func calendarDidPageToDate(date: Moment) {
    title = date.format(dateFormat: "MMMM d, yyyy")



The aim is to allow the calendar to be as customizable as possible without making it overly complex and bloated.


You can customize the look of the calendar by setting certain class properties of CalendarView.

import UIKit
import CalendarView

class AppDelegate: UIResponder, UIApplicationDelegate {

  var window: UIWindow?

  func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Calendar appearance
    CalendarView.daySelectedBackgroundColor = UIColor.secondaryColor()
    CalendarView.daySelectedTextColor = UIColor.whiteColor()
    CalendarView.todayBackgroundColor = UIColor(white: 0.0, alpha: 0.3)
    CalendarView.todayTextColor = UIColor.whiteColor()
    CalendarView.otherMonthBackgroundColor = UIColor.clearColor()
    CalendarView.otherMonthTextColor = UIColor(white: 1.0, alpha: 0.3)
    CalendarView.dayTextColor = UIColor(white: 1.0, alpha: 0.6)
    CalendarView.dayBackgroundColor = UIColor.clearColor()
    CalendarView.weekLabelTextColor = UIColor(white: 1.0, alpha: 0.3)

    return true

Selected date on swipe

By default the first day of the month is automatically selected when the user swipes to a different month. You can customize this behavior by modifying the selectedDayOnPaged property of your CalendarView instance:

public var selectedDayOnPaged: Int? = 1

If set to nil, no day will be automatically selected on swipe.


Nate Armstrong, [email protected]


CalendarView is available under the MIT license. See the LICENSE file for more info.