Skip to content

Add `wrapContent()` methods

Compare
Choose a tag to compare
@lucdion lucdion released this 06 Jun 01:33
· 437 commits to master since this release

Add wrapContent() methods that adjust view's width & height to wrap all its subviews.

The following methods are useful to adjust view's width and/or height to wrap all its subviews. These methods also adjust subviews position to create a tight wrap.

Methods:

  • wrapContent()
    wrapContent(padding: CGFloat)
    wrapContent(padding: UIEdgeInsets)
    Adjust the view's width and height to wrap all its subviews. The method also adjusts subviews position to create a tight wrap. It is also possible to specify an optional padding around all subviews.
  • wrapContent(:WrapType)
    wrapContent(:WrapType, padding: CGFloat)
    wrapContent(:WrapType, padding: UIEdgeInsets)
    Adjust the view's width AND/OR height to wrap all its subviews. WrapType values are .horizontally/.vertically/.all It is also possible to specify an optional padding around all subviews.

See documentation for more information

Added by Luc Dion in Pull Request #141