How do I use `readableContentGuide` with an accessory in a custom cell?
I created my own subclass UITableViewCell
. I want to align the edges of my subset with anchors readableContentGuide
:
let guide = contentView.readableContentGuide
myView.leadingAnchor.constraint(equalTo: guide.leadingAnchor).isActive = true
This works as expected until I add an additional view that will disable the layout.
accessoryType = .discloseIndicator
In default cells, the layout works correctly:
I'm curious to know if this is a UIKit bug or if I have another way to do this?
I came up with a workaround where I attach my subtitle to the default text label, which seems to work, but of course I would prefer.
textLabel?.text = " "
myView.leadingAnchor.constraint(equalTo: textLabel!.leadingAnchor).isActive = true
ps: blue border displays frame cell.contentView
(via View debugger)
+3
source to share
No one has answered this question yet
Check out similar questions: