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

Make tableViewStyle public #2092

Merged
merged 1 commit into from
Oct 5, 2020

Conversation

ChaosCoder
Copy link
Contributor

This PR makes it possible for subclasses of FormViewController to specify a UITableView.Style for the form table.

This way, a subclass can specify the style e.g. via the initializer called by UIKit:

required init?(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
    tableViewStyle = .plain
}

or lets you specify the style in viewDidLoad:

override func viewDidLoad() {
    if #available(iOS 13.0, *) {
        self.tableViewStyle = .insetGrouped
    }
    
    super.viewDidLoad()
}

Motivation

I needed to be able to set the table view style in viewDidLoad to .insetGrouped in my project but failed at doing so, because the tableViewStyle-property in FormViewController is marked as private.

Changes

This simply marks the property tableViewStyle as public instead of private.

@mats-claassen mats-claassen merged commit 26f8a9c into xmartlabs:master Oct 5, 2020
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.

2 participants