CalendarView alternatives and similar libraries
Based on the "UI" category.
Alternatively, view CalendarView alternatives based on common mentions on social networks and blogs.
-
Charts
Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart. -
Animated Tab Bar
:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion -
LTMorphingLabel
[EXPERIMENTAL] Graceful morphing effects for UILabel written in Swift. -
folding-cell
:octocat: 📃 FoldingCell is an expanding content cell with animation made by @Ramotion -
NVActivityIndicatorView
A collection of awesome loading animations -
FSPagerView
FSPagerView is an elegant Screen Slide Library. It is extremely helpful for making Banner View、Product Show、Welcome/Guide Pages、Screen/ViewController Sliders. -
JTAppleCalendar
The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable -
SwiftMessages
A very flexible message bar for iOS written in Swift. -
TextFieldEffects
Custom UITextFields effects inspired by Codrops, built using Swift -
SwiftEntryKit
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps. -
AMScrollingNavbar
Scrollable UINavigationBar that follows the scrolling of a UIScrollView -
Pagemenu
A paging menu controller built from other view controllers placed inside a scroll view (like Spotify, Windows Phone, Instagram) -
SwipeCellKit
Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift. -
Macaw
Powerful and easy-to-use vector graphics Swift library with SVG support -
Alerts Pickers
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date... -
PermissionScope
A Periscope-inspired way to ask for iOS permissions. -
SPPermission
Universal API for request permission and get its statuses. -
Scrollable-GraphView
An adaptive scrollable graph view for iOS to visualise simple discrete datasets. Written in Swift. -
Material Components for iOS
[In maintenance mode] Modular and customizable Material Design UI components for iOS -
SCLAlertView
Beautiful animated Alert View. Written in Swift -
SideMenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less. -
NotificationBanner
The easiest way to display highly customizable in app notification banners in iOS -
Instructions
Create walkthroughs and guided tours (coach marks) in a simple way, with Swift. -
ESTabBarController
:octocat: ESTabBarController is a Swift model for customize UI, badge and adding animation to tabbar items. Support lottie! -
ActiveLabel
UILabel drop-in replacement supporting Hashtags (#), Mentions (@) and URLs (http://) written in Swift -
PopupDialog
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style. -
SlideMenuControllerSwift
iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift. -
Siren
Notify users when a new version of your app is available and prompt them to upgrade. -
TLYShyNavBar
Unlike all those arrogant UINavigationBar, this one is shy and humble! Easily create auto-scrolling navigation bars! -
DGElasticPullToRefresh
Elastic pull to refresh for iOS developed in Swift -
PKHUD
A Swift based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8. -
Persei
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift -
KMNavigationBarTransition
A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically. -
StarWars.iOS
This component implements transition animation to crumble view-controller into tiny pieces. -
Whisper
:mega: Whisper is a component that will make the task of display messages and in-app notifications simple. It has three different views inside -
CircleMenu
:octocat: ⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations. Swift UI library made by @Ramotion -
RazzleDazzle
A simple keyframe-based animation framework for iOS, written in Swift. Perfect for scrolling app intros. -
Parchment
A paging view controller with a highly customizable menu ✨ -
XLActionController
Fully customizable and extensible action sheet controller written in Swift -
PaperOnboarding
:octocat: PaperOnboarding is a material design UI slider. Swift UI library by @Ramotion
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of CalendarView or a related project?
README
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 native calendar events.
Requirements
- iOS 8.0+
- XCode 9.0+
- Swift 4.2
Installation
CocoaPods
pod 'KDCalendar', '~> 1.8.9'
Carthage
Add this to your Cartfile, and then run carthage update
:
github "mmick66/CalendarView" "master"
Swift Package Manager
Go to Project -> Swift Packages and add the repository:
https://github.com/mmick66/CalendarView.git
Add this to your Package.swift:
dependencies: [
.Package(url: "https://github.com/mmick66/CalendarView")
]
Manual
Just the files from the CalendarView/ subfolder to your project.
Setup
The calendar is a UIView
and can be added either programmatically or via a XIB/Storyboard. If doing the latter, make sure that the Module is selected to be 'KDCalendar'.
It needs a delegate and data source that comply with:
protocol CalendarViewDataSource {
func startDate() -> NSDate // UTC Date
func endDate() -> NSDate // UTC Date
}
protocol CalendarViewDelegate {
func calendar(_ calendar : CalendarView, canSelectDate date : Date) -> Bool /* optional */
func calendar(_ calendar : CalendarView, didScrollToMonth date : Date) -> Void
func calendar(_ calendar : CalendarView, didSelectDate date : Date, withEvents events: [CalendarEvent]) -> Void
func calendar(_ calendar : CalendarView, didDeselectDate date : Date) -> Void /* optional */
func calendar(_ calendar : CalendarView, didLongPressDate date : Date, withEvents events: [CalendarEvent]?) -> Void /* optional */
}
The data source will provide the start date and the end date of the calendar. The methods have a default implementation that will return Date()
resulting in a single-page calendar displaying the current month.
The delegate responds to events such as scrolling and the selection of specific dates.
Note: The dates should be in UTC (same as GMT)
How to Use
You would want to implement the delegate functions inside your view controller as they appear in the example project.
Say you want to be able to scroll 3 months into the past, then:
func startDate() -> Date {
var dateComponents = DateComponents()
dateComponents.month = -3
let today = Date()
let threeMonthsAgo = self.calendarView.calendar.date(byAdding: dateComponents, to: today)
return threeMonthsAgo
}
You probably still want the calendar to open in today's date, so in this case do:
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let today = Date()
self.calendarView.setDisplayDate(today, animated: false)
}
Say you want tomorrow to be selected for some reason:
// can be in the viewDidAppear
let today = Date()
if let tomorrow = self.calendarView.calendar.date(byAdding: tomorrowComponents, to: today) {
self.calendarView.selectDate(tomorrow)
}
Selecting and Deselecting Dates
The calendar supports the selection of multiple dates. You can select a date either by clicking on a cell or by selecting it programmatically as:
self.calendarView.selectDate(date)
Similarly you can deselect:
self.calendarView.deselectDate(date)
You can get all the dates that were selected, either manually or programatically using:
self.calendarView.selectedDates
Layout
The calendar supports two basic layouts. Set the direction
property to .horizontal
or .vertical
:
calendarView.direction = .horizontal
Styling
The look of this calendar can be set using the CalendarView.Style
structure. There is an "out of the box" style that can be accessed statically through CalendarView.Style.Default
. To change it, instantiatia a new Style object and set the variables in their desired value anywhere in your code.
override func viewDidLoad() {
super.viewDidLoad()
let myStyle = CalendarView.Style()
// set your values
calendarView.style = myStyle
}
For more information have a look at our wiki.
Marking Weekends
Some calendars will want to display weekends as special and mark them with a different text color. To do that, first set the marksWeekends variable on the calendarView itself and (optionally) define the color to use.
CalendarView.Style.cellTextColorWeekend = UIColor.red
calendarView.marksWeekends = true
The CellShape
will define whether the dates are displayed in a circle or square with bevel or not.
Graying out days
If you want the days that lie outside of the rage set by startDate
and endDate
, you can set the color in:
CalendarView.Style.cellColorOutOfRange = UIColor(white: 0.0, alpha: 0.5)
First Day of the Week
Depending on the culture weeks are considered to start either on a Monday or on a Sunday. To change the way the days are displayed use:
CalendarView.Style.firstWeekday = .sunday
The calendar defaults to Monday which is standard in Europe.
Set locale of calendar
Set the locale for header labels of Weekdays and Month. Use:
CalendarView.Style.locale = Locale(identifier: "en_US")
The locale default is Locale.current of your device.
Custom Headers
Depending on the language, you might experience problems displaying the month strings in the header. There is however a method you can implement that will return any string you wish according to the date passed.
public protocol CalendarViewDataSource {
/* other methods */
func headerString(_ date: Date) -> String?
}
Events
This component has the ability to sync events from the system's EKEventStore
, which is shared with the native calendar provided in iOS. This ability is optional and (in order to keep the calendar's footprint low) needs to be activated seperatly via a custom flag in the build settings as shown below:
In the "Build Settings," under the "Swift Compiler - Custom Flags" and "Active Compilation Conditions," simply add the KDCALENDAR_EVENT_MANAGER_ENABLED
flag for both debug and release. The events will be enabled.
Loading Events
To load events from the system's calendar call the followint method:
self.calendarView.loadEvents()
Optionally, a complete handler can be added in case an error is returned
self.calendarView.loadEvents() { error in
if error != nil {
// handle error
}
}
The code will pop up an alert view to ask the user if he will allow this app to access the calendar. If access is granted we can pass the events to the CalendarView
, otherwise we get a nil and notify the app about the denial.
Creating (Adding) New Events
There is a function that allows you to add a new event in the calendar. It is currently restrictred to a single day (like the rest of the calendar)
func addEvent(_ title: String, date: Date, duration hours: NSInteger = 1) -> Bool
To detect when the user wants to add a new date, the delegate can implement the didLongPressDate
method will notify the controller for a long press and the addEvent
function is usually used in conjuction with this delegate method.
Currently, the example implementation of this repo will open an alert view that will prompt the user for a title to the event and set it for the duration of an hour. Custom controls could be added to further refine the selection.
As with the loading of the events we need to give persmissions to the app.
About Dates
Calculating dates can be somewhat complicated because while time is an absolute value, dates are a construct of culture: timezones are geopolitical areas and daylight savings times change according to government decision. The best way out of this is to calculate everything in UTC (same as GTM for what we are concerned) and so the startDate
and endDate
returned from the delegate should all be in UTC (+0000) time.
Help Needed
If you want to contribute there are always some open issues marked as enhancements in the issues tab. Any help is welcome.
*Note that all licence references and agreements mentioned in the CalendarView README section above
are relevant to that project's source code only.