A set of views and controllers for displaying and scheduling events on iOS

Related tags

Calendar Calendar
Overview

CalendarLib

Version License Platform

CalendarLib is a set of views and controllers for displaying and scheduling events on iOS.

Warning:

As some people may have noticed, this project has not got any update recently, and a lot of issues / pull requests remain unanswered. I’m very sorry for that, but I don’t have any time at the moment to take care of this repo, being very busy with other projects. I may come back to it in the future, but meanwhile, please don’t expect any update soon.

Thanks anyway to all the contributors!

Day Planner View Day Planner View Month Planner View Month Planner View Year Calendar View

Features

  • Create and schedule events with iCal-like views and controllers
  • 3 kinds of views are available (a day planner view, a month planner view and a year view)
  • Scroll infinitely through days / months, or restrict scrolling to a given date range
  • Restrict range of displayed hours in the day planner view
  • Page through weeks in the day planner view or months in the month planner view
  • Use a standard view for event cells or create your own custom views
  • Easily customize appearance and layout (date format, colors, fonts, size of headers, number of visible days...)
  • Create events by tap-and-hold on the view
  • Drag-and-drop events to another date or time
  • Scroll through days / months while dragging
  • Specialized controllers for EventKit data source but can easily work with any custom event provider
  • Background event loading for the EventKit controllers
  • Ability to show an activity indicator for days while events are loading
  • Restrict ability to create or move events to certain dates through datasource protocol methods
  • Zoom in/out the day planner view to increase or decrease the height of hour slots
  • Dim certain time ranges in the day planner view

Compatibility

iPad / iPhone with iOS 8 or higher.

Installation

CocoaPods

The best way is to use CocoaPods. Add the following line to your Podfile :

pod "CalendarLib"

The old way

If you don't want to use CocoaPods, you need to copy the content of the CalendarLib folder into your project, as well as the source of the two dependencies : OSCache and OrderedDictionary.

Getting started

  1. If you want to use EventKit as a data source, create an instance of MGCDayPlannerEKViewController or MGCMonthPlannerEKViewController, or subclass them for your own needs.

    Don't forget to add the following frameworks to the project:

    • EventKit.framework
    • EventKitUI.framework
  2. If you want to use another event provider, subclass one of MGCDayPlannerViewController or MGCMonthPlannerViewController and implement the data source protocol methods.

  3. If you want to use a custom event cell, subclass MGCEventView or MGCStandardEventView and register the class with the day / month planner view.

See the demo project to get an idea of how to use the library and check the documentation

License

CalendarLib is available under the MIT license. See the LICENSE file.

Change-log

A summary of each CalendarLib release can be found in the CHANGELOG.

Comments
  • pod CalendarLib pulls 1.0 by default still

    pod CalendarLib pulls 1.0 by default still

    Thanks so much for providing this great repo! I was wondering why I saw a difference between what was pulled into my project than what I saw in the repo, and noticed in my Podfile.lock that it downloaded 1.0, even though 2.0 is what is listed on cocoapods.org. I specified a specific commit, and that worked, but I don't like that as a long-term solution. Am I missing something?

    opened by SixFiveSoftware 7
  • CocoaPod release?

    CocoaPod release?

    Hello!

    Our app is using your library, and you included a few additions recently (being able to set colors, restrict timeframe) which we really need before the release. I see that you are actively improving the library currently. When do you plan to release a new CocoaPod version which includes these changes? Shall I wait for it or just use a git source in my project?

    opened by gklka 7
  • I need you help!!!

    I need you help!!!

    Very thank you for your SDK. I got a problem that I need to page all the weekView, it is just like google's tiny calendar, it can scroll seven days when user scroll the screen, can you give me some tips to reach the same function? May you can provide a property set it ? I am waiting for you message, thank you! this is the connect of google's tiny calendar https://itunes.apple.com/us/app/tiny-calendar-sync-google/id514917848?mt=8

    opened by dito010 5
  • Multi-day views issue on dayPlannerView

    Multi-day views issue on dayPlannerView

    Hi,

    I am trying to use viewForEventOfType: within my controller which extends from MGCDayPlannerViewController. I only use MGCTimedEventTypes and they work fine as long as they don't overlap days. If they overlap, all next days plus same day appear as all-day, see attachment.

    I do set the range with dateRangeForEventOfType:, where I'm essentially returning [MGCDateRange dateRangeWithStart:event.beginDate end:event.endDate];

    Last place I can imagine go wrong is the numberOfEventsOfType: method. Currently I use an NSDictionary<NSString *, NSArray *>, where the key is the format string of the begin date of the event (so no knowledge of overlapping) and the value is the array of events starting at that day. What does this method expect exactly? if I have only one event from 1 July 13:00 to 3 July 19:00; does it mean that: 1 July returns 1 2 July returns 1 3 July returns 1 ?

    Thanks a lot

    img_0136

    opened by sebastienkb 4
  • Overriding default action when long-press

    Overriding default action when long-press

    Hi,

    I'm new to this but your library looks very promising. In your demo app, long-press invokes what I'm assuming is the popup of the default event view. Can we override this to something else? For the sake of an example, how can one override this to an NSLog presenting the new date?

    Thanks

    opened by sebastienkb 4
  • How to set an alpha or remove this gray bar that appears under the header?

    How to set an alpha or remove this gray bar that appears under the header?

    I see in some of the screenshots on the repository that there is a transparent bar under the header, but when I add the calendar in my project there is always this gray bar that is not transparent. So I would like to know how to set an alpha on it, so I could actually put it to 0, if there is a way of removing it, even better.

    See the screenshot with the bar: screen shot 2016-10-20 at 12 45 41

    And with alpha as showed in the repository page: screen shot 2016-10-20 at 12 43 24

    opened by robertoferraz 3
  • Edit source of events

    Edit source of events

    Hi,

    Currently the demo app loads the calendar from the device itself, and I did not notice a method to change the data source on controller level. Is there a way to set our own events, for example by parsing a custom JSON array to an NSArray? (assuming the items comply to a specific structure)

    Thanks for all this work.

    opened by sebastienkb 3
  • Limiting day/week view start size

    Limiting day/week view start size

    Hi Julien. First of all, thanks for your good work here, saved me lots of time.

    I can't limit properly the starting hour of a MGCDayPlannerView. I want to limit the view so users can't scroll before 08.00 AM, for example. In my current app, really makes no sense that users plan activities between 00.00 and 08.00. I was trying to play with content offsets on scrolling views, with no luck. Can you kindly explain me (or, at least, orient me) about this matter?

    Thanks in advance

    opened by pulimento 3
  • Complex layouting for day view

    Complex layouting for day view

    Fixes #42: Added eventCoveringType to MGCDayPlannerView. You can switch between classic and complex layouts. Complex tries to fill the available space in the day planner view horizontally with the events without having them overlap each other.

    opened by gklka 2
  • grey row at the top of dayPlannerView

    grey row at the top of dayPlannerView

    Hello, thanks for your library, it is very cool and quite easy to customize. I have one problem. Is there any possibility to get rid of that grey row at the top of day planner View ? screen shot 2016-08-11 at 18 44 14

    Many thanks

    cheers Wojtek

    opened by Wojtek1234 2
  • Device Rotation Error

    Device Rotation Error

    I am getting this error on device rotation when using single day display on iPhone.

    'Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.'

    I am not exactly sure how to fix it. I also got odd drawing artefacts on rotation animation - the displayed text in an eventView stretches out like it was written on silly-putty.

    Also, the day column does not expand properly during animation (when going from portrait to landscape) so that it displays 2 columns instead of 1 column at the end of rotation.

    opened by ezathashim 2
  • Multi-day events always stop at the end of each line

    Multi-day events always stop at the end of each line

    I created a few simple lines of code just to show some events. I set each event with a duration of 3 days. But the problem is, every time it reaches the end of each line / month, the event always stops. Any ideas what I missed? Thanks in advance!

    Here is the preview of the screen: Screen Shot 2020-10-02 at 01 04 11

    class ChartVc: BaseViewController, MGCMonthPlannerViewDataSource, MGCMonthPlannerViewDelegate {
        @IBOutlet weak var monthPlannerView: MGCMonthPlannerView!
    
        override func viewDidLoad() {
            super.viewDidLoad()
            self.monthPlannerView.dateFormat = "dd"
            self.monthPlannerView.style = .events
            self.monthPlannerView.monthHeaderStyle = .short
            self.monthPlannerView.gridStyle = .default
            
            self.monthPlannerView.pagingMode = .headerTop
    
            self.monthPlannerView.dataSource = self
            self.monthPlannerView.delegate = self
            
            self.monthPlannerView.backgroundColor = .white
            self.monthPlannerView.canCreateEvents = false
            self.monthPlannerView.canMoveEvents = false
        }
        
        override func viewDidLayoutSubviews() {
            super.viewDidLayoutSubviews()
            self.monthPlannerView.rowHeight = (self.monthPlannerView.height - 200 ) / 5
            self.monthPlannerView.layoutIfNeeded()
        }
        
        func monthPlannerView(_ view: MGCMonthPlannerView!, numberOfEventsAt date: Date!) -> Int {
            if (date.components?.day ?? 1) % 3 == 0 { return 1 }
            return 0
        }
        
        func monthPlannerView(_ view: MGCMonthPlannerView!, dateRangeForEventAt index: UInt, date: Date!) -> MGCDateRange! {
            return MGCDateRange(start: date, end: date.addingTimeInterval(3600 * 48))
        }
        
        func monthPlannerView(_ view: MGCMonthPlannerView!, cellForEventAt index: UInt, date: Date!) -> MGCEventView! {
            let view = MGCStandardEventView()
            view.title = "Haloooo"
            view.color = .randomPastel()
            return view
        }
    }
    
    
    opened by asadardiansyah 0
  • How to show current time indicator on top of Event cell ?

    How to show current time indicator on top of Event cell ?

    If event is from 10 AM to 11 AM and current time is 10:15 AM . I wish to show the current time indicator on the top of Event cell , currently it goes below the event cell .

    opened by viveksomaiya1103 0
  • The best library ever - how about Carthage?

    The best library ever - how about Carthage?

    I have to say, despite not being maintained for 2 years and some issues, this is still the absolute best off-the-shelf library i could find after a solid day of working.

    @jumartin i only wish you found a bit of time to clean up outstanding issues, upgrade the code to latest versions of SDK and maybe add Carthage support?

    opened by az-oolloow 1
  • Problem with iOS 11.1.2

    Problem with iOS 11.1.2

    Hi, Only with 11.1.2 iOS version, there is a strange bug. All events are on current date. Please see attached images.

    App is used by thousand users who told us that there are no problems with others versions.

    Thanks montmorency 1 - agenda montmorency 4 - agenda

    opened by florianhenonin 1
Owner
Julien Martin
Julien Martin
The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable

Q: How will my calendar dateCells look with this library? A: However you want them to look. More Images Features Range selection - select dates in a r

PatchTheCode 7.3k Jan 2, 2023
📅 Calendar for iOS, iPadOS and macOS in Swift

CalendarKit CalendarKit is a Swift calendar UI library for iOS, iPadOS and Mac Catalyst. It looks similar to the Apple Calendar app out-of-the-box, wh

Richard Topchii 2.2k Jan 5, 2023
A nicer iOS UI component for picking date and time

DateTimePicker A nicer iOS UI component for picking date and time. Features Date and Time Picker / Date Picker only / Time Picker only - your choice!

Huong Do 1.9k Jan 4, 2023
An open source calendar framework for iOS, with support for customization, IBDesignable, Autolayout, and more.

About MBCalendarKit is a calendar control written in Objective-C with modern best practices and Swift interoperability in mind. It offers a flexible c

Moshe 563 Oct 27, 2022
A fully customizable iOS calendar library, compatible with Objective-C and Swift

Table of contents Screenshots Installation Pre-knowledge Support Contact Screenshots iPhone iPad Safe Orientation Today Extension iOS8/9 iOS10 Interac

Wenchao Ding 10.2k Jan 2, 2023
A library that expresses a github contribution calendar through an array of dates. Supports iOS and macOS.

A library that expresses a github contribution calendar through an array of dates. Supports iOS and macOS.

jasu 45 Dec 20, 2022
An iOS pre-permissions utility that lets developers ask users on their own dialog for calendar, contacts, location, photos, reminders, twitter, push notifications and more, before making the system-based permission request.

An iOS pre-permissions utility that lets developers ask users on their own dialog for calendar, contacts, location, photos, reminders, twitter, push notifications and more, before making the system-based permission request.

Joe L 420 Dec 22, 2022
An Easy to Use Calendar for iOS (Swift 5.0)

This is an easy to use, "just drag and drop it in your code" type of calendar for iOS. It supports both vertical and horizontal scrolling, as well as

Michael Michailidis 525 Dec 23, 2022
A declarative, performant, iOS calendar UI component that supports use cases ranging from simple date pickers all the way up to fully-featured calendar apps.

HorizonCalendar A declarative, performant, calendar UI component that supports use cases ranging from simple date pickers all the way up to fully-feat

Airbnb 2.2k Jan 4, 2023
SwiftUI Simple Calendar / Date Picker for iOS

RKCalendar RKCalendar is a SwiftUI Calendar / Date Picker for iOS. Features include: minimum and maximum calendar dates selectable, single date select

null 453 Dec 28, 2022
A custom visual calendar for iOS 8+ written in Swift (>= 4.0).

Overview Screenshots GIF Demo Installation Usage Architecture Version matrix Advanced API For contributors Screenshots GIF Demo Installation CocoaPods

null 3.5k Dec 24, 2022
iOS 7+ Calendar (Date Picker) with Infinite Scrolling.

RSDayFlow iOS 7 Calendar with Infinite Scrolling. Only need 4 lines of code to set up. RSDayFlow is a slim fork of DayFlow with updates and extensions

Ruslan Skorb 844 Sep 14, 2022
An availability calendar implementation for iOS

NWCalendarView NWCalendar View is an iOS control that displays a calendar. It is perfect for appointment or availibilty selection. It allows for selec

Nicholas Wargnier 60 May 27, 2021
A customizable calendar view for iOS.

JTCalendar JTCalendar is an easily customizable calendar control for iOS. Installation With CocoaPods, add this line to your Podfile. pod 'JTCalendar'

Jonathan Vukovich-Tribouharet 2.8k Dec 27, 2022
📆 An elegant calendar control for iOS.

NO LONGER MAINTAINED Daysquare An elegant calendar control for iOS. Introduction Get bored with native silly UIDatePicker? You may have a try on this

Cyandev 701 Sep 9, 2022
A calendar control for iOS written in swift with mvvm pattern

ASCalendar try it on appetize Installation CocoaPods You can use CocoaPods to install ASCalendar by adding it to your Podfile: platform :ios, '8.0' us

Alberto Scampini 192 Jun 26, 2022
Today - Swift/iOS Today App

Today App Based on the iOS App Dev Today tutorial Overview Starting point for de

Dave 0 Jan 27, 2022
Simplifies iOS user permission requests (location, push notifications, camera, contacts, calendar, photos, etc).

ICanHas Swift 4 library that simplifies iOS user permission requests (push notifications, location, camera, photo library, contacts, calendar). Instal

Adolfo Rodriguez 91 Jun 2, 2022
Anime Calendar's iOS App - Schedule your seasonal anime to watch!

?? Anime Calendar Anime Calendar's iOS App - Schedule your seasonal anime to watch! Currently in progress UI Uses Xibs and some programmatic views. De

Leonardo 11 Jan 1, 2023