All Projects → richardtop → Calendarkit

richardtop / Calendarkit

Licence: mit
📅 Calendar for Apple platforms in Swift

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Calendarkit

Rhplaceholder
Show pleasant loading view for your users 😍
Stars: ✭ 238 (-88.38%)
Mutual labels:  ios-lib, cocoapods, ios-ui
Kvkcalendar
A most fully customization calendar and timeline library for iOS 📅
Stars: ✭ 160 (-92.19%)
Mutual labels:  cocoapods, swift-package-manager, calendar
Nvactivityindicatorview
A collection of awesome loading animations
Stars: ✭ 10,031 (+389.56%)
Mutual labels:  ios-lib, cocoapods, ios-ui
Taniwhatextfield
My first cocoapod framework
Stars: ✭ 26 (-98.73%)
Mutual labels:  cocoapods, swift-package-manager, ios-ui
Fscalendar
A fully customizable iOS calendar library, compatible with Objective-C and Swift
Stars: ✭ 9,829 (+379.7%)
Mutual labels:  cocoapods, calendar
Buckets Swift
Swift Collection Data Structures Library
Stars: ✭ 106 (-94.83%)
Mutual labels:  cocoapods, swift-package-manager
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+422.5%)
Mutual labels:  cocoapods, swift-package-manager
Skeletonview
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
Stars: ✭ 10,804 (+427.28%)
Mutual labels:  swift-package-manager, ios-ui
Freedom
The Freedom to Open URLs in Third-Party Browsers on iOS with Custom UIActivity Subclasses.
Stars: ✭ 85 (-95.85%)
Mutual labels:  cocoapods, swift-package-manager
Alamofire
Elegant HTTP Networking in Swift
Stars: ✭ 36,896 (+1700.68%)
Mutual labels:  cocoapods, swift-package-manager
Bettersegmentedcontrol
An easy to use, customizable replacement for UISegmentedControl & UISwitch.
Stars: ✭ 1,782 (-13.03%)
Mutual labels:  cocoapods, swift-package-manager
Swiftcocoadsl
An easy way to write iOS UI
Stars: ✭ 103 (-94.97%)
Mutual labels:  ios-lib, ios-ui
Flexlayout
FlexLayout adds a nice Swift interface to the highly optimized facebook/yoga flexbox implementation. Concise, intuitive & chainable syntax.
Stars: ✭ 1,342 (-34.5%)
Mutual labels:  ios-lib, ios-ui
Xmlmapper
A simple way to map XML to Objects written in Swift
Stars: ✭ 90 (-95.61%)
Mutual labels:  cocoapods, swift-package-manager
Natrium
A pre-build (Swift) script to alter your Xcode project at pre-build-time per environment, build configuration and target.
Stars: ✭ 131 (-93.61%)
Mutual labels:  cocoapods, swift-package-manager
Randomkit
Random data generation in Swift
Stars: ✭ 1,458 (-28.84%)
Mutual labels:  cocoapods, swift-package-manager
Skcalendarview
SKCalendarView是一个高可控性的日历基础组件,为了提高应用的自由度,默认只提供了日历部分的视图封装,但不涵盖切换月份按钮、年月分显示等非关键性控件,但请不要担心,SKCalendarView为你提供了多样性的API,你可以很轻松的拿到这些信息去展示在你自己的自定义控件中。不仅如此,SKCalendarView还为你封装了公历、农历、节假日以及中国24节气的核心算法,即使你觉得默认的视图并不合胃口,也可以直接快速的利用这套算法创造出一个全新的日历控件。最后,SKCalendarView还提供了一些简单的切换动画,如果你不喜欢它,可以忽略掉,用自己的,这里完全不会受到任何限制。
Stars: ✭ 121 (-94.09%)
Mutual labels:  ios-ui, calendar
Coregpx
A library for parsing and creation of GPX location files. Purely Swift.
Stars: ✭ 132 (-93.56%)
Mutual labels:  cocoapods, swift-package-manager
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (-93.27%)
Mutual labels:  cocoapods, swift-package-manager
Swiftlinkpreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
Stars: ✭ 1,216 (-40.65%)
Mutual labels:  cocoapods, swift-package-manager

CalendarKit CalendarKit License SwiftPM compatible Swift Compatibility Platform Compatibility Tag Version

CalendarKit

CalendarKit is a Swift calendar UI library for iOS and Mac Catalyst. It looks similar to the Apple Calendar app out-of-the-box, while allowing customization when needed. CalendarKit is composed of multiple modules which can be used together or independently.

Tutorials

Need Help?

If you have a programming question about how to use CalendarKit in your application, ask it on StackOverflow with the CalendarKit tag. Check out the Sample App for reference.

Please, use GitHub Issues only for reporting a bug or requesting a new feature.

Examples

Video

Sample App

Try live in a browser

To try CalendarKit with CocoaPods issue the following command in the Terminal:

pod try CalendarKit

Installation

CalendarKit can be installed with Swift Package Manager or with CocoaPods.

Swift Package Manager (Xcode 12 or higher)

The preferred way of installing CalendarKit is via the Swift Package Manager.

  1. In Xcode, open your project and navigate to FileSwift PackagesAdd Package Dependency...
  2. Paste the repository URL (https://github.com/richardtop/CalendarKit.git) and click Next.
  3. For Rules, select Version (Up to Next Major) and click Next.
  4. Click Finish.

Adding Package Dependencies to Your App

CocoaPods

To install it, add the following line to your Podfile:

pod 'CalendarKit'

Adding Pods to an Xcode project

Usage

  1. Subclass DayViewController
  2. Implement EventDataSource protocol to show events.

CalendarKit requires EventDataSource to return an array of objects conforming to EventDescriptor protocol, specifying all the information needed to display a particular event. You're free to use a default Event class as a model or create your own class conforming to the EventDescriptor protocol.

// Return an array of EventDescriptors for particular date
override func eventsForDate(_ date: Date) -> [EventDescriptor] {
  var models = myAppEventStore.getEventsForDate(date) // Get events (models) from the storage / API

  var events = [Event]()

  for model in models {
      // Create new EventView
      let event = Event()
      // Specify DateInterval
      event.dateInterval = DateInterval(start: model.startDate, end: model.endDate)
      // Add info: event title, subtitle, location to the array of Strings
      var info = [model.title, model.location]
      info.append("\(datePeriod.beginning!.format(with: "HH:mm")) - \(datePeriod.end!.format(with: "HH:mm"))")
      // Set "text" value of event by formatting all the information needed for display
      event.text = info.reduce("", {$0 + $1 + "\n"})
      events.append(event)
  }
  return events
}

After receiving an array of events for a particular day, CalendarKit will handle view layout and display.

Usage

To respond to the user input, override mehtods of DayViewDelegate, for example:

override func dayViewDidSelectEventView(_ eventView: EventView) {
  print("Event has been selected: \(eventview.data)")
}

override func dayViewDidLongPressEventView(_ eventView: EventView) {
  print("Event has been longPressed: \(eventView.data)")
}

Localization

CalendarKit supports localization and uses iOS default locale to display month and day names. First day of the week is also selected according to the iOS locale.

GermanNorwegian

Styles

By default, CalendarKit looks similar to the Apple Calendar app and fully supports Dark Mode. If needed, CalendarKit's look can be easily customized. Steps to apply a custom style are as follows:

  1. Create a new CalendarStyle object (or copy existing one)
  2. Change style by updating the properties.
  3. Invoke updateStyle method with the new CalendarStyle.
let style = CalendarStyle()
style.backgroundColor = UIColor.black
dayView.updateStyle(style)

Light theme Dark theme

Requirements

  • iOS 10.0+, macOS (Catalyst) 10.15+
  • Swift 4+ (Library is written in Swift 5)

Contributing

The list of features currently in development can be viewed on the issues page.

Before contributing, please review guidelines and code style.

Author

Richard Topchii

License

CalendarKit is available under the MIT license. See the LICENSE file for more info.

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].