iOS Question Read/Write Notes in CalendarEvent

mtechteam

Member
Licensed User
Longtime User
How does one read or write to the notes field in the Calendar on B4i? I don't see a property/method to do that in iEventKit
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Reading notes (based on the example):
B4X:
Sub store_EventsReady (Success As Boolean, Events As List)
   If Success Then
       For Each e As CalendarEvent In Events
           TableView1.AddTwoLines(e.Title, $"$DateTime{e.StartDate} - $DateTime{e.EndDate}"$)
           Dim no As NativeObject = e
           If no.GetField("hasNotes").AsBoolean = True Then
               Log("Notes: " & no.GetField("notes").AsString)
           End If
       Next
       TableView1.ReloadAll
   End If
End Sub

Writing notes:
B4X:
Dim ev As CalendarEvent = store.CreateEvent

   ev.Title = "New Event"
   Dim no As NativeObject = ev
   no.SetField("notes", "this is a test")
 
Upvote 0
Top