All Versions
62
Latest Version
Avg Release Cycle
40 days
Latest Release
-

Changelog History
Page 5

  • v1.5.1 Changes

    ๐Ÿ”„ Change

    • โž• Add layout() method to support Xcode playgrounds ๐ŸŽ PinLayout layouts views immediately after the line containing .pin has been fully executed, thanks to ARC (Automatic Reference Counting) this works perfectly on iOS/tvOS/macOS simulators and devices. But in Xcode Playgrounds, ARC doesn't work as expected, object references are kept much longer. This is a well-documented issue. The impact of this problem is that PinLayout doesn't layout views at the time and in the order required. To handle this situation in playgrounds it is possible to call the layout() method to complete the layout.

    ๐Ÿ“š See PinLayout in Xcode Playgrounds documentation for more information

  • v1.5.0 Changes

    ๐Ÿ†• New method sizeToFit(:FitType) & fitSize() is now deprecated

    ๐Ÿ”„ Changes

    • BREAKING CHANGE: fitSize() is now deprecated. The new sizeToFit(:FitType) should be used instead.

    • New method sizeToFit(_ fitType: FitType)

      • sizeToFit(_ fitType: FitType)
        The method adjust the view's size based on the view's sizeThatFits() method result. PinLayout will adjust either the view's width or height based on the fitType parameter value.

        Notes:

        • If margin rules apply, margins will be applied when determining the reference dimension (width/height).
        • The resulting size will always respect minWidth / maxWidth / minHeight / maxHeight.

        Parameter fitType: Identify the reference dimension (width / height) that will be used to adjust the view's size.

        • .width: The method adjust the view's size based on the reference width.
          • If properties related to the width have been pinned (e.g: width, left & right, margins, ...), the reference width will be determined by these properties, if not the current view's width will be used.
          • The resulting width will always match the reference width.
        • .height: The method adjust the view's size based on the reference height.
          • If properties related to the height have been pinned (e.g: height, top & bottom, margins, ...), the reference height will be determined by these properties, if not the current view's height will be used.
          • The resulting height will always match the reference height.
        • .widthFlexible: Similar to .width, except that PinLayout won't constrain the resulting width to match the reference width. The resulting width may be smaller of bigger depending on the view's sizeThatFits(..) method result. For example a single line UILabel may returns a smaller width if its string is smaller than the reference width.
        • .heightFlexible: Similar to .height, except that PinLayout won't constrain the resulting height to match the reference height. The resulting height may be smaller of bigger depending on the view's sizeThatFits(..) method result.
      • Added by Luc Dion in Pull Request #103

  • v1.4.3 Changes

    ๐Ÿ›  Fix Carthage support

    • ๐Ÿ›  Fix an issue that occurs with the latest Carthage version.
  • v1.4.2 Changes

    ๐Ÿ”„ Change

    โž• Add method that can pin multiples edges:

    • ๐Ÿ“Œ all(): Pin all edges on its superview's corresponding edges (top, bottom, left, right). Similar to calling view.top().bottom().left().right()

    • ๐Ÿ“Œ horizontally(): Pin the left and right edges on its superview's corresponding edges. Similar to calling view.left().right().

    • vertically(): Pin the top and bottom edges on its superview's corresponding edges. Similar to calling view.top().bottom().

  • v1.4.1 Changes

    ๐Ÿ”„ Change

    • โž• Add new method margin(_ directionalInsets: NSDirectionalEdgeInsets)

      Set margins using NSDirectionalEdgeInsets. This method is particularly to set all margins using iOS 11 UIView.directionalLayoutMargins.

      Available only on iOS 11 and higher.

    • โšก๏ธ Update all examples so they support iOS 11 and iPhoneX landscape mode. They use the new UIView.safeAreaInsets property.

  • v1.4.0 Changes

    ๐Ÿ”„ Change

    • PinLayout now apply correctly margins when hCenter or vCenter have been set

      • hCenter: When the Horizontal Center is set, PinLayout now applies the left margin.
      • vCenter: When the Vertical Center is set, PinLayout now applies the top margin.

      BREAKING CHANGE: This may be a breaking change if you are using hCenter(..), vCenter(...), center(...), centerRight(...), centerLeft(...), or any other method using the center position while also using a margin.

  • v1.3.2 Changes

    ๐Ÿ”„ Change

    • Add aspectRatio methods:

      • aspectRatio(_ ratio: CGFloat):
        Set the view aspect ratio. If a single dimension is set (either width or height), the aspect ratio will be used to compute the other dimension.
        • AspectRatio is defined as the ratio between the width and the height (width / height).
        • An aspect ratio of 2 means the width is twice the size of the height.
        • AspectRatio respects the min (minWidth/minHeight) and the max (maxWidth/maxHeight) dimensions of an item. Set all margins using an UIEdgeInsets. This method is particularly useful to set all margins using iOS 11 UIView.safeAreaInsets
      • aspectRatio(of view: UIView):
        Set the view aspect ratio using another UIView's aspect ratio.

      AspectRatio is applied only if a single dimension (either width or height) can be determined, in that case the aspect ratio will be used to compute the other dimension.

      • AspectRatio is defined as the ratio between the width and the height (width / height).
      • AspectRatio respects the min (minWidth/minHeight) and the max (maxWidth/maxHeight) dimensions of an item.
        • aspectRatio():
          If the layouted view is an UIImageView, this method will set the aspectRatio using the UIImageView's image dimension.

      For other types of views, this method as no impact.

  • v1.3.1 Changes

    ๐Ÿ”„ Change

    • โž• Add new margin method margin(_ insets: UIEdgeInsets)
      Set all margins using an UIEdgeInsets. This method is particularly useful to set all margins using iOS 11 UIView.safeAreaInsets
  • v1.3.0 Changes

    ๐Ÿš€ Released on 2017-08-18.

    ๐Ÿ”„ Change

    • ๐Ÿ’ฅ Breaking change related to hCenter(CGFloat), hCenter(percent), vCenter(CGFloat), vCenter(percent):
      • vCenter(_ value: CGFloat) and vCenter(_ percent: Percent):
        The value specifies the distance vertically of the view's center related to the superview's center in pixels. Previously it was related to the superview's top edge.
      • hCenter(_ value: CGFloat) and hCenter(_ percent: Percent):
        The value specifies the distance horizontally of the view's center related to the superview's center in pixels. Previously it was related to the superview's left edge.

    ๐Ÿ‘ป Previously hCenter(0) wasn't equal to hCenter(), same thing for vCenter(0). But this was an exception: top(0) == top(),left(0) == left(), right(0) == right(). Now thay all have the same logic.

  • v1.2.4 Changes

    ๐Ÿ”„ Change

    • โž• Add methods to pin hCenter and vCenter to any other view's edges (including the new hCenter and vCenter edges)
      • New methods:
        • hCenter(to: edge)
          Position horizontally the view's center directly on another viewโ€™s edge (left/hCenter/right)
        • vCenter(to: edge)
          Position vertically the view's center directly on another viewโ€™s edge (top/vCenter/bottom).
      • New UIView's edges:
        • UIView.edge.hCenter
        • UIView.edge.vCenter
      • Added by Luc Dion in Pull Request #80