I have updated my project to Xcode 13 and iOS 15. Now the app is crashing with an error related to autoresizing masks in UITableViewCells. I have tried to change UITableViewCells Layer property in the inspector to Inferred and followed this post, but none of them are working.
Have you encountered this problem. How it could be fixed?
Here is some information about the error:
Interface Builder Config Image
override func awakeFromNib() {
super.awakeFromNib()
selectionStyle = .none
setupEventAction()
configureAccessibilityForCellItem()
}
override func prepareForReuse() {
super.prepareForReuse()
eventView.eventImageView.image = nil
}
func configureAnnouncement(announcement: AnnouncementsRowItem, isWhiteCell: Bool = false) {
eventView.isHidden = announcement.event == nil
eventView.backgroundView.backgroundColor = isWhiteCell ? R.color.basic1_bg() : R.color.basic2_bg()
if announcement.event?.eventID.isEmpty ?? false || !isWhiteCell {
self.backgroundColor = R.color.basic2_bg()
}
bubbleView.configureAnnouncementsBubbleView(announcement: announcement)
eventView.configureAnnouncementsEventView(announcement: announcement)
layoutIfNeeded()
}
private func setupEventAction() {
eventView.isUserInteractionEnabled = true
let gesture = UITapGestureRecognizer(target: self, action: #selector(showEvent))
gesture.numberOfTapsRequired = 1
eventView.addGestureRecognizer(gesture)
}
@objc
func showEvent() {
openEventClicked?()
}
Thanks 🙏
I have faced up with same problem. Try following: Open *.xib of your UITableViewCell as source code (Context menu / "Open As" / "Source Code"). Locate "tableViewCell" and "tableViewCellContentView" tags, delete its "translatesAutoresizingMaskIntoConstraints" attributes (with values), delete its subtags "autoresizingMask" if present.
https://i.stack.imgur.com/bDSJ3.png
My issue was resolved with a different solution, while the error was the same the cause was different. A view inside my cell was assigned the same class from the cell, by removing the class the error was resolved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With