Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imageView unavailable? #43

Open
brendand opened this issue Apr 9, 2017 · 5 comments
Open

imageView unavailable? #43

brendand opened this issue Apr 9, 2017 · 5 comments

Comments

@brendand
Copy link

brendand commented Apr 9, 2017

This is a great project. I've just successfully put it into my app and it took hardly any time at all.

But I'm not sure why the imageView property is marked as unavailable.

@property (nonatomic, readonly, strong) UIImageView *imageView __attribute__((unavailable));
// default is nil.  image view will be created if necessary.

The comment below it says an image view will be created if necessary, but this seems not the case.

Were there problems getting an imageView to render in the MDSpreadView?

I'm going to see what happens when I change that code a bit to try and get it to work.

@dimitribouniol
Copy link
Member

It's probably unavailable because I never fleshed out that part of the API. Feel free to enable it and implement the necessary bits in the cell :) I would suggest lazily creating it to not incur a performance cost if it isn't necessary (more views onscreen = slower scrolling, though it might not matter anymore on modern devices)

@brendand
Copy link
Author

brendand commented Apr 9, 2017

Ok great. I just thought there was some technical reason why it was unavailable. Got it working now. I am initializing it the same way you initialize the labels. Seems to scroll pretty fast, although it did get chunky when I had around 19,000 records. I also tried 117,000 records too and it was still a bit chunky scrolling. That was on an iPhone 7. But it could have just been my code that was causing the chunkiness with such large amounts of data.

Here's what it's looking like so far with images:

img_1329

Thanks again for writing this component. It's working really well so far.

@dimitribouniol
Copy link
Member

If you only need images for one cell, you can always implement a custom cell subclass just for that column. Other than that, it was pretty well optimized for hundreds of thousands of rows and columns in each direction on older devices, but it does rely on the datasource callbacks being able to keep up in order to provide smooth scrolling. It doesn't look like you have too many views on screen, so you shouldn't be limited by the render server either. Running a time profile while scrolling should indicate where your bottle-neck is :)

@brendand
Copy link
Author

This is a database app so customers can add as many image fields as they want. But it's ok. I'll work on the performance. Thanks again for creating this.

@enthousiastic
Copy link

Hello , can you send me a small code example where one cell is an image and the others text from a db database from a sql query like the above image ArtsceneStock.
Many thanks
Enthousiastic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants