All Projects → EvanCooper9 → Swift Week View

EvanCooper9 / Swift Week View

Licence: mit
An iOS calendar library for displaying calendar events in a week view.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swift Week View

Cadar
Android solution which represents month and list calendar views.
Stars: ✭ 360 (+309.09%)
Mutual labels:  calendar, calendar-view
Mbcalendarkit
An open source calendar framework for iOS, with support for customization, IBDesignable, Autolayout, and more.
Stars: ✭ 561 (+537.5%)
Mutual labels:  calendar, calendar-view
Material Calendar View
📅 Material Design Calendar compatible with API 11+
Stars: ✭ 360 (+309.09%)
Mutual labels:  calendar, calendar-view
Primedatepicker
PrimeDatePicker is a tool that provides picking a single day, multiple days, and a range of days.
Stars: ✭ 292 (+231.82%)
Mutual labels:  calendar, calendar-view
Kotlin Agendacalendarview
Android calendar library provides easy to use widget with events
Stars: ✭ 81 (-7.95%)
Mutual labels:  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 (+3703.41%)
Mutual labels:  calendar, calendar-view
Crunchycalendar
A beautiful material calendar with endless scroll, range selection and a lot more!
Stars: ✭ 465 (+428.41%)
Mutual labels:  calendar, calendar-view
GCCalendar
A customizable calendar view for iOS 9+ written in Swift.
Stars: ✭ 53 (-39.77%)
Mutual labels:  calendar, calendar-view
Calendarview
Android上一个优雅、万能自定义UI、仿iOS、支持垂直、水平方向切换、支持周视图、自定义周起始、性能高效的日历控件,支持热插拔实现的UI定制!支持标记、自定义颜色、农历、自定义月视图各种显示模式等。Canvas绘制,速度快、占用内存低,你真的想不到日历居然还可以如此优雅!An elegant, highly customized and high-performance Calendar Widget on Android.
Stars: ✭ 7,998 (+8988.64%)
Mutual labels:  calendar, calendar-view
Peppy Calendarview
Simple and fast Material Design calendar view for Android.
Stars: ✭ 30 (-65.91%)
Mutual labels:  calendar, calendar-view
Jzcalendarweekview
Calendar Week & Day View in iOS Swift
Stars: ✭ 272 (+209.09%)
Mutual labels:  calendar, calendar-view
Calendarview2
Calendar view for Android. Pretty.
Stars: ✭ 72 (-18.18%)
Mutual labels:  calendar, calendar-view
CalendarView
日历控件
Stars: ✭ 14 (-84.09%)
Mutual labels:  calendar, calendar-view
Cvcalendar
A custom visual calendar for iOS 8+ written in Swift (>= 4.0).
Stars: ✭ 3,435 (+3803.41%)
Mutual labels:  calendar, calendar-view
Shift
Light-weight EventKit wrapper.
Stars: ✭ 31 (-64.77%)
Mutual labels:  calendar, asynchronous
Calendarview
An Easy to Use Calendar for iOS (Swift 5.0)
Stars: ✭ 429 (+387.5%)
Mutual labels:  calendar, calendar-view
Customizablecalendar
CustomizableCalendar is a library that allows you to create your calendar, customizing UI and behaviour
Stars: ✭ 214 (+143.18%)
Mutual labels:  calendar, calendar-view
Supercalendar
@deprecated android 自定义日历控件 支持左右无限滑动 周月切换 标记日期显示 自定义显示效果跳转到指定日期
Stars: ✭ 2,732 (+3004.55%)
Mutual labels:  calendar, calendar-view
Table calendar
Highly customizable, feature-packed Flutter Calendar with gestures, animations and multiple formats
Stars: ✭ 897 (+919.32%)
Mutual labels:  calendar, calendar-view
Yycalendar
Simple and Clear Calendar
Stars: ✭ 46 (-47.73%)
Mutual labels:  calendar, calendar-view

ECWeekView

An iOS calendar library for displaying calendar events in a week view.

Features

  • See calendar events in a week view
  • Asynchronously load calendar events
  • Interaction with specific events by clicking
  • Interaction with free time spaces by clicking
  • Custom styling
  • Infinite horizontal scrolling

Installation

Swift Package Manager

.package(url: "https://github.com/EvanCooper9/swift-week-view")

Usage

1. Implement the ECWeekViewDataSource

Implement the weekViewGenerateEvents protocol function. This function should return a list of ECWeekViewEvents specific to the day of date. Events that can be created immediately should be returned to this function. Events that require time to create should be passed to eventCompletion, which will overwrite previously returned events. See here for SwiftDate documentation on creating date objects at specific times. Currently, events rely on a 24-hour clock.

func weekViewGenerateEvents(_ weekView: ECWeekView, date: DateInRegion, eventCompletion: @escaping ([ECWeekViewEvent]?) -> Void) -> [ECWeekViewEvent]? {
  let start: DateInRegion = date.dateBySet(hour: 12, min: 0, secs: 0)!
  let end: DateInRegion = date.dateBySet(hour: 13, min: 0, secs: 0)!
  let event: ECWeekViewEvent = ECWeekViewEvent(title: "Lunch", start: start, end: end)

  DispatchQueue.global(.background).async {
    // do some async work & create events...
    eventCompletion([event, ...])
  }

  return [event]
}

Available arguments for ECWeekViewEvent

  • title: the title of the event
  • subtitle: a subtitle or description of the event
  • start: the start time of the event
  • end: the end time of the event

2. Initialize the instance

2A. Programmatically

Create an instance of ECWeekView, specify it's data source, and add it as a subview.

let weekView = ECWeekView(frame: frame, visibleDays: 5)
weekView.dataSource = self
addSubview(weekView)
Available arguments for ECWeekView
  • frame: the frame of the calendar view
  • visibleDays: amount of days that are visible on one page. Default = 5
  • date: (Optional) the day ECWeekView will initially load. Default = today

2B. Storyboard

Add a view to the storyboard and set it's class ECWeekView. Assign the view's data source programmatically.

@IBOutlet weak var weekView: ECWeekView!
weekView.dataSource = self

User Interaction

To handle interaction with ECWeekView, implement the ECWeekViewDelegate protocol and set the delegate property to the implementing class.

// Fires when a calendar event is touched on
func weekViewDidClickOnEvent(_ weekView: ECWeekView, event: ECWeekViewEvent, view: UIView)

// Fires when a space without an event is tapped
func weekViewDidClickOnFreeTime(_ weekView: ECWeekView, date: DateInRegion)

Custom Styling

To use custom styling, implement the ECWeekViewStyler protocol and assign the styler property to the implementing class. ECWeekView by default is its own styler.

// Creates the view for an event
func weekViewStylerECEventView(_ weekView: ECWeekView, eventContainer: CGRect, event: ECWeekViewEvent) -> UIView

// Create the header view for the day in the calendar. This would normally contain information about the date
func weekViewStylerHeaderView(_ weekView: ECWeekView, with date: DateInRegion, in cell: UICollectionViewCell) -> UIView
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].