A RFC 5545 compatible parser for iCalendar files in Swift.
To use iCalendarParser just add it as Swift Package Manager dependency:
Open your project, click on File → Add Packages, enter the repository URL (https://github.com/redryerye/iCalendarParser.git), and add the package product to your app target.
dependencies: [
.package(
name: "iCalendarParser",
url: "https://github.com/redryerye/iCalendarParser",
from: "0.4.0"
)
]To get started with iCalendarParser, all you have to do is to import it and use its ICParser type to convert any ICS file into iCalendar object:
import iCalendarParser
let rawICS: String = ...
let parser = ICParser()
let calendar: ICalendar? = parser.calendar(from: rawICS)iCalendarParser is currently not feature complete yet. While it requires an additional implementation to be fully compatible with RFC5545, we appreciate contributions from the community to help us improve the library.
- Components
- Parse
VEVENT - Parse
VTIMEZONE - Parse
VTODO - Parse
VJOURNAL - Parse
VFREEBUSY - Parse
VALARM
- Parse
-
VEVENTproperties- Add
COMMENT,CONTACT, andRESOURCES - Add
EXDATEandRDATE - Add
DURATION - Add
ATTACH - Add
GEO - Add
RELATED-TO - Add
REQUEST-STATUS
- Add
- Recurrence
- Parse basic
RRULE - Expand recurring events into instances
- Apply
EXDATE - Apply
RDATE - Handle
RECURRENCE-IDoverrides
- Parse basic
- Property parameters
- Preserve common parameters on parsed properties
- Support quoted parameter values
- Support multi-value parameters
- Support
ALTREP,LANGUAGE,CN,ROLE,PARTSTAT,RSVP,TZID, andVALUE
- Value types
- Parse
DATE - Parse
DATE-TIME - Parse
DURATION - Parse
PERIOD - Parse
URI - Parse
UTC-OFFSET
- Parse
- Serialization
- Format calendars back to valid
.ics - Fold long lines correctly
- Escape text values correctly
- Format calendars back to valid
- Validation
- Validate required properties per component
- Validate mutually exclusive properties, such as
DTENDandDURATION - Validate property cardinality rules
- Compatibility
- Preserve unknown standard properties
- Preserve
X-properties and parameters - Add fixture coverage from real-world calendars
Contributions to iCalendarParser are welcomed and encouraged!
iCalendarParser is available under the MIT license. See LICENSE for more information.
- chan614/iCalSwift (Inspired to create an initial implementation)
- jswallez (Special thanks 💛)