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

Is it possible to support table display? #5

Open
wyk111wyk opened this issue Mar 26, 2023 · 9 comments
Open

Is it possible to support table display? #5

wyk111wyk opened this issue Mar 26, 2023 · 9 comments

Comments

@wyk111wyk
Copy link

Thx for the open source, it is absolutely a great library.
However I noticed that the table style is missing, it's kind of important for academic articles.

@shaps80
Copy link
Owner

shaps80 commented Mar 27, 2023

Yeah supporting table's should be possible because I think Apple's parser does actually call through to those walkers.

However its non-trivial and I haven't had time to commit to this project recently.

I'm open to reviewing a PR and getting this in, but I'd suggest for a v1 of this, limiting to iOS 16 and using the native tables implementation only.

This is because unclear how best to proceed for iOS 13+ support, I think the best approach would be to use a CompositionalLayout and a UI/NS CollectionView – but as I said I've not properly explored this yet.

@LiYanan2004
Copy link

Hello @wyk111wyk and @shaps80. I have a similar project MarkdownView which supports table rendering with iOS 14+.

Behind the scene, I use a powerful combination of multiple geometry readers to achieve that on older OS. I have detached that amazing component and open-sourced. It's called AdaptiveGrid, and you can try it out.

@shaps80
Copy link
Owner

shaps80 commented Jun 15, 2023

Interesting, I actually plan to implement this myself, but I was going to use Table in SwiftUI for iOs 16+ and then UICollectionView for older versions.

I'll def check your out, even if I can't use it as-is, I'm sure it'll provide as a great reference, I'll credit you of course where appropriate 👍

Thanks for mentioning this.

@shaps80
Copy link
Owner

shaps80 commented Jun 15, 2023

@LiYanan2004 what performance testing have you done btw and does this work on macOS as well?

This could also be a great reference for back porting Grid actually 👍

@LiYanan2004
Copy link

LiYanan2004 commented Jun 15, 2023

Yeah. It's working on macOS as well. I use Grid to render Tables which can give me opportunities to customize the UI.

My goal to AdaptiveGrid is to build a back-deployable version of Grid which behaves the same as the built-in one on iOS 16+. Actually, It can.

The calculation inside AdaptiveGrid is light-weight, so it won't impact the overall performance. If you are experiencing a bad performance, you can give an issue 🤣

@shaps80
Copy link
Owner

shaps80 commented Jun 15, 2023

Ok interesting. I'll take a look when I have some time. Personally I tend to work on the smallest primitive first, then build on top.

So I had planned actually to rebuild Layout first, which would then make it relatively simpler to build things like Grid, Table, ViewThatFits and other awesome iOS 16/17+ features.

@LiYanan2004
Copy link

Looking forward.

@shaps80
Copy link
Owner

shaps80 commented Jun 15, 2023

Thanks again for posting though, looks like a neat library 👍

Just in case you're unaware you can find ALL of my backports here:

@shaps80
Copy link
Owner

shaps80 commented Aug 30, 2023

@LiYanan2004 just FYI I have an early version of a backported Table implementation with SwiftUI matching APIs. Its "close" and is being tested currently in a production app, so if it pans out I should be able to get Table support into the library soonish.

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