I have several views implemented programatically in the app without using storyboard.
let customView = UIView()
actionSheetHomeCall.view.addSubview(customView)
customView.translatesAutoresizingMaskIntoConstraints = false
customView.topAnchor.constraint(equalTo: actionSheetHomeCall.view.topAnchor, constant: 0).isActive = true
customView.rightAnchor.constraint(equalTo: actionSheetHomeCall.view.rightAnchor, constant: -10).isActive = true
customView.leftAnchor.constraint(equalTo: actionSheetHomeCall.view.leftAnchor, constant: 10).isActive = true
customView.heightAnchor.constraint(equalToConstant: 175).isActive = true
When running the app in Xcode 13, app crashes by giving the errorNSInternalInconsistencyException', reason: 'Must translate autoresizing mask into constraints to have _setHostsLayoutEngine:YES.'
if I remove translatesAutoresizingMaskIntoConstraints = false
from the code, the ui is messy. Is there any solution for this?