For me the only way to fix this was by setting a height constraint to the custom view
myCustomView.heightAnchor.constraint(equalToConstant: .greatestFiniteMagnitude).isActive = true
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: