     }
 
     private func inferSize() throws -> CGSize {
+        let intrinsicSize = view.intrinsicContentSize
         // Try AutoLayout
         if _usesAutoLayout {
             let transform = view.layer.transform

            if let width = try computeExplicitWidth() {
                _widthConstraint.isActive = true
                _widthConstraint.constant = width
            } else {
                _widthConstraint.isActive = false
            }
            if let height = try computeExplicitHeight() {
                _heightConstraint.isActive = true
                _heightConstraint.constant = height
            } else {
                _heightConstraint.isActive = false
            }

            _heightConstraint.isActive = false
        }
        // Try intrinsic size
        var size = intrinsicSize
        if size.width != UIViewNoIntrinsicMetric || size.height != UIViewNoIntrinsicMetric {
            var targetSize = CGSize(width: CGFloat.greatestFiniteMagnitude, height: .greatestFiniteMagnitude)
