richardtop / calendarkit Goto Github PK
View Code? Open in Web Editor NEW๐ Calendar for Apple platforms in Swift
Home Page: https://www.youtube.com/watch?v=cJ63-_z1qg8
License: MIT License
๐ Calendar for Apple platforms in Swift
Home Page: https://www.youtube.com/watch?v=cJ63-_z1qg8
License: MIT License
The font sizes and label sizes assume a large enough width for DayView. With a smaller view, labels start to overlap. Should additional params like DaySelectorStyle.dateLabelWidth and SwipeLabelStyle.labelFont be added to styles. The alternative would be to automatically size the element proportionally.
Is there any video about how to usage and how to setup this?
I was setting local notification, and later I tried to set those pendingNotificationArray as dayModel DataSource, but its crashing in library. Any clue?
To reproduce edit the example projects ExampleController line 59 with
for _ in 0...1 {
and scroll around for a bit.
Your git comment suggested that there is a way to scroll to the first event on a day. The function scrollToFirstEvent is present but it is not clear how I can access it. Please suggest how I can handle this. Or even scroll to a specific time such as 8:00 am when I display a day view.
Are there any other examples on how to use this very useful library to implement other functions such as displaying by week or month or making an entry in a time slot.
It's 13 May but I want to show the dayView for 23 September.
I've tried calling changeCurrentDate(to newDate: Date). My chosen date is displayed briefly and then display switches to 20 May.
Is there a way to start at a date other than today?
I'd like to be able to insert images, bold fonts, colors, etc.
Perhaps just using attributedText instead of plain text would be nice?
I want to change the current date ,
and date change issue is resolved in your latest library .
But unable to install pod with current branch , or by putting the version 0.1.21
please reply
Realized that whenever a user clicks on an EventView I get the actual EventView back in the delegate method, BUT I have no way of knowing which actual Event (my own custom Model) they clicked.
I realize I could do some complicated logic by checking the Dates and trying to figure out which Event they actually clicked.
I "fixed" it locally by adding a var extraData: Any? property to EventView, then casting it back to my own model in the delegate.
Was thinking of a more elegant way to fix this since I think this could be a common issue.
The other way could be subclassing EventView, adding extra properties & logic, then casting the EventView back to my own subclass afterwards in the delegate method.
But for some reason I could not accomplish that. Something to do with the required initializer to be able to subclass EventView.
Would love to discuss an elegant approach to this.
Thanks for the great framework!
"Another thing that I believe it's missing or would be nice to have: when we have appointments of 10-15 minutes the height is too small and you can't see the content. It would be nice to be able to zoom-in our and adjust the timeline view height."
Event text not fit properly, not properly visible to read ,
waiting for reply
Cant find CalendarKit in CocoaPods, and download the Zip can
t opened.
I have implemented a feature to delete a event by long pressing a event view.
Basically, the deletion works perfectly when there are more than 1 event in the data array.
However, when I delete the last event, the calendar view does not update immediately and the deleted view just stay there. I need to swipe to next week and come back to that day. Then, deleted event will then be disappeared.
I tried to reload the view after the deletion using the following functions, but none of it works.
self.reloadInputViews()
self.reloadData()
self.dayView.reloadData()
self.dayView.reloadInputViews()
I am not sure if it is a bug. Do you have a example code on how to delete a event properly?
Using timeperiod in my viewcontroller give unresolved identifier error.
Couldn't able to find If this feature already exists ?
Can you please point out on How to ?
It would be nice to have the opportunity to choose between a day/week( and possible month) view to have a better overview of all events.
Hello, I guess that would be pretty good feature, or does it exist in current version ?
Hey,
This looks like a great library!
I made a similar library with a very similar name a few years ago. If/when I Port to Swift, I'd want to drop the prefix, and as it stands this becomes a conflict.
Any chance you would consider renaming (or at least prefixing) this one?
Thanks!
Thanks for the awesome library. I have integrated the same in my project, i need to drag and drop event view to the next page like ical.please advice
thanks in advance
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -hash not defined for the UIColor <UIPlaceholderColor: 0x1700343e0>; need to first convert colorspace.'
Hi,
I want to implement full calendar with monthView with all days of current month.
I guess reloadData of DayViewController runs on the main thread causing UI to freeze. Can you please look into it. Why does the UI hang on reloadData.
Implementing NSCopying for CalendarStyle will make it easier to apply adjustments to the style and less prone to errors if current style is changed without invocation of updateStyle
method.
Hi @richardtop !
I want to restrict the hours set presented in the calendar. For example, I want the lateral content(the hours) to be from 12:00 to 18:00.
There is currently any solution to this?
[!] Unable to find a specification for CalendarKit
help me for this
It would be nice to have a customizable details view next to the timeline view. For now i just cant get it working. I tried the following in the DayView
's layoutSubviews
:
self.dayViewHeader.anchorAndFillEdge(.top, xPad: 0, yPad: 0, otherSize: self.dayViewHeaderHeight);
// self.timelinePager.alignAndFill(align: .underMatchingLeft, relativeTo: self.dayViewHeader, padding: 0);
self.timelinePager.alignAndFillHeight(align: .underMatchingLeft, relativeTo: self.dayViewHeader, padding: 0, width: ((self.frame.width / 3) * 2));
self.dayViewDetails.alignAndFillHeight(align: .underMatchingRight, relativeTo: self.dayViewHeader, padding: 0, width: (self.frame.width / 3));
But this is really messing up everything :D
Hey,
How to perform scroll horizontal calendar header to next or week by button (no gesture) ? I want do that by clicking bar button item.
Select the last date on header which doesnot have a event in his timeline. Now go to next week by scrolling week header you will see that the date on week header is selected last but the events are displaying for the next day. Also i can see same events for many days in week.
Hi Richards,
Thanks for sharing the CalendarKit! It's the best pod I've found so far.
What I would suggest is to be able to enable a vertical scroll in order to get to the next day. Currently we are restricted to the horizontal one.
Looking forward to see a detailed documentation of this amazing pod.
Also, if you're interested in implementing some custom features please let me know.
Cheers,
Andrei
It would be good to add support for a minimum and maximum date so that the pager wouldn't scroll past these values?
I may delve into the source code myself if I get the time. I envisage this as a single additional function added to the DayViewDelegate
for open func dayView(dayView: DayView, canMoveTo date: Date)
. Are there any pitfalls I should be aware of if I was to approach it like this, please?
Hi,
For iOS projets it's will be great to make your component Carthage compatible
Take a look at these articles:
On your README.md
add on top and add section for the installation with Carthage.
How to open event n own view controller?
There is no indexPath or something like this.
func dayViewDidSelectEventView(_ eventview: EventView)
I want to retrieve data from realm data base in new view controller for selected Item.
I wish to change the time interval on Day view controller from 1 hour to 1/2 hour.
Hi Richard,
I found a bug when selecting a date of at least 1 week before the current selected date at Calendar (not every time), the system will crash. It is due to the following statement in DayHeaderView has possibility to return the currentWeekDayIndex as 7.
I can fix it by changing the statement as following.
currentWeekdayIndex = abs(daysInWeek + daysFrom % daysInWeek) % daysInWeek
This will change the 7 to 0. Hope this help.
Hi!
Refer to apple calendar app, we need place to show all-day tasks at the bottom of timeline.
Hi,
Is there a way to know what dates are being shown? user swipe callbacks?
The layout falls apart in landscape mode.
is it possible?
On first load screen appear on next day, but if i scroll back it scrolls two days back, i.e. appear on 27 but if i scroll back will set on 25 (which is right if today is day back from day that appear), so problem in appearance i guess
I've seen numerous instances of events not being properly detected as overlapping, which causes one event to draw atop another given than their x-offset is incorrectly calculated.
In TimelineView.recalculateEventLayout(), the currently-operated-on event is only checked for overlap with the array's most recently added event, not the previous events in the array that could potentially be overlaps.
Is this potentially related to issue #43 ?
Custom typefaces for each of the different types of labels don't appear supported and use systemFontOfSize
instead. Adding an option to support custom typefaces into the styles would be beneficial.
Hello,
My understanding is that the library expects to be used by creating a view controller that subclasses DayViewController, taking the entire screen bounds. Is there a way to just use DayView in a region of the screen, with my view controller implementing DayViewDelegate?
Thanks!
Hi @richardtop
Thanks for creating CalendarKit, it has saved several hours of our development effort.
We have a requirement to navigate to next week on tap of a button, using move(to:) we are able to do this, however, strangely we encounter a crash only when we select the first day of the week and then move to previous week. For all other scenarios it works fine.
The way we are doing is,
func moveDayView(withTimeChunk time : TimeInterval,from currentDate : Date) {
let dateAfterSwipe = currentDate.addingTimeInterval(time)
dayView.state = DayViewState(date: currentDate)
dayView.state?.move(to: dateAfterSwipe)
dayView(dayView: dayView, willMoveTo: dateAfterSwipe)
}
I have attached screenshot where it crashes soon after the move happens
Hi!
Recently I started to use this library and now I need to change the label colour of all events and I can't do this. I don't know if I'm doing something wrong or what, but I can't do it.
I think this is a good aspect to think about...
I have followed the installation guide, but still failed to integrate your library to my existing project.
I retried a few time, but still getting the same errors like this:
I noticed that recently DateTools have released the latest swift update.
It changed from pod 'DateTools'
to 'pod 'DateToolsSwift'`
Not sure if it is a issue...
I would be graceful if you could help me to solve this. Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.