All Projects → CVCalendar → Cvcalendar

CVCalendar / Cvcalendar

Licence: mit
A custom visual calendar for iOS 8+ written in Swift (>= 4.0).

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Cvcalendar

Calendarview
Android上一个优雅、万能自定义UI、仿iOS、支持垂直、水平方向切换、支持周视图、自定义周起始、性能高效的日历控件,支持热插拔实现的UI定制!支持标记、自定义颜色、农历、自定义月视图各种显示模式等。Canvas绘制,速度快、占用内存低,你真的想不到日历居然还可以如此优雅!An elegant, highly customized and high-performance Calendar Widget on Android.
Stars: ✭ 7,998 (+132.84%)
Mutual labels:  calendar, calendar-view, calendar-component, calendarview
Calendarview
An Easy to Use Calendar for iOS (Swift 5.0)
Stars: ✭ 429 (-87.51%)
Mutual labels:  calendar, calendar-view, calendar-component
Crunchycalendar
A beautiful material calendar with endless scroll, range selection and a lot more!
Stars: ✭ 465 (-86.46%)
Mutual labels:  custom-view, calendar, calendar-view
Android Week View
Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.
Stars: ✭ 3,347 (-2.56%)
Mutual labels:  custom-view, calendar, calendar-view
Customizablecalendar
CustomizableCalendar is a library that allows you to create your calendar, customizing UI and behaviour
Stars: ✭ 214 (-93.77%)
Mutual labels:  calendar, calendar-view, calendar-component
Material Calendar View
📅 Material Design Calendar compatible with API 11+
Stars: ✭ 360 (-89.52%)
Mutual labels:  custom-view, calendar, calendar-view
Peppy Calendarview
Simple and fast Material Design calendar view for Android.
Stars: ✭ 30 (-99.13%)
Mutual labels:  custom-view, calendar, calendar-view
react-calendar
A no dependencies, lightweight and feature-rich ⚡ calendar component for react.
Stars: ✭ 68 (-98.02%)
Mutual labels:  calendar-component, calendar-view, calendarview
Recyclercalendarandroid
A simple DIY library to generate your own custom Calendar View using RecyclerView, written in Kotlin
Stars: ✭ 83 (-97.58%)
Mutual labels:  calendar, calendar-view, calendar-component
Calendar Ios
Calendar View
Stars: ✭ 154 (-95.52%)
Mutual labels:  calendar, calendar-view, calendar-component
GCCalendar
A customizable calendar view for iOS 9+ written in Swift.
Stars: ✭ 53 (-98.46%)
Mutual labels:  calendar, calendar-component, calendar-view
Eventscalendar
Events Calendar is a user-friendly library that helps you achieve a cool Calendar UI with events mapping. You can customise every pixel of the calendar as per your wish and still achieve in implementing all the functionalities of the native android calendar in addition with adding dots to the calendar which represents the presence of an event on the respective dates. It can be done easily, you are just a few steps away from implementing your own badass looking Calendar for your very own project!
Stars: ✭ 188 (-94.53%)
Mutual labels:  calendar, calendar-view, calendar-component
Yycalendar
Simple and Clear Calendar
Stars: ✭ 46 (-98.66%)
Mutual labels:  calendar, calendar-view, calendar-component
Xamarin.plugin.calendar
Calendar plugin for Xamarin.Forms
Stars: ✭ 159 (-95.37%)
Mutual labels:  calendar, calendar-view, calendar-component
Primedatepicker
PrimeDatePicker is a tool that provides picking a single day, multiple days, and a range of days.
Stars: ✭ 292 (-91.5%)
Mutual labels:  calendar, calendar-view, calendar-component
Recal
A minimal, accessible React/Preact calendar component using modern CSS.
Stars: ✭ 191 (-94.44%)
Mutual labels:  calendar, calendar-component
Calendarview
A highly customizable calendar library for Android, powered by RecyclerView.
Stars: ✭ 2,862 (-16.68%)
Mutual labels:  calendar, calendarview
Vue Functional Calendar
Vue.js Functional Calendar | Component/Package
Stars: ✭ 314 (-90.86%)
Mutual labels:  calendar, calendar-component
Angular Calendar
A calendar component for Angular 12.0+ that can display events on a month, week or day view. The successor of angular-bootstrap-calendar.
Stars: ✭ 2,312 (-32.69%)
Mutual labels:  calendar, calendar-component
Supercalendar
@deprecated android 自定义日历控件 支持左右无限滑动 周月切换 标记日期显示 自定义显示效果跳转到指定日期
Stars: ✭ 2,732 (-20.47%)
Mutual labels:  calendar, calendar-view

pod License Build Status Twitter

Overview

Screenshots

GIF Demo

Installation

CocoaPods

pod 'CVCalendar', '~> 1.7.0'

Usage

Using CVCalendar isn't difficult at all. There are two actual ways of implementing it in your project:

  • Storyboard setup
  • Manual setup

So let's get started.

Warning! Since 1.1.1 version CVCalendar requires an implementation of two protocols CVCalendarViewDelegate and CVCalendarMenuViewDelegate, please implement both. Also note, they both have a method with the same signature which means you need to impement it only once. Take a look at the Demo project for more info.

Storyboard Setup

Basic setup.

First, you have to integrate CVCalendar with your project through CocoaPods.

Now you're about to add 2 UIViews to your Storyboard as it shown in the picture below.
alt tag

Don't forget to add 2 outlets into your code.

    @IBOutlet weak var menuView: CVCalendarMenuView!
    @IBOutlet weak var calendarView: CVCalendarView!

Two views are representing ultimately a MenuView and a CalendarView so they should have corresponding classes. To change their classes go to Identity Inspector and set custom classes. When it's done, you'll see in the dock panel something similar to the picture below. (Blue UIView -> CVCalendarView, Green UIView -> CVCalendarMenuView)

alt tag

NOTE: Please note that both CalendarView and MenuView are calculating their content's frames depending on their own ones. So in your projects you may be editing the size of initial UIViews in the storyboard to reach an optimal content size.

Important note.
Before we move to setting up delegates for customization stuff, you should know that CalendarView's initialization is devided by 2 parts: * On Init. * On Layout.

As well as most of the developers are using AutoLayout feature UIView's size in the beginning of initialization does not match the one on UIView's appearing. Thus we have either to initialize ContentView with MonthViews and all the appropriate stuff on UIView's appearing or initialize stuff as UIView's being initialized and then simply update frames. The first option doesn't work since there will be a flash effect (the initialization will be finished after your UIView appeared) according to what the CVCalendar has 2 parts of creating.

Since CVCalendarView and CVCalendarMenuView will be created automatically all you have to do is this (in the ViewController that contains CVCalendar).

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()

        menuView.commitMenuViewUpdate()
        calendarView.commitCalendarViewUpdate()
    }

Delegates Setup (Customization).

CVCalendar requires to implement two protocols. They are CVCalendarViewDelegate and CVCalendarMenuViewDelegate. Note that the last one has exactly the same named method as the first one declares which means you have to implement only required methods in CVCalendarViewDelegate and set your controller as a delegate implementing both protocols.

These protocols stand for getting the data for building CVCalendarView and CVCalendarMenuView. So do not forget to implement them.

API Page

A long story in short or customizable properties:

  • Showing weekdays out
  • Moving dot markers on highlighting
  • Showing dot markers on a specific day view
  • Dot marker's color, offset and size
  • Space between week views and day views
  • Day view's label properties (color, background, alpha + different states (normal/highlighted))

Behavior:

  • Day view selection
  • Presented date update
  • Animations on (de)selecting day views

Finally we're going to customize properties. To make this possible you have to implement approptiate protocols. (You can see presented protocols and short descriptions in the Architecture Section). Open your Storyboard and do a right-click on CVCalendarView, you'll see the window with outlets and there are a few ones we actually need. Take a look at the picture to make sure you're doing everything properly.

alt tag

Now depending on what you'd like to change you should implement a particular protocol providing methods for customizing that stuff. For delegates' API description take a look at [this page] (https://github.com/CVCalendar/CVCalendar/wiki).

Do NOT forget to connect a particular outlet with your ViewController if you're implementing its protocol.

NOTE: CVCalendar defines default values for all the customizable properties (i.e. for ones defined in the presented protocols). Thus far if you don't implement protocols yourself the calendar will behave as it was initially designed.

Manual Setup

If for some reason you'd like to setup CVCalendar manually you have to do the following steps.

Initialize CVCalendarView with either init or init:frame methods. I suggest to do it in viewDidLoad method. Do NOT put initialization in viewDidAppear: or viewWillAppear: methods! Then setup delegates if you're going to customize options.

Note that CVCalendarAppearanceDelegate should be set before CVCalendarViewDelegate so your changes can be applied.

For CVCalendarMenuView you simply initialize it as well as CVCalendarView and it requires to implement CVCalendarMenuViewDelegate protocol.

How it should look like.

    override func viewDidLoad() {
        super.viewDidLoad()

        // CVCalendarMenuView initialization with frame
        self.menuView = CVCalendarMenuView(frame: CGRectMake(0, 0, 300, 15))

        // CVCalendarView initialization with frame
        self.calendarView = CVCalendarView(frame: CGRectMake(0, 20, 300, 450))

        // Appearance delegate [Unnecessary]
        self.calendarView.calendarAppearanceDelegate = self

        // Animator delegate [Unnecessary]
        self.calendarView.animatorDelegate = self

        // Menu delegate [Required]
        self.menuView.menuViewDelegate = self

        // Calendar delegate [Required]
        self.calendarView.calendarDelegate = self
    }

And do not forget to commit updates on viewDidLayoutSubviews method.

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()

        // Commit frames' updates
        self.menuView.commitMenuViewUpdate()
        self.calendarView.commitCalendarViewUpdate()
    }

Here you go.

Architecture

Version matrix

CVCalendar adapts the newest swift language syntax but keeps revisions as stated below:

CVCalendar Swift Xcode Release Notes
1.6 4.x 8.x, 9.x, 10.x HEAD
1.5 3.x 8.x, 9.x swift3-branch
1.4 3.x 7.x, 8.0 Unsupported
1.3 2.x 7.x Unsupported
1.2 1.x 7.x Unsupported

Advanced API

For contributors

If you've any remarks please feel free to open up an issue or submit PRs. Please make sure to adhere to the provided issue template while doing so. Also note that the Demo project is supposed to test the changes on CVCalendar. If you've committed any, do not forget to check if everything compiles and works as intended and update the docs accordingly. Thanks 👍

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].