Comments (6)
I made this public in a local version but found it often returned nil
so eventually coded an alternate method which satisfied my needs using the vanilla API.
This is probably why the method isn't public from the outset, as there are clearly certain caveats regarding its use which aren't currently documented.
from icarousel.
Yep, I agree, and in fact this is already included for 1.5.5 (not yet released)
Nick
(Sent from my iPhone)
On 15 Aug 2011, at 14:23, sgabello [email protected] wrote:
I'm already doing it in my fork because I need to show/hide the current view... But generally speaking I find it a useful method to expose to everyone... What you think?
Reply to this email directly or view it on GitHub:
https://github.com/demosthenese/iCarousel/issues/31
from icarousel.
Added in 1.5.5, but it's called - (UIView *)itemViewAtIndex:(NSInteger)index
for consistency
from icarousel.
Does this new method load the view before returning it if it isn't already loaded, to avoid returning nil
as it's counterpart does?
from icarousel.
It returns nil. I thought about triggering the load in that situation, but it's not really useful.
The main reason for the method is so you can manipulate visible views in the carousel. Every time a view is loaded, a new instance is created, so loading a view that's not visible in the carousel would be pointless because it it would never get displayed - as soon as it moved into view, a new instance would get loaded anyway. Any manipulation you did to it would be wasted.
If for some reason you do want a view that's not been loaded, just call the dataSource method for it yourself, e.g.
UIView *itemView = [carousel itemViewAtIndex:index];
if (itemView == nil)
{
itemView = [carousel.dataSource carousel:carousel viewForItemAtIndex:index];
}
from icarousel.
Ah, okay. Thanks for providing some interesting clarification.
I was unaware a new view would be created each time it becomes visible, and this certainly clears up some unintended issues I've run into :)
It also explains the slow down/jerkiness which affects scrolling when I lower numberOfVisibleItems
from its default to say eleven, as it is having to load, discard and reload views more often.
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.