Latest 1.7
Homepage https://github.com/AlbertMontserrat/AMGCalendarManager
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Example

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

Requirements

Installation

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

pod "AMGCalendarManager"

How it works

AMGCalendarManager works as a singleton and generates a new Calendar with the Bundle Name.

Basic example:

AMGCalendarManager.shared.createEvent(completion: { (event) in
    guard let event = event else { return }

    event.startDate = date
    event.endDate = event.startDate.addingTimeInterval(60 * 60 * 1) // 1 hour

    event.title = name
    event.notes = notes

    AMGCalendarManager.shared.saveEvent(event: event)

})

To get all events saved in this calendar:

AMGCalendarManager.shared.getAllEvents(completion: { (error, events) in

})

You can also get on event by id, delete one or all events, etc.

public var eventStore: EKEventStore

public let calendarName: String

public var calendar: EKCalendar? { get }

static internal let shared: AMGCalendarManager.AMGCalendarManager

public func createEvent(completion: ((_ event: EKEvent?) -> Void)?)

public func saveEvent(event: EKEvent, completion: ((_ error: NSError?) -> Void)? = default)

public func removeEvent(eventId: String, completion: ((_ error: NSError?) -> ())? = default)

public func removeAllEvents(completion: ((_ error: NSError?) -> ())? = default)

public func getAllEvents(completion: ((_ error: NSError?, _ events: [EKEvent]?) -> ())?)

public func getEvents(startDate: Date, endDate: Date, completion: ((_ error: NSError?, _ events: [EKEvent]?) -> ())?)

public func getEvent(eventId: String, completion: ((_ error: NSError?, _ event: EKEvent?) -> ())?)

public func commit() -> Bool

public func reset()

Author

Albert, [email protected]

License

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

Latest podspec

{
    "name": "AMGCalendarManager",
    "version": "1.7",
    "summary": "EventKit helper for Swift 3",
    "description": "EventKit helper for Swift 3 to create, delete and update events in the easiest way!",
    "homepage": "https://github.com/AlbertMontserrat/AMGCalendarManager",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Albert": "[email protected]"
    },
    "source": {
        "git": "https://github.com/AlbertMontserrat/AMGCalendarManager.git",
        "tag": "1.7"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "AMGCalendarManager/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This