1

I want to add some attendees to an EKEvent object.

I'm using this solution written in objective c as a guide

So far I've got this from a related question

var anyObjectType : AnyObject.Type = NSClassFromString("EKAttendee")!
var nsObjectType : NSObject.Type = anyObjectType as! NSObject.Type
var attendee: EKParticipant = nsObjectType.init() as! EKParticipant ;

print("\(attendee)") ;

which results in

EKAttendee <0x4a948450>
email               : (null)
isCurrentUser       : 0
replyRequested      : 0
role                : (null)
status              : (null)
type                : 0
scheduleForceSend   : 0

which seems to indicate there is an email member.

If I try to change the email via subscript I get the following error.

./create-event-in-calendar.swift:83:10: error: type 'EKParticipant' has no subscript members
attendee["email"] = "test@email.com"

If I try to change the email via a member I get the following error.

./create-event-in-calendar.swift:83:2: error: value of type 'EKParticipant' has no member 'email'
attendee.email = "test@email.com"

Any ideas on how to change email within the attendee object?

Community
  • 1
  • 1
Keith John Hutchison
  • 4,955
  • 11
  • 46
  • 64

0 Answers0