Comments (4)
I have edited the code and this is how it looks like `
func getEvents() {
self.db.collection(XX).document(XX).collection("Calendar").addSnapshotListener { [self] (querySnapshot, error) in
self.userEventBox = []
if let e = error {
print("There was an issue retrieving data from Firestore. \(e)")
} else {
if let snapshotDocuments = querySnapshot?.documents {
for doc in snapshotDocuments {
let data = doc.data()
if let title = data["title"] as? String ,
let startDate = data["startDate"] as? String ,
let endDate = data["endDate"] as? String ,
let isAllDay = data["isAllDay"] as? Bool
{
let newEventBox = EventBox(startDate: startDate, endDate: endDate, isAllDay: isAllDay, title: title)
self.userEventBox.append(newEventBox)
print(newEventBox)
self.generate()
}
}
}
}
}
}
func generate() {
for generation in userEventBox {
let isoStartDate = generation.startDate
let isoEndDate = generation.endDate
let dateFormatter = ISO8601DateFormatter()
let startDate = dateFormatter.date(from:isoStartDate)!
let endDate = dateFormatter.date(from:isoEndDate)!
if let event = EKEvent() as? EKEvent {
event.title = generation.title
event.isAllDay = generation.isAllDay
event.startDate = startDate
event.endDate = endDate
event.calendar.cgColor = CGColor(red: 1, green: 1, blue: 1, alpha: 1)
self.generated = [event]
}
}
}
var generated = [EKEvent()]
override func eventsForDate(_ date: Date) -> [EventDescriptor] {
self.getEvents()
let calenderKitEvents = generated.map(EKWrapper.init)
return calenderKitEvents
}
}
`
Now I have this error Thread 1: "You must use [EKEvent eventWithEventStore:] to create an event"
I will really lose my mind. Please help @richardtop
from calendarkit.
Please post on stackoverflow first.
from calendarkit.
https://stackoverflow.com/questions/73408161/you-must-use-ekevent-eventwitheventstore-to-create-an-event @richardtop
from calendarkit.
Let's continue there.
from calendarkit.
Related Issues (20)
- Is there any option to show a specific Holiday on the Calendar??
- A blank area pop up after clicking cancel bar button in EKEventViewController HOT 1
- "isHeaderViewVisible" only hide the subview without resizing the timelinePageViewer HOT 1
- How to get data asynchronously data for eventsForDate from server api? HOT 1
- Event has no starDate or endDate HOT 4
- Quick question about Nav Bar Please Check Attached ss HOT 4
- App Crashes HOT 4
- Event text cutoff in timeline view for short events HOT 2
- Padding and corner radius to event view? (ios 13+ style) HOT 1
- how to set default start time 8 AM for each day of calender HOT 17
- Delegate called twice: dayView(dayView: DayView, didUpdate event: EventDescriptor) HOT 5
- How to align "non-overlapped" events on 1 column? HOT 1
- Current time indicator for all dates. HOT 6
- Drag problem HOT 3
- Navigation bar turns black HOT 1
- Horizontal scrolling for the timeline HOT 1
- Visual shading representation of unavailable hours HOT 1
- When events are overlap , delegate method is called for least event HOT 1
- Use DateComponents instead of Date to coordinate between multiple modules
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calendarkit.