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

Add FXIOS-10189 Generic UITableView to ComponentLibrary Proposal #22729

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ih-codes
Copy link
Collaborator

📜 Tickets

Jira ticket

💡 Description

This is a draft PR with a rough proposal for making the UITableView and its cells generic for reuse across other areas of the app.

The idea will be that we can leverage these generic component types anywhere we need to show an insetGrouped tableview as in Unified Search, Main Menu, Settings Redesign, etc.

@adudenamedruby -- I just grabbed your preexisting MenuTableView, MenuCell, etc. and took a stab at making it generic. It needs some cleanup and some polish but I wanted to get your opinion on this before I push onward.

📝 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed, I updated documentation / comments for complex code and public methods
  • If needed, added a backport comment (example @Mergifyio backport release/v120)

@ih-codes
Copy link
Collaborator Author

This draft also contains an example of a concrete implementation using the unified search panel (very rough):

Screenshot 2024-10-23 at 4 01 50 PM

@@ -8,10 +8,60 @@ import UIKit
import Shared
Copy link
Collaborator Author

@ih-codes ih-codes Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file basically serves as one example usage of the generic classes in BrowserKit.

As mentioned there are a few other options to consider... e.g. inheritance.

If we used inheritance we could override any of the tableview properties we wish. If we use generics, we have to decide between a delegate pattern or passing in functions with some sort of view model so our concrete implementations are flexible enough.

We could also consider some mix of the two. 🤔 Maybe generic data types in a concrete general table view where subclasses can call super to use default implementations and override UITableView delegate/dataSource methods where desired. (Actually, the more I think about this, the more I think it bears some investigation to see if it looks a bit cleaner than this example).

Just some more thoughts I had this AM cc @adudenamedruby

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

Successfully merging this pull request may close these issues.

1 participant