{"id":2510,"url":"https://github.com/CVCalendar/CVCalendar","last_synced_at":"2025-08-03T00:31:48.862Z","repository":{"id":24634271,"uuid":"28043506","full_name":"CVCalendar/CVCalendar","owner":"CVCalendar","description":"A custom visual calendar for iOS 8+ written in Swift (\u003e= 4.0).","archived":false,"fork":false,"pushed_at":"2022-02-17T16:03:44.000Z","size":4731,"stargazers_count":3484,"open_issues_count":31,"forks_count":614,"subscribers_count":100,"default_branch":"master","last_synced_at":"2024-10-29T15:47:33.159Z","etag":null,"topics":["calendar","calendar-component","calendar-view","calendarview","custom-view","cvcalendar","ios","swift","swift3","swift4"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CVCalendar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-15T15:46:22.000Z","updated_at":"2024-10-29T06:29:44.000Z","dependencies_parsed_at":"2022-07-25T11:15:05.201Z","dependency_job_id":null,"html_url":"https://github.com/CVCalendar/CVCalendar","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVCalendar%2FCVCalendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVCalendar%2FCVCalendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVCalendar%2FCVCalendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVCalendar%2FCVCalendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CVCalendar","download_url":"https://codeload.github.com/CVCalendar/CVCalendar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222340175,"owners_count":16968841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calendar","calendar-component","calendar-view","calendarview","custom-view","cvcalendar","ios","swift","swift3","swift4"],"created_at":"2024-01-05T20:16:15.531Z","updated_at":"2024-12-06T18:30:31.755Z","avatar_url":"https://github.com/CVCalendar.png","language":"Swift","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src =\"https://raw.githubusercontent.com/CVCalendar/CVCalendar/master/Screenshots/CVCalendarIcon.png\" /\u003e\n\u003c/p\u003e\n\n![pod](https://img.shields.io/cocoapods/v/CVCalendar.svg)\n[![License](https://img.shields.io/cocoapods/l/CVCalendar.svg)](http://cocoapods.org/pods/CVCalendar)\n[![Build Status](https://travis-ci.com/CVCalendar/CVCalendar.svg?branch=master)](https://travis-ci.com/CVCalendar/CVCalendar)\n[![Twitter](https://img.shields.io/badge/twitter-@elsesiy-blue.svg)](http://twitter.com/elsesiy)\n\nOverview\n==========\n* [Screenshots](https://github.com/CVCalendar/CVCalendar#screenshots)\n* [GIF Demo](https://github.com/CVCalendar/CVCalendar#gif-demo)\n* [Installation](https://github.com/CVCalendar/CVCalendar#installation)\n* [Usage](https://github.com/CVCalendar/CVCalendar#usage)\n* [Architecture](https://github.com/CVCalendar/CVCalendar#architecture)\n* [Version matrix](https://github.com/CVCalendar/CVCalendar#version-matrix)\n* [Advanced API](https://github.com/CVCalendar/CVCalendar#advanced-api)\n* [For contributors](https://github.com/CVCalendar/CVCalendar#for-contributors)\n\nScreenshots\n==========\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src =\"https://raw.githubusercontent.com/CVCalendar/CVCalendar/master/Screenshots/CVCalendar_White.png\" /\u003e\n\u003c/p\u003e\n\nGIF Demo\n==========\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src =\"https://raw.githubusercontent.com/CVCalendar/CVCalendar/master/Screenshots/Demo_grey.gif\" /\u003e\n\u003c/p\u003e\n\nInstallation\n==========\n\u003ch3\u003e CocoaPods \u003c/h3\u003e\n\n```ruby\npod 'CVCalendar', '~\u003e 1.7.0'\n```\n\nUsage\n==========\n\nUsing CVCalendar isn't difficult at all. There are two actual ways of implementing it in your project:\n* Storyboard setup\n* Manual setup\n\nSo let's get started.\n\nWarning! 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](https://github.com/CVCalendar/CVCalendar/tree/master/CVCalendar) project for more info.\n\n\u003ch3\u003e Storyboard Setup \u003c/h3\u003e\n\n\u003ch4\u003eBasic setup.\u003c/h4\u003e\n\nFirst, you have to integrate **CVCalendar** with your project through **CocoaPods**.\n\nNow you're about to add 2 UIViews to your Storyboard as it shown in the picture below.  \n![alt tag](https://raw.githubusercontent.com/CVCalendar/CVCalendar/master/Screenshots/Pic2.png)\n\nDon't forget to add 2 outlets into your code.\n```swift\n    @IBOutlet weak var menuView: CVCalendarMenuView!\n    @IBOutlet weak var calendarView: CVCalendarView!\n```\n\nTwo views are representing ultimately a MenuView and a CalendarView so they should have corresponding classes. To change their classes go to \u003cb\u003eIdentity Inspector\u003c/b\u003e and set custom classes. When it's done, you'll see in the dock panel something similar to the picture below.  (Blue UIView -\u003e CVCalendarView, Green UIView -\u003e CVCalendarMenuView)\n\n![alt tag](https://raw.githubusercontent.com/CVCalendar/CVCalendar/master/Screenshots/Pic3.png)\n\n\u003e \u003cb\u003eNOTE\u003c/b\u003e: 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.\n\n\u003ch5\u003e Important note. \u003c/h5\u003e\nBefore we move to setting up delegates for customization stuff, you should know that CalendarView's initialization is devided by 2 parts:\n* On Init.\n* On Layout.\n\nAs 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.\n\nSince CVCalendarView and CVCalendarMenuView will be created automatically all you have to do is this (in the ViewController that contains CVCalendar).\n\n````swift\n    override func viewDidLayoutSubviews() {\n        super.viewDidLayoutSubviews()\n\n        menuView.commitMenuViewUpdate()\n        calendarView.commitCalendarViewUpdate()\n    }\n````\n\n\u003ch4\u003eDelegates Setup (Customization).\u003c/h4\u003e\n\nCVCalendar requires to implement two protocols. They are \u003cb\u003eCVCalendarViewDelegate\u003c/b\u003e and \u003cb\u003eCVCalendarMenuViewDelegate\u003c/b\u003e. 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 \u003cb\u003eCVCalendarViewDelegate\u003c/b\u003e and set your controller as a delegate implementing both protocols.\n\nThese protocols stand for getting the data for building CVCalendarView and CVCalendarMenuView. So do not forget to implement them.\n\n[\u003cb\u003eAPI Page\u003c/b\u003e](https://github.com/CVCalendar/CVCalendar/wiki)\n\nA long story in short or customizable properties:\n* Showing weekdays out\n* Moving dot markers on highlighting\n* Showing dot markers on a specific day view\n* Dot marker's color, offset and size\n* Space between week views and day views\n* Day view's label properties (color, background, alpha + different states (normal/highlighted))\n\nBehavior:\n* Day view selection\n* Presented date update\n* Animations on (de)selecting day views\n\nFinally 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 \u003cb\u003eArchitecture Section\u003c/b\u003e). 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.\n\n![alt tag](https://raw.githubusercontent.com/CVCalendar/CVCalendar/master/Screenshots/Pic4.png)\n\nNow 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 [\u003cb\u003ethis page\u003c/b\u003e]\n(https://github.com/CVCalendar/CVCalendar/wiki).\n\nDo NOT forget to connect a particular outlet with your ViewController if you're implementing its protocol.\n\n\u003e \u003cb\u003eNOTE\u003c/b\u003e: 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.\n\n\u003ch3\u003e Manual Setup \u003c/h3\u003e\n\nIf for some reason you'd like to setup **CVCalendar** manually you have to do the following steps.\n\nInitialize **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.\n\n\u003e Note that \u003cb\u003eCVCalendarAppearanceDelegate\u003c/b\u003e should be set before \u003cb\u003eCVCalendarViewDelegate\u003c/b\u003e so your changes can be applied.\n\nFor **CVCalendarMenuView** you simply initialize it as well as CVCalendarView and it requires to implement **CVCalendarMenuViewDelegate** protocol.\n\nHow it should look like.\n\n```swift\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        // CVCalendarMenuView initialization with frame\n        self.menuView = CVCalendarMenuView(frame: CGRectMake(0, 0, 300, 15))\n\n        // CVCalendarView initialization with frame\n        self.calendarView = CVCalendarView(frame: CGRectMake(0, 20, 300, 450))\n\n        // Appearance delegate [Unnecessary]\n        self.calendarView.calendarAppearanceDelegate = self\n\n        // Animator delegate [Unnecessary]\n        self.calendarView.animatorDelegate = self\n\n        // Menu delegate [Required]\n        self.menuView.menuViewDelegate = self\n\n        // Calendar delegate [Required]\n        self.calendarView.calendarDelegate = self\n    }\n```\n\nAnd do not forget to commit updates on `viewDidLayoutSubviews` method.\n\n```swift\n    override func viewDidLayoutSubviews() {\n        super.viewDidLayoutSubviews()\n\n        // Commit frames' updates\n        self.menuView.commitMenuViewUpdate()\n        self.calendarView.commitCalendarViewUpdate()\n    }\n```\n\nHere you go.\n\n[Architecture](https://github.com/CVCalendar/CVCalendar/wiki/Architecture)\n==========\n\nVersion matrix\n==========\n**CVCalendar** adapts the newest swift language syntax but keeps revisions as stated below:\n\n| CVCalendar | Swift    | Xcode          | Release Notes |\n| ---------- | -------- | -------------- | ------------  | \n|     1.6    | 4.x      | 8.x, 9.x, 10.x |     HEAD      |\n|     1.5    | 3.x      | 8.x, 9.x       | swift3-branch |\n|     1.4    | 3.x      | 7.x, 8.0       |  Unsupported  |\n|     1.3    | 2.x      | 7.x            |  Unsupported  |\n|     1.2    | 1.x      | 7.x            |  Unsupported  |\n\n[Advanced API](https://github.com/CVCalendar/CVCalendar/wiki/Advanced-API)\n==========\n\nFor contributors\n==========\nIf 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 :+1:\n","funding_links":[],"categories":["UI","Swift","Content","swift4"],"sub_categories":["Calendar","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCVCalendar%2FCVCalendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCVCalendar%2FCVCalendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCVCalendar%2FCVCalendar/lists"}