Parsers
-
Default implementation of the
ContactParserprotocol.Parse contact data from json. Each key from JSON represents property name from
CNMutableContacttype.Example:
{ "contactType": "person", "givenName": "Michael" }DateComponentsis represented as a JSON dictionary:Example:
{ "birthday": { "year": 2016, "month": 5, "day": 19 } }CNLabeledValueis represented as a JSON dictionary. The dictionary key is used aslabel. The value from the dictionary for the key is used asvalue.Example:
{ "date1": { "year": 2017, "month": 2, "day": 17 } }Dates, social profiles, phone numbers, email addresses, url addresses, postal addresses, contact relationships and instant message addresses are constructed as a list of dictionaries.
Example:
{ "phoneNumbers": [ { "work": { "stringValue": "0 1234567890" } }, { "mobile": { "stringValue": "0 1234567890" } }, { "nil": { "stringValue": "0 1234567890" } } ] }Note
"nil"in the dictionary keys are converted tonilvalue.Seealso
See moreSeealso
For full example check
contacts.jsonfile in the test project.Declaration
Swift
public struct ContactDictionaryParser : ContactParser
-
Default implementation of the
EventParserprotocol.Parse event data from json. Each key from JSON represents property name from the the
EKEventtype.Example:
{ "title": "Minimal Event Title", "startDate": "2017-01-22 13:45:00", "endDate": "2017-01-22 14:30:00" }Seealso
EventKitHandlerSee moreSeealso
For full example checkevents.jsonfile in the test project.Declaration
Swift
public struct EventDictionaryParser : EventParser
-
Default implementation of the
ReminderParserprotocol.Parse reminder data from json. Each key from JSON represents property name from the
EKRemindertype.Example:
{ "title": "Minimal Reminder Title", "priority": 3 }DateComponentsis represented as a JSON dictionary:Example:
{ "startDateComponents": { "timeZone": { "identifier": "America/Los_Angeles", }, "year": 2017, "month": 10, "day": 24, "hour": 12, "minute": 25, "second": 0 } }Seealso
EventKitHandlerSee moreSeealso
For full example checkreminders.jsonfile in the test project.Declaration
Swift
public struct ReminderDictionaryParser : ReminderParser
-
Defines types and method required to parse and convert any type
See moreTto a typeU.Declaration
Swift
public protocol Parser
-
Extension to the
Parserprotocol. Requires the converted object to be an instance of theCNMutableContacttype.Seealso
ContactDictionaryParserSee moreSeealso
ContactsHandlerDeclaration
Swift
public protocol ContactParser : Parser where Self.T == Any, Self.U == CNMutableContact
-
Extension to the
Parserprotocol. Requires the converted object to be an instance of theEKEventtype.Seealso
EventDictionaryParserSee moreSeealso
EventKitHandlerDeclaration
Swift
public protocol EventParser : Parser where Self.U == EKEvent
-
Extension to the
Parserprotocol. Requires the converted object to be an instance of theEKRemindertype.Seealso
ReminderDictionaryParserSee moreSeealso
EventKitHandlerDeclaration
Swift
public protocol ReminderParser : Parser where Self.U == EKReminder
Parsers Reference