-
-
Notifications
You must be signed in to change notification settings - Fork 66
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 option to configure TableView style for storyboard usage #74
Conversation
Codecov Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tobisaninfo thanks much for the pull request.
This lib wasn't designed to use with storybaords so it's a bit tricky. I think the proper solution is to make the table view an @IBOutlet
and set view = tableView
when func loadView()
.
One of the simpler approaches for now is to follow UITableViewController by making the table view readwrite
:
class QuickTableViewController {
- open private(set) var tableView: UITableView = UITableView(frame: .zero, style: .grouped)
+ open var tableView = UITableView(frame: .zero, style: .grouped)
}
Then it's much easier to override the table veiw for you needs:
required init?(coder: NSCoder) {
super.init(coder: coder)
tableView = UITableView(frame: .zero, style: .insetGrouped)
}
Can you make the changes and see if it works? Thanks.
Hi Ben, thanks for your feedback. |
Thanks for updating the PR 👍 |
Hi @bcylin, I would like to ask you for a favour. Maybe you heard about the Hacktoberfest (https://hacktoberfest.digitalocean.com/details). It is about open source contribution and doing something good for community and our planet. So I wonder if you might add the label Thanks |
@Tobisaninfo sure, thank you for creating the pull request. |
This pull requests add the option to configure the TableView style in the initializer used by storyboards.
I used the new initializer in my ViewController the following way: