-
Notifications
You must be signed in to change notification settings - Fork 147
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
[Question + Discussion] Adding sibling views to table_view in TableScreen and GroupedTableScreen #765
Comments
Interesting approach. So instead of I'm in favor of this, but it would need to be thoroughly tested for issues with existing code bases. |
This is something I had to do. I wanted a class MyTableScreen < PM::Screen
include PM::Table
include PM::GroupedTable
def on_load
init_table_view
end
def init_table_view
table_view = UITableView.alloc.initWithFrame(CGRectZero, style: UITableViewStyleGrouped)
@table_view = append!(table_view, :table_view)
@table_view.delegate = self
@table_view.dataSource = self
end
def table_view
@table_view
end
alias :tableView :table_view
def table_data
[]
end
end Except in this case, I don't think it's a good idea to change the way |
Ah, that's nice. The proposed change doesn't retrofit UITableViewController. It subclasses UIViewController instead. But no worries, I'll just keep them as a custom class outside ProMotion then. |
Is there a straightforward way to add sibling views to table_view in TableScreen and GroupedTableView?
I'm looking specifically at 2 use cases:
I created a variation of the classes — TableViewController2, TableScreen2 and GroupedTableScreen2 to inherit from a UIViewController and adding the table_view as a subview so sibling views can be added to the resulting TableScreen2 (to work with use cases A and B). It looks like this modification can be made directly to the original 3 classes and still remain compatible.
If there's no way to do this currently with ProMotion, and there isn't a fundamental issue with this, I can create a PR for this.
I haven't thought of specific ways to test this other than the existing spec. If anyone has any idea, feel free to pitch in :)
The text was updated successfully, but these errors were encountered: