Latest 0.3
Homepage https://github.com/dylangyesbreghs/DGCalendar
License MIT
Platforms ios 8.0, requires ARC
Authors

iOS Calendar component written in Swift (Under Development)
Alt text

Usage

Basic usage

You have to create two views in your UIViewController:

  • The first view is DGCalendarMenuView and it represents the month names.
  • The second view is DGCalendarContentView and it represents the calendar itself.

Your UIViewController must implement DGCalendarViewDataSource

import UIKit

class ViewController: UIViewController, DGCalendarViewDataSource {

    @IBOutlet weak var menuMonthView: DGCalendarMenuView!
    @IBOutlet weak var contentView: DGCalendarContentView!
    var calendarManager : DGCalendar?

    override func viewDidLoad() {
        super.viewDidLoad()
        calendarManager = DGCalendar()
        calendarManager?.delegate = self
        calendarManager?.setContentView = contentView
        calendarManager?.setMenuMonthsView = menuMonthView
        calendarManager?.reloadData()
    }

    override func viewDidLayoutSubviews() {
        calendarManager?.repositionViews()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    // MARK: Calendar Delegate
    func calendarHaveMultipleDatesSelected(calendar: DGCalendar, dates: [NSDate]) {
        print(dates)
    }
    func calendarDidLoadPreviouPage() {}
    func calendarDidLoadNextPage() {}

}

For more info checkout the Example Project

Requirements

  • iOS 8 or higher
  • Xcode 7
  • Automatic Reference Counting (ARC)

Author

License

DGCalendar is released under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "DGCalendar",
    "version": "0.3",
    "summary": "iOS Calendar component. Written in Swift",
    "homepage": "https://github.com/dylangyesbreghs/DGCalendar",
    "license": {
        "type": "MIT",
        "file": "LICENCE"
    },
    "authors": {
        "Dylan Gyesbreghs": "[email protected]"
    },
    "social_media_url": "http://twitter.com/dylangyesbreghs",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/dylangyesbreghs/DGCalendar.git",
        "tag": "0.3"
    },
    "source_files": "DGCalendar/*",
    "requires_arc": true
}

Pin It on Pinterest

Share This