100% Swift 4.0 !
Simple, customizable calendar for your app!
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'ALCalendar'
end
After that simply go with:
pod install
Demo app shows you most of functionality
Simply add UIView
on the ViewController
and subclass it as CalendarView
In the ViewController connect view using IBOutlet
@IBOutlet weak var calendarView: CalendarView!
or simply add CalendarView
and set frame or constraints
var calendarView = CalendarView()
After that in viewDidLoad() simply set delegate, current date and ... that's all! You have fully working calendar 😎
override func viewDidLoad() {
super.viewDidLoad()
calendarView.delegate = self
let today = Date()
calendarView.setDisplayDate(date: today, animated: false)
}
We have dedicated enum CalendarStyle
for styling of our calendar.
Properties that you can modify:
cellEventColor
cellSelectionType
cellShape
cellBackgroundColor
cellTodayBackgroundColor
cellBorderColor
headerTextColor
cellTextColor
cellTodayTextColor
You can change scroll direction
calendarView.scrollDirection = .horizontal
or calendarView.scrollDirection.vertical
Simply set calendarView.loadEkEvents = true
to load EKEvents
Simply set
CalendarStyle.cellSelectionType = .multiple
For multiple cell selection
If you want to choose just one cell set
CalendarStyle.cellSelectionType = .single
For range picking set
CalendarStyle.cellSelectionType = .range
You can choose cell shape
CalendarStyle.cellShape = .round
CalendarStyle.cellShape = .square
Copyright 2017, Applandeo sp. z o.o.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.