Comments (5)
@sohamb1390
Check the latest commit. I've added the ability to respond to touches.
- The signature of
weekViewStylerEventView
has changed. It's only the return type that has changed fromUIView
toWeekViewEventView
. - Conform to the
WeekViewDelegate
protocol and implement its only method:weekViewDidClickOnEvent
. - Assign the delegate property of your
weekView
instance to the relevant class. - In the
WeekView
constructor, ensure to add the parameterrespondsToInteraction
and set it totrue
Then you're good to go!
So far it's only a tap that activates the interaction, I'll work towards more functionality so you can choose what kind of gesture you want.
Let me know of any bugs that you find, it's a little hacky. Tt should work but I haven't done too much testing.
Thanks!
from swift-week-view.
Thanks a Lot Evan!
You saved my day. It's working like a charm.
Thanks Again!
from swift-week-view.
@sohamb1390
I'm working on this already, but am not ready to push to the repository. I plan to add a general touch-listener as a delegate function, but haven't gotten around to completing it. I can try to get it done soon.
To implement yourself, you should be able to use the weekViewStylerEventView
method defined in the WeekViewStyler
protocol. Perhaps try this:
- Implement the protocol and method above
- Create the view for the given event, and add a touch-listener to it
- Return the view to the protocol method
from swift-week-view.
Hi Evan,
I tried what you have suggested like this:
-
I have implemented the method
weekViewStylerEventView
and inside it, I am returning views for individual events. -
I have added Tap gesture into each view:
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(onTapEventView(_:)))
eventView.addGestureRecognizer(tapGestureRecognizer)
-
I implemented the gesture method inside my viewController class:
@objc func onTapEventView(_ gesture: UIGestureRecognizer) { print("tapped") }
But unfortunately it's not triggering this method whenever I am touching any event view.
Any idea?
from swift-week-view.
@sohamb1390
I think either one of the superviews of the eventView
is highjacking the touch, or more likely its related to something in my logic for the scrollview behind it all. I'm having a look now.
from swift-week-view.
Related Issues (20)
- how use weekViewDidClickOnFreeTime
- Using Firebase with your code HOT 9
- Creating Events asynchronously HOT 3
- Memory leak HOT 1
- Customize to Half-hour HOT 1
- Scroll view HOT 2
- It is really good . I have an query i have a array in which i have time start and end and as well as description , can you please tell me how to add my data as events in your generate event function .Thank you HOT 7
- No such module 'TimelineCollectionView'
- No such module 'TimelineCollectionView' HOT 2
- drag and drop feature [enhancement] HOT 1
- StartHour Won't Changed
- how to set start date and end date ?
- Swift Week View with JSON HOT 1
- 5.3 compiler does not like TimeLineCollectionView.framework HOT 3
- Support for ALL-Day and multi-day events? HOT 1
- weekViewStylerHeaderView returns optional? HOT 1
- Setting Start and EndHour changes the Event view but not the grid and time label
- Hi I am trying out your project and got an issue HOT 1
- scrolling issue
- How to set the Event for particular time of day HOT 1
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 swift-week-view.