Comments (4)
Well spotted. It turns out subviews don't propagate events to their superview in quite the way I thought. This is now fixed (I've switched to using a UITapGestureRecognizer instead of a UIControl to detect the tap).
from icarousel.
Hi demosthenese,
Thanks for the fix. I confirm that the fix works.
However, related to didTap method. I suggest to change to something like this.
- (void)didTap:(UITapGestureRecognizer *)tapGesture { ... if (index == self.currentItemIndex && [delegate respondsToSelector:@selector(carousel:didSelectItemAtIndex:)]) { [delegate carousel:self didSelectItemAtIndex:index]; } }
When
centerItemWhenSelectedis enabled, clicking to non-centered item will make it centered and also trigger didSelectItemAtIndex. What I want is that item is only centered, not triggering didSelectItemAtIndex. Or maybe, there should be another flag to enable centering and selecting or just centering.
Thanks.
from icarousel.
I think it's more generally useful as it stands because some users may wish to be notified that an item is tapped even when auto-centering is on.
For your purposes you can simply put if (index == carousel.currentItemIndex) {...} in your delegate method to exclude taps on the non-selected items.
from icarousel.
That's cool. Thanks!
from icarousel.
Related Issues (20)
- ICarousel Accessibility Inspector return incorrect UI element location for Mac
- constraints attribute? for optimizing for device size?
- Crash report from Fabric
- Carousel like glidejs.com
- An unwanted view is displaying first time when we scroll slowly as a background shadow
- How to install
- Can you expose the previousItemIndex
- Spacing between items HOT 1
- Swift Package Manager Support
- On UIButtonClicked Change UIView at particular indexpath in iCarousel
- iCarouselTypeRotary type number of visual images invalid setting
- iCarouselTypeRotary type number of visual images setting invalid
- Carousel inside reusable UITableViewCell, carousel views shuffled
- iOS 13 deprecate in iCarousel.m new warnings due to use of old animation method
- tvos icarousel
- On apps running on Mac OS with Catalyst to move between different item you can't use trackpad gesture but need to press and drag HOT 1
- Delegate and Datasource should be weak? HOT 1
- Cycling custom type animation
- Swift Package Manager support issue
- Scrollable carousel view accessibility Id is not working.
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 icarousel.