-
-
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
[Help needed] Problems in changing underlying TableViewCell label #12
Comments
Hi Karsten, Thanks for the feedback. The label is contained in the associated // When it's OptionRow<CustomOptionCell>
let optionRowLabelAppearance = UILabel.appearance(whenContainedInInstancesOf: [CustomOptionCell.self])
optionRowLabelAppearance.textColor = Theme.textColor UIAppearance issueI find that But somehow it doesn't work when the cell is either registered with a class: tableView.register(UITableViewCell.self, forCellReuseIdentifier: "reuseIdentifier") or initialized in code: let cell = UITableViewCell(style: .subtitle, reuseIdentifier: "reuseIdentifier") Since Workaround with a nib objectAdd a
Register the nib to the table view with: class CustomOptionCell: UITableViewCell {} let typeName = "CustomOptionCell"
tableView.register(UINib(nibName: typeName, bundle: .main), forCellReuseIdentifier: typeName) Instead of using the default Then the table view will dequeue the cell registered in the nib and the |
Hi Ben, thanks for your quick answer. So much appreciated!
Unfortunately, the problem remains with SwitchCell and TapActionCell - got stuck creating a xib file directly using TapActionCell eg. There should be an easier way to get the labels styled (maybe using public init(style: UITableViewCellStyle, reuseIdentifier: String?) ? But I'm not really sure, how. Any idea at your side? Best wishes, Karsten |
Hi Karsten, I tried it on the Example app. Although |
Thanks for this wonderful project first - seems to make life much easier!
I'd like to color the labels of QuickTableViewController's rows, but can't get it to work.
Though I'm able applying a general style in AppDelegate with...
...all other labels in all other TableViewCells get colored accordingly, except of those from QuickTableViewController.
My naive approach to get this working was...
...but this was refused with the compiler error message:
Cannot convert value of type 'OptionRow<UITableViewCell'>.Type to expected element type 'UIAppearanceContainerType'
Wondering now what the preferred way is theming QuickTableViewController views?
Thanks and best wishes,
Karsten
The text was updated successfully, but these errors were encountered: