richardtop / CalendarKit

๐Ÿ“… Calendar for Apple platforms in Swift
https://www.youtube.com/watch?v=cJ63-_z1qg8
MIT License
2.52k stars 340 forks source link

Support custom views as as the EventView #175

Open johnnyperdomo opened 6 years ago

johnnyperdomo commented 6 years ago

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.

richardtop commented 6 years ago

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".

johnnyperdomo commented 6 years ago
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?

richardtop commented 6 years ago

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

johnnyperdomo commented 6 years ago
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 ๐Ÿ˜”

richardtop commented 6 years ago

@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)

johnnyperdomo commented 6 years ago

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

2) is there a way to get position of event frame?

richardtop commented 6 years ago
  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)
dotWasim commented 5 years ago

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

johnnyperdomo commented 5 years ago

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

dotWasim commented 5 years ago

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

richardtop commented 5 years ago

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.

RareScrap commented 3 years ago

Has anyone already implemented this feature?

Hritik9724 commented 1 year ago

Any1 had tried to customise the eventView ?