Latest 0.0.3
Homepage https://github.com/raphaelseher/HorizontalCalendarView
License MIT
Platforms ios 8.0, requires ARC
Authors

Small horizontal calendar written in Swift.

HorizontalCalendarView

Install via cocoapods

pod 'HorizontalCalendarView'

Usage

1.) Import module

import HorizontalCalendarView

2.) Insert view via code or InterfaceDesigner

3.) Adopt delegate

class ViewController: UIViewController, HorizontalCalendarDelegate

4.) Implement delegate method

func horizontalCalendarViewDidUpdate(calendar: HorizontalCalendarView, date: NSDate) {
    let formatter: NSDateFormatter = NSDateFormatter()
    formatter.dateFormat = "dd.MM.YYYY"
    print("Updated calendarView (formatter.stringFromDate(date))")
  }

Use your own cell

Init HorizontalCalendarView with your class or nib.

let customCalendarView = HorizontalCalendarView(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: 100.0),
cellWidth: 80, cellClass: MyCustomCalendarCell.self)

And override configureCalendarCell

override func configureCalendarCell(cell: UICollectionViewCell, date: NSDate, active: Bool) -> UICollectionViewCell {
    //update your cell
    return cell;
  }

Feedback & Issues

Give me feedback if you like too!
If you have problems, write an issue.

Latest podspec

{
    "name": "HorizontalCalendarView",
    "version": "0.0.3",
    "summary": "A horizontal scrolling calendar.",
    "description": "Custom UIView with an UICollectionView as calendar.nnUse your custom UICollectionView cell if you like.nTo do that call the right initializer and override configureCalendarCell()nmethod.",
    "homepage": "https://github.com/raphaelseher/HorizontalCalendarView",
    "screenshots": "https://raw.githubusercontent.com/raphaelseher/HorizontalCalendarView/master/calendar.gif",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Raphael Seher": "[email protected]"
    },
    "social_media_url": "http://twitter.com/raphaelseher",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/raphaelseher/HorizontalCalendarView.git",
        "tag": "v0.0.3"
    },
    "source_files": [
        "HorizontalCalendar",
        "HorizontalCalendar/**/*.{h,m,swift}"
    ],
    "resources": [
        "HorizontalCalendar/*.xib",
        "HorizontalCalendar/*.xcassets"
    ],
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This