title: What is a Constraint in SwiftUI?
body: <p>I'm getting this error <code>[LayoutConstraints] Unable to simultaneously satisfy constraints.</code> with a bunch of logs below it (shown below). There is this <a href="https://stackoverflow.com/questions/64353899/unable-to-simultaneously-satisfy-constraints-probably-at-least-one-of-the-const">post</a> attempting to solve it. But I'm not sure what a constraint is and I can't find any documentation on it's definition/diagrams.</p>
  <p>Is there an explanation anywhere on what constraints are? This <a href="https://developer.apple.com/documentation/uikit/nslayoutconstraint" rel="nofollow noreferrer">documentation on NSLayoutConstraint</a> is pretty dense and cryptic to me e.g. &quot;constraint based layout system.&quot; An explanation would be super beneficial to help me debug this.</p>
  <pre><code>Probably at least one of the constraints in the following list is one you don't want. 
      Try this: 
          (1) look at each constraint and try to figure out which you don't expect; 
          (2) find the code that added the unwanted constraint or constraints and fix it. 
  (
      &quot;&lt;NSLayoutConstraint:0x6000021777a0 UIView:0x7fe80893f840.trailing == _UIBackButtonMaskView:0x7fe808939a90.trailing   (active)&gt;&quot;,
      &quot;&lt;NSLayoutConstraint:0x600002168780 'Mask_Trailing_Trailing' _UIBackButtonMaskView:0x7fe808939a90.trailing == BackButton.trailing   (active, names: BackButton:0x7fe808a18380 )&gt;&quot;,
      &quot;&lt;NSLayoutConstraint:0x6000021688c0 'MaskEV_Leading_BIB_Trailing' H:[_UIModernBarButton:0x7fe80891d0c0]-(0)-[UIView:0x7fe80893f840]   (active)&gt;&quot;,
      &quot;&lt;NSLayoutConstraint:0x600002168fa0 'UINav_static_button_horiz_position' _UIModernBarButton:0x7fe80891d0c0.leading == UILayoutGuide:0x600003b61880'UIViewLayoutMarginsGuide'.leading   (active)&gt;&quot;,
      &quot;&lt;NSLayoutConstraint:0x600002169040 'UINavItemContentGuide-leading' H:[BackButton]-(6)-[UILayoutGuide:0x600003b61260'UINavigationBarItemContentLayoutGuide']   (active, names: BackButton:0x7fe808a18380 )&gt;&quot;,
      &quot;&lt;NSLayoutConstraint:0x60000217f7a0 'UINavItemContentGuide-trailing' UILayoutGuide:0x600003b61260'UINavigationBarItemContentLayoutGuide'.trailing == _UINavigationBarContentView:0x7fe808b2a9a0.trailing   (active)&gt;&quot;,
      &quot;&lt;NSLayoutConstraint:0x60000216f1b0 'UIView-Encapsulated-Layout-Width' _UINavigationBarContentView:0x7fe808b2a9a0.width == 0   (active)&gt;&quot;,
      &quot;&lt;NSLayoutConstraint:0x60000217fb60 'UIView-leftMargin-guide-constraint' H:|-(8)-[UILayoutGuide:0x600003b61880'UIViewLayoutMarginsGuide'](LTR)   (active, names: '|':_UINavigationBarContentView:0x7fe808b2a9a0 )&gt;&quot;
  )
  
  Will attempt to recover by breaking constraint 
  &lt;NSLayoutConstraint:0x6000021777a0 UIView:0x7fe80893f840.trailing == _UIBackButtonMaskView:0x7fe808939a90.trailing   (active)&gt;
  </code></pre>