Skip to content

Commit

Permalink
Fixed the lack of the ability to update intrinsic content size. Added…
Browse files Browse the repository at this point in the history
… a public func, 'updateIntrinsicHeight()' to recalculate/update the intrinsic height of the sheet. Resolves gordontucker#123
  • Loading branch information
BradPatras committed Aug 4, 2021
1 parent b13586b commit 15bfd9f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion FittedSheets/SheetViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,14 @@ public class SheetViewController: UIViewController {
}
}
}


/// Recalculates the intrinsic height of the sheet based on the content, and updates the sheet height to match.
///
/// **Note:** Only meant for use with `.intrinsic` sheet size
public func updateIntrinsicHeight() {
contentViewController.updatePreferredHeight()
}

/// Animates the sheet in, but only if presenting using the inline mode
public func animateIn(to view: UIView, in parent: UIViewController, size: SheetSize? = nil, duration: TimeInterval = 0.3, completion: (() -> Void)? = nil) {

Expand Down

0 comments on commit 15bfd9f

Please sign in to comment.