Skip to content
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

.intrinsic size conflicting constraints #219

Open
SaladDays831 opened this issue Oct 30, 2023 · 0 comments
Open

.intrinsic size conflicting constraints #219

SaladDays831 opened this issue Oct 30, 2023 · 0 comments

Comments

@SaladDays831
Copy link

I'm getting conflicting constraint errors even with the most basic setup when using .intrinsic size

class DemoViewController: UIViewController {
    
    private let demoView = UIView()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.addSubview(demoView)
        demoView.translatesAutoresizingMaskIntoConstraints = false
        demoView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
        demoView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16).isActive = true
        demoView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -16).isActive = true
        demoView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
        demoView.heightAnchor.constraint(equalToConstant: 200).isActive = true
    }
}
func buttonPressed() {
        let controller = DemoViewController()
        let options = SheetOptions()
        let sheet = SheetViewController(controller: controller, sizes: [.intrinsic], options: options)
        self.present(sheet, animated: true)
    }

This results in these conflicting constraints:

"<NSLayoutConstraint:0x600002135950 UIView:0x106006cd0.bottom == UIView:0x10600aa70.bottom   (active)>",
    "<NSLayoutConstraint:0x600002135c20 UIView:0x106006a30.bottom == UIView:0x106006cd0.bottom   (active)>",
    "<NSLayoutConstraint:0x600002135c70 V:|-(0)-[UIView:0x106006a30]   (active, names: '|':UIView:0x106006cd0 )>",
    "<NSLayoutConstraint:0x600002135e50 V:|-(0)-[UIView:0x106006e60]   (active, names: '|':UIView:0x106006a30 )>",
    "<NSLayoutConstraint:0x600002135f40 UIView:0x106006e60.bottom == UIView:0x106006a30.bottom   (active)>",
    "<NSLayoutConstraint:0x600002136580 UIView:0x106005e60.height == 200   (active)>",
    "<NSLayoutConstraint:0x600002136440 V:|-(0)-[UIView:0x106005e60]   (active, names: '|':UIView:0x10600d2a0 )>",
    "<NSLayoutConstraint:0x600002136530 UIView:0x106005e60.bottom == UIView:0x10600d2a0.bottom   (active)>",
    "<NSLayoutConstraint:0x6000021365d0 UIView:0x10600d2a0.bottom == UIView:0x106006e60.bottom   (active)>",
    "<NSLayoutConstraint:0x600002136a80 V:|-(0)-[UIView:0x10600d2a0]   (active, names: '|':UIView:0x106006e60 )>",
    "<NSLayoutConstraint:0x6000021359a0 V:|-(0)-[UIView:0x106006cd0]   (active, names: '|':UIView:0x10600aa70 )>",
    "<NSLayoutConstraint:0x600002136b20 'UIView-Encapsulated-Layout-Height' UIView:0x10600aa70.height == 852   (active)>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant