CalendarKit icon indicating copy to clipboard operation
CalendarKit copied to clipboard

Support custom views as as the EventView

Open johnnyperdomo opened this issue 6 years ago β€’ 13 comments

Hey, is there any way to get to get the frame coordinates:(x position, y position, height, width) from an event that i created on the timelineView.

Result I am trying to achieve

I want to add my own custom view on top of my event in the exact position to simulate an event view, because the event view isn't that customizable. I want to add buttons and add uilabels to the custom view, as well as shadows.

I would very greatly appreciate help with this problem, or if you could add more customization to the eventview.

johnnyperdomo avatar Sep 20 '18 13:09 johnnyperdomo

Hi @johnnyperdomo, Could you please share the result you're trying to achieve? You can mock it with Sketch/Photoshop or any other graphic editing software.

We could rephrase the question and consider it "CK doesn't support custom views as as the EventView".

richardtop avatar Sep 21 '18 03:09 richardtop

screen shot 2018-09-21 at 12 21 46 pm

I would like to make my own custom eventView, is there any way to achieve this? If not, how can we accomplish something like this in the very near future?

johnnyperdomo avatar Sep 21 '18 16:09 johnnyperdomo

@johnnyperdomo could you put these screenshot in context? I.e. how they would look on a timeline?

richardtop avatar Sep 21 '18 18:09 richardtop

screen shot 2018-09-21 at 7 26 51 pm

this, instead of colored event view. let's me build and customize how i want; just adding a simple uiview to event should allow this. i Just don't know how πŸ˜”

johnnyperdomo avatar Sep 21 '18 23:09 johnnyperdomo

@johnnyperdomo if you look inside e.g. Timeline, you'll notice the code to support a custom UIView subclass, but there is no interface to connect a custom view to the rest of the library. I won't extend this feature now, but you could try implement it yourself and submit a pull request.

Alternatively, you could "Slice&Dice" the CalendarKit and build your own calendar from scratch (as the Kit initially intended to be)

richardtop avatar Sep 22 '18 01:09 richardtop

1)What do you mean by, β€œthere is no interface to connect a custom view to the rest of library?”

  1. is there a way to get position of event frame?

johnnyperdomo avatar Sep 22 '18 20:09 johnnyperdomo

  1. It's impossible now to register a custom view to be used as the EventView, similarly to how the UITableView or UICollectionView supports custom views.
  2. No, currently the layout process is hidden inside the CalendarKit (TimelineView)

richardtop avatar Sep 24 '18 04:09 richardtop

@johnnyperdomo Hi there, did you manage to customize event view?

dotWasim avatar Oct 22 '18 14:10 dotWasim

@dotWasim I actually haven't worked on it. You can give it a shot if you'd like.

johnnyperdomo avatar Oct 22 '18 15:10 johnnyperdomo

ok, I will implement it and send pull request. @richardtop any suggestions or notes ?

dotWasim avatar Oct 22 '18 15:10 dotWasim

Hi @dotWasim try to follow the interface of UICollectionView, however move View Management to the CalendarKit itself and pass the needed ViewClass inside the Event or EventDescriptor.

Please, point your WIP pull request here with the [WIP] tag so I'd be able to give you feedback as you go.

This should be easy feature, so good luck with it.

richardtop avatar Oct 22 '18 16:10 richardtop

Has anyone already implemented this feature?

RareScrap avatar Oct 08 '20 05:10 RareScrap

Any1 had tried to customise the eventView ?

Hritik9724 avatar Nov 28 '22 11:11 Hritik9724