Latest 0.0.3
Homepage https://github.com/StevenPreston/SSCalendar
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

Introduction

SSCalendar is a UI library that can be used to display a calendar of events within your app. This calendar library was originally built in 2013 for a project that required a calendar experience similar to the revamped Apple calendar app in iOS 7. At the time, I found very few calendar libraries and decided to build one. Note that this calendar is not designed as a picker but rather to display an existing set of events.

SSCalendar provides 3 different calendar views:

Annual view

Annual

Monthly view

Monthly

Weekly and daily view

Daily/Weekly

Shortfalls

If any interest is shown in the library then I’ll work on improving it. In its current state its limited and poorly constructed. Some areas that need work:

  • No tests
  • Inelegent and poorly constructed
  • Difficult to customize
  • Limited features

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 8 and up.

Installation

SSCalendar is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SSCalendar"

Usage

First, import the module:

import SSCalendar

Then, generate data to populate the calendar. Data should be in the form of an array of SSEvent objects:

private func generateEvents() -> [SSEvent] {
  var events: [SSEvent] = []
  for year in 2016...2021 {
    for _ in 1...200 {
      events.append(generateEvent(year));
    }
  }
  return events
}

private func generateEvent(year: Int) -> SSEvent {
  let month = Int(arc4random_uniform(12)) + 1
  let day = Int(arc4random_uniform(28)) + 1

  let event = SSEvent()
  event.startDate = SSCalendarUtils.dateWithYear(year, month: month, day: day)
  event.startTime = "09:00"
  event.name = "Example Event"
  event.desc = "Details of the event"

  return event
}

Next, instantiate the type of calendar view controller (SSCalendarAnnualViewController or SSCalendarMonthlyViewController) that you want to display; along with the array of events:

let annualViewController = SSCalendarAnnualViewController(events: generateEvents())
let navigationController = UINavigationController(rootViewController: annualViewController)
navigationController.navigationBar.translucent = false
self.presentViewController(navigationController, animated: true, completion: nil)

Author

Steven Preston, [email protected]

License

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

Latest podspec

{
    "name": "SSCalendar",
    "version": "0.0.3",
    "summary": "A calendar UI library that somewhat mimics a stripped down version of the default calendar app experience.",
    "description": "SSCalendar is a UI library that can be used to display a calendar of events within your app. This calendar library was originally built in 2013 for a project that required a calendar experience similar to the revamped Apple calendar app introduced in iOS 7. At the time, I found very few comprehensive calendar libraries and as a result decided to build one. SSCalendar provides 3 different calendar views - an annual view, monthly view and weekly/daily view. Note that this calendar is not designed as a picker but rather to display an existing set of events.",
    "homepage": "https://github.com/StevenPreston/SSCalendar",
    "screenshots": [
        "https://github.com/StevenPreston/SSCalendar/raw/master/Screenshots/1.gif",
        "https://github.com/StevenPreston/SSCalendar/raw/master/Screenshots/2.gif",
        "https://github.com/StevenPreston/SSCalendar/raw/master/Screenshots/3.gif"
    ],
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Steven Preston": "[email protected]"
    },
    "source": {
        "git": "https://github.com/StevenPreston/SSCalendar.git",
        "tag": "0.0.3"
    },
    "social_media_url": "https://www.linkedin.com/in/stevenpreston1",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SSCalendar/Classes/**/*",
    "resource_bundles": {
        "SSCalendar": [
            "SSCalendar/Classes/**/*.xib"
        ]
    }
}

Pin It on Pinterest

Share This