Skip to content
SSCalendarControl is small and highly customizable calendar control written in swift.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
SSCalendar - Swift 5.0 update Jul 9, 2019
docs - Documentation added with jazzy May 7, 2019
.gitignore Initial commit May 3, 2019
LICENSE Initial commit May 3, 2019
README.md - Swift 5.0 update Jul 9, 2019
SSCalendarControl.podspec
SSCalendar_Demo.gif - Demo gif added May 7, 2019
SSCalendar_Usage.png - Duplicate podspec removed May 7, 2019

README.md

SSCalendarControl

SSCalendarControl is small and highly customizable calendar control written in swift.

Swift Version Build Status License Platform PRs Welcome

Alt text

Features!

  • Customizable control
  • Flexible date range
  • Customizable week day
  • Selection delegates
  • Customizable month and days cells
  • CocoaPods

Requirements

  • iOS 10.0+
  • Xcode 9+

Installation

  • You can use CocoaPods to install SSCalendarControl by adding it to your Podfile:

     use_frameworks!
     pod 'SSCalendarControl'
    
  •  import UIKit
     import SSCalendarControl
    

Manually

  • Download and drop SSCalendarControl folder in your project.
  • Congratulations!

Usage example

  • In the storyboard add a UIView and change its class to SSCalendarView Alt text

Setup Calendar

calendarView.setUpCalendar(startDate: startDate, endDate: endDate, weekStartDay: .monday, shouldSelectPastDays: true, sholudAllowMultipleSelection: false)

Weekday Customization

calendarView.configuration.weekDayBorderColor = UIColor.black
calendarView.configuration.weekDayLabelBackgroundColor = UIColor.clear
calendarView.configuration.weekDayLabelTextColor = UIColor.black

Month Customization

calendarView.configuration.monthViewBackgroundColor = UIColor.white
calendarView.configuration.monthViewBottomLineColor = UIColor.darkGray
calendarView.configuration.monthLabelFont = UIFont.systemFont(ofSize: 20)
calendarView.configuration.monthLabelTextColor = UIColor.red

Days Customization

calendarView.configuration.previousDayTextColor = UIColor.black
calendarView.configuration.previousDayBorderColor = UIColor.clear
calendarView.configuration.upcomingDaysBorderColor = UIColor.clear
calendarView.configuration.upcomingDaysBorderColor = UIColor.clear
calendarView.configuration.upcomingDayTextColor = UIColor.brown
calendarView.configuration.selectedDayTextColor = UIColor.yellow
calendarView.configuration.currentDayBorderColor = UIColor.black
calendarView.configuration.currentDayTextColor = UIColor.white
calendarView.configuration.currentDayBackgroundColor = UIColor.red

Selection Delegates

calendarView.delegate = self

extension ViewController: SSCalendarDeleagte {

    func dateSelected(_ date: Date) {
        print("selected: \(date)")
    }

    func dateDeSelected(_ date: Date) {
        print("deSelected: \(date)")
    }
}

Contribute

  • We would love you for the contribution to SSCalendarControl, check the LICENSE file for more info.

Meta

  • Distributed under the MIT license. See LICENSE for more information.
You can’t perform that action at this time.