Skip to content

Latest commit

 

History

History
872 lines (575 loc) · 43.5 KB

CHANGELOG.md

File metadata and controls

872 lines (575 loc) · 43.5 KB

PinLayout Performance

PinLayout

Change Log

Released on 2023-11-03

Replace UIScreen.main to get display scale on iOS 13.0 and later

UIScree.main will be deprecated in a future version of iOS.

Added by Hyungyu Kim in Pull Request #275

Released on 2022-06-07

Fix Xcode Live Preview

Fix an error while using Xcode live preview with PinLayout. An internal class has been renamed.

Added by Luc Dion in Pull Request #251

Released on 2022-02-01

Renamed property pin.keyboardMargins -> pin.keyboardArea

This new name better represent what UIKit's UIView.keyboardLayoutGuide is

Added by Luc Dion in Pull Request #243

Released on 2022-02-01

New property pin.keyboardMargins

  • UIView.pin.keyboardMargins: property expose directly the value of UIKit UIView.keyboardLayoutGuide. This is really useful when layout adjustment due to the keyboard is required. iOS 15+

Added by baegteun in Pull Request #238

Released on 2021-05-18

New Objective-C interface

Instead of using verbose Objective-C with all brackets ([ ]):

[[[[[[logo.pinObjc top] left] width:100] aspectRatio] marginWithTop:topLayoutGuide + 10 horizontal:10 bottom:10] layout];

It now use a function chaining:

logo.pinObjc.topInsets(safeArea).leftInsets(safeArea).width(100).aspectRatio().margin(margin).layout();

Added by protosse in Pull Request #229

Released on 2021-05-17

  • Update to Xcode 12.5

Released on 2020-12-17

Fix an issue with Automatic Sizing

  • Fix autoSizeThatFits wrong calculations. There was a problem with size calculations of inner views while using autoSizeThatFits.

Released on 2019-10-03

Automatic Sizing (UIView only)

  • By calling autoSizeThatFits with the given available size and a layout closure, any layouting performed by PinLayout in that closure will be computed without affecting any subview's frame in the view hierarchy. On the other hand, any non PinLayout related code will also be executed. For that reason, it is really important to separate your layout code in it's own function to avoid any side effect during sizing, like setting the scroll view's content size in the above exemple or perhaps assigning itemSize in a collection view layout. That kind of code that depends on the layout should only be executed when layoutSubviews() is called as part of a normal layout pass. The resulting size also takes into account the margins applied on subviews, even on the bottom and trailing sides. Automatic sizing makes it really easy to write your layout logic once and add proper sizing behavior with virtually no additional effort. See https://github.com/layoutBox/PinLayout#automatic_sizing for more documentation.

Released on 2019-10-03

Improve method that validates width and height values

  • Method that set the width and height now validates even more parameter, by checking NaN and Infinity values.

Released on 2019-09-16

Usage UIView.effectiveUserInterfaceLayoutDirection to detect RTL

  • Use UIView.effectiveUserInterfaceLayoutDirection to detect RTL on iOS 10 and above. This is recommended approach to detect layout direction taking into account view's semantic content attribute, trait environment and UIApplication layout direction.
  • Update Travis to Xcode 11.

Released on 2019-08-16

Upgrade to Swift 5

  • Upgrade project to Swift 5
  • Update Pods
  • Apply xcodeproj migration

Added by Luc Dion in Pull Request #195

Released on 2019-06-25

Update Swift Package Manager support for Xcode 11

  • Updated PinLayout to be used with Xcode 11's Swift Package Manager.

  • Fix Warnings: public' modifier is redundant for instance method declared in a public extension.

Released on 2019-03-02

Add missing Objective-C API methods

  • wrapContent
  • wrapContentWithPadding:(CGFloat)
  • wrapContentWithInsets:(PEdgeInsets)
  • wrapContentWithType:(WrapType)
  • wrapContentWithType:(WrapType) padding:(CGFloat)
  • wrapContentWithType:(WrapType) insets:(PEdgeInsets)

Released on 2018-09-29

Update support for Swift 4.2

The PinLayout pod doesn't specify anymore the Swift language version.

PinLayout supports Swift versions:

  • Swift 4.2 / 4.1 / 4.0

  • Swift 3.*

  • Added by Luc Dion in Pull Request #178

Released on 2018-09-27

Minor internal changes

Remove sizeToFit() from SizeCalculable protocol. This change ensure that PinLayout pin.sizeToFit() method behave correctly. As per the iOS documentation, we should not directly override sizeToFit() but rather always only implement sizeThatFits(_:) for auto-sizing needs. This update aim to remove the sizeToFit() requirement in the SizeCalculable protocol.

Released on 2018-09-25

Minor changes

  • Cleanup .xcodeproj

  • Removed Swiftlint warnings

  • Fix an issue with PinLayoutSample app related to IntroRTLView example

  • Added by Luc Dion in Pull Request #177

Released on 2018-08-28

Add methods to layout a view between two other views

Add methods to position a view between two other views, either horizontally or vertically.

New Methods:

  • horizontallyBetween(:UIView, and: UIView)
    Position the view between the two specified views horizontally. The method layout the view's left and right edges. The order of the reference views is irrelevant. Note that the layout will be applied only if there is horizontal space between the specified views.

  • horizontallyBetween(:UIView, and: UIView, aligned: VerticalAlign)
    Position the view between the two specified views horizontally and aligned it using the specified VerticalAlign. The view will be aligned related to the first specified reference view. Note that the layout will be applied only if there is horizontal space between the specified views.

  • verticallyBetween(:UIView, and: UIView)
    Position the view between the two specified views vertically. The method layout the view's top and bottom edges. The order of the reference views is irrelevant. Note that the layout will be applied only if there is vertical space between the specified views.

  • verticallyBetween(:UIView, and: UIView, aligned: HorizontalAlign)
    Position the view between the two specified views vertically and aligned it using the specified HorizontalAlign. The view will be aligned related to the first specified reference view. Note that the layout will be applied only if there is vertical space between the specified views.

Example:

   view.pin.verticallyBetween(viewA, and: viewB, aligned: .center).marginVertical(10)

See Readme for more information

Released on 2018-08-25

Add pin.readableMargins and pin.layoutmargins

Add properties:

  • pin.readableMargins: UIEdgeInset:
    PinLayout's UIView.pin.readableMargins property expose UIKit UIView.readableContentGuide as an UIEdgeInsets. This is really useful since UIKit only expose the readableContent area to Auto Layout using UILayoutGuide.

  • pin.layoutmargins: UIEdgeInset
    PinLayout's UIView.pin.layoutMargins property expose directly the value of UIKit UIView.layoutMargins. The property exists only to be consistent with the other areas: pin.safeArea, pin.readableMargins and pin.layoutmargins. So its usage is not necessary.

Add examples using these properties: pinlayout_example_layout_margins_all

pinlayout_example_tableview_readable_content_all

Released on 2018-08-23

PinLayout Swift 3 support

PinLayout supports Swift 3 and Swift 4

Released on 2018-08-21

Deprecated method fitSize() has been removed

fitSize() has been removed after being deprecated for 10 months. sizeToFit(:FitType) should now be used instead. See Adjusting size.

Plus:

  • Refactor relative positioning methods source code (above(...), after(...), ...) using a default parameter value for the alignment parameter.

  • Fix unit test screen density.

  • Update few examples source code.

  • Added by Luc Dion in Pull Request #167

Released on 2018-08-16

Add Animations documentation and example

Add documentation that explains how PinLayout can handle view's animations.

  • Show few strategies that can be used to animate views.

  • Add an Animation example in the Example app.

  • Add an new "Examples" markdown page showing all PinLayout's examples.

  • Convert fileprivate to private declarations

  • Added by Luc Dion in Pull Request #165

Released on 2018-08-05

Method that position multiple edges now accept an offset parameter.

The offset parameter that specifies the distance from their superview's corresponding edges in pixels.

New methods:

  • topLeft(_ offset: CGFloat)

  • topCenter(_ topOffset: CGFloat)

  • topRight(_ offset: CGFloat)

  • centerLeft(_ leftOffset: CGFloat)

  • center(_ offset: CGFloat)

  • centerRight(_ rightOffset offset: CGFloat)

  • bottomLeft(_ offset: CGFloat)

  • bottomCenter(_ bottomOffset: CGFloat)

  • bottomRight(_ offset: CGFloat)

For example, to position a view at the top left corner with a top and left margin of 10 pixels:

   view.pin.topLeft(10)

Other change

Cleanup the interface by using default value parameters.

Released on 2018-07-17

Add sizeToFit() method.

The method adjust the view's size based on the result of the method UIView.sizeToFit(). Particularly useful for controls/views that have an intrinsic size (label, button, ...).

Released on 2018-06-28

Fix a regression

The recent changes to PinLayout that enable the layout of CALayer has impacted the layout of UIViews.

Released on 2018-06-26

Add support for CALayer layout

PinLayout can now layouts CALayer's. All PinLayout's properties and methods are available, with the following exceptions:

  • sizeToFit(:FitType) is not supported. Support for sizeToFit(:FitType) can be added to your custom CALayer subclasses, just make those layers conform to the SizeCalculable protocol and implement the two required functions.
  • CALayer.pin.safeArea property is not available.
  • aspectRatio() with no parameters

See CALayer Support documentation for more information

Released on 2018-06-19

Refactoring using generics

Refactoring to avoid having to deal directly with view types, making it easier to extend layouting to other APIs (e.g: CALayer)

Released on 2018-06-12

PinLayout has moved to the layoutBox organization

PinLayout is now part of the same organization as other open source projects related to layout using Swift.

Refactor source code that handle size adjustment.

Add an example using wrapContent() methods

Refactor views frame/bounds access

Released on 2018-06-05

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

Released on 2018-05-26

Objective-C support for macOS and tvOS

Add the support of Objective-C to macOS and tvOS.

Added by Luc Dion in Pull Request #138

Released on 2018-04-25

Add few missing Objective-C Interface properties and methods

These methods and properties are now accessible from Objective-C:

  • Pin.layoutDirection
  • Pin.safeAreaInsetsDidChangeMode
  • Pin.logWarnings
  • Pin.initPinLayout()
  • Pin.layoutDirection()

Added by Luc Dion in Pull Request #135

Released on 2018-04-23

Fine tune UIView.pin.safeArea support for iOS 8 and "New Relic" framework

Changes:

  • On iOS 8, PinLayout compatibility support of UIView.safeAreaInsetsDidChange was causing issues with the device's virtual keyboard. PinLayout still support UIView.pin.safeArea on this iOS release, but UIView.safeAreaInsetsDidChange won't be called on iOS 8

  • Fix issue with "New Relic" framework: Add a Pin.initPinLayout() that can be called to initialize PinLayout before the "New Relic" framework is initialized. "New Relic" is conflicting with other popular frameworks including Mixpanel, ReactiveCocoa, Aspect, ..., and PinLayout. To fix the issue, Pin.initPinLayout() must be called BEFORE initializing "New Relic" with NewRelic.start(withApplicationToken:"APP_TOKEN"). See here for more information regarding this issue #130

Added by Luc Dion in Pull Request #134

Released on 2018-04-20

Add macOS support

PinLayout now support macOS.

PinLayout support of macOS is not complete at 100%, see here the particularities of the current implementation:

  • PinLayout support only views that have a parent (superview) using a flipped coordinate system, i.e. views for which the computed property var isFlipped: Bool returns true. In a flipped coordinate system, the origin is in the upper-left corner of the view and y-values extend downward. UIKit use this coordinate system. In a non-flipped coordinate system (default mode), the origin is in the lower-left corner of the view and positive y-values extend upward. See Apple's documentation for more information about NSView.isFlipped. The support of non-flipped coordinate system will be added soon.

  • These methods are currently not supported on macOS, but they will be implemented soon:

    • sizeToFit(:FitType) (Coming soon)
    • aspectRatio() with no parameters (Coming soon)
  • UIView.pin.safeArea property is not available, AppKit doesn't have an UIView.safeAreaInsets equivalent.

All other PinLayout's methods and properties are available on macOS!

Added by Luc Dion in Pull Request #131

PinLayout now use MIT license

The PinLayout license has been changed from BSD 3-clause "New" to MIT License.

Released on 2018-03-22

UIView.pin.safeArea

PinLayout can handle easily iOS 11 UIView.safeAreaInsets, but it goes further by supporting safeAreaInsets for previous iOS releases (including iOS 7/8/9/10) by adding a property UIView.pin.safeArea. PinLayout also extend the support of UIView.safeAreaInsetsDidChange() callback on iOS 7/8/9/10.

See UIView.pin.safeArea Documentation for more details.

Added by Luc Dion in Pull Request #125

Add methods taking UIEdgeInset as parameter

  • all(_ insets: UIEdgeInsets)

  • horizontally(_ insets: UIEdgeInsets)

  • vertically(_ insets: UIEdgeInsets)

  • top(_ insets: UIEdgeInsets)

  • bottom(_ insets: UIEdgeInsets)

  • left(_ insets: UIEdgeInsets)

  • right(_ insets: UIEdgeInsets)

    See Layout using distances from superview’s edges for more details.

    Added by Luc Dion in Pull Request #125

Add margins method with percentage parameter

  • marginTop(_ percent: Percent)

  • marginLeft(_ percent: Percent)

  • marginBottom(_ percent: Percent)

  • marginLeft(_ percent: Percent)

  • marginStart(_ percent: Percent)

  • marginEnd(_ percent: Percent)

  • marginHorizontal(_ percent: Percent)

  • marginVertical(_ percent: Percent)

  • margin(_ percent: Percent)

  • margin(_ vertical: Percent, _ horizontal: Percent)

  • margin(_ top: Percent, _ horizontal: Percent, _ bottom: Percent)

  • margin(_ top: Percent, _ left: Percent, _ bottom: Percent, _ right: Percent)

    Added by vandyshev in Pull Request #126

Released on 2018-02-18

UIView.pin versus UIView.pinFrame

Until now UIView.pin was used to layout views, but there's also another property called UIView.pinFrame that does something slightly different in situations where the view has a transform (UIView.transform, scaling, rotation, ...).

  • pin: Set the position and the size of the non-transformed view. The size and position is applied before the transform. This is particularly useful when you want to animate a view using a transform without modifying its layout.

  • .pinFrame: Set the position and the size on the transformed view. The size and position is applied after the transform.

See https://github.com/layoutBox/PinLayout#uiviews-transforms for more informations.

Added by Luc Dion in Pull Request #122

Released on 2018-01-20

  • Handle layout relative to a view with a transform and/or a modified anchorPoint.
    Added by Luc Dion in Pull Request #116

Released on 2018-01-19

  • Fix an issue that was affecting UIScrollViews. PinLayout now set only the bounds's size and keep the origin.
    Added by Luc Dion in Pull Request #115

  • Handle correctly view's layer.anchorPoint. PinLayout now update correctly the view position when the view's layer.anchorPoint has been modified, i.e. when it is not its default value (0.5, 0.5). Added by Luc Dion in Pull Request #114

Released on 2018-01-12

Add methods:

  • all(_ value: CGFloat)
    The value specifies the top, bottom, left and right edges distance from the superview's corresponding edge in pixels. Similar to calling view.top(value).bottom(value).left(value).right(value).

  • horizontally(_ value: CGFloat) / horizontally(_ percent: Percent) The value specifies the left and right edges on its superview's corresponding edges in pixels (or in percentage of its superview's width).
    Similar to calling view.left(value).right(value).

  • vertically(_ value: CGFloat) / vertically(_ percent: Percent) The value specifies the ** top and bottom edges** on its superview's corresponding edges in pixels (or in percentage of its superview's height).
    Similar to calling view.top(value).bottom(value).

Released on 2017-12-28

  • PinLayout now handle correctly more situations with view with transforms.

Released on 2017-12-28

  • PinLayout now handle correctly parents (superviews) with transforms.

Released on 2017-12-22

  • POSSIBLE BREAKING CHANGE: PinLayout now keeps UIView's transform (scale, rotation, ...)
    Previously any view's transform was altered after layouting the view with PinLayout. Now PinLayout won't affect the view's transforms.

    For people not using transforms, this should be a non-breaking change. If someone is using transforms with PinLayout, this may change the behavior, although I think this will produce the expected results (ie, transforms not being affected/altered by layout).

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

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

Fix Carthage support

  • Fix an issue that occurs with the latest Carthage version.

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().

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.

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.

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.

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

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.

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

Change

  • Warnings now display more context information
    • The class name of the view being layouted.

    • The view's current frame

    • The class name of all superviews

    • The view's Tag

      Examples:

      • 👉 PinLayout Warning: width(50.0%) won't be applied, the view (UIView) must be added as a sub-view before being layouted using this method.
        (Layouted view info: Type: UIView, Frame: (10.0, 10.0, 20.0, 30.0), Tag: 0)

      • 👉 PinLayout Warning: width(-20.0) won't be applied, the width (-20.0) must be greater than or equal to zero.
        (Layouted view info: Type: ItemButton, Frame: (140.0, 100.0, 100.0, 60.0), Superviews: HomeView -> UIView, Tag: 0)

      • 👉 PinLayout Warning: topLeft(to: .topLeft, of: (UIView, Frame: (10.0, 10.0, 10.0, 10.0))) won't be applied, the reference view (UIView, Frame: (10.0, 10.0, 10.0, 10.0)) must be added as a sub-view before being used as a reference.
        (Layouted view info: Type: UIView, Frame: (140.0, 100.0, 100.0, 60.0), Superviews: UIView -> UIView, Tag: 0)

      • Added by Luc Dion in Pull Request #75

Change

  • Added a new method fitSize() that will replace the sizeThatFit() method. Its prior name was creating confusion with the already existingUIView.sizeToFit()` method.
  • sizeThatFit() method has been marked as deprecated.

Change

  • Add Swift 4.0 support

Released on 2017-08-18.

Change

  • Breaking change related to the following anchor's name. The change makes these anchor's name more standard:

    • UIView.anchors.leftCenter has been renamed UIView.anchors.centerLeft
    • UIView.anchors.rightCenter has been renamed UIView.anchors.centerRight
  • Add left to right (LTR) and right to left (RTL) language support.
    Additions:

    • Pin.layoutDirection(_ direction: LayoutDirection)
    • start(), start(_ value: CGFloat), start(_ percent: Percent)
    • end(), end(_ value: CGFloat), end(_ percent: Percent)
    • UIView.edge.start
    • UIView.edge.end
    • UIView.anchor.topStart
    • UIView.anchor.topEnd
    • UIView.anchor.centerStart
    • UIView.anchor.centerEnd
    • UIView.anchor.bottomStart
    • UIView.anchor.bottomEnd
    • topStart(to anchor: Anchor), topStart()
    • topEnd(to anchor: Anchor), topEnd()
    • centerStart(to anchor: Anchor), centerStart()
    • centerEnd(to anchor: Anchor), centerEnd()
    • bottomStart(to anchor: Anchor), bottomStart()
    • bottomEnd(to anchor: Anchor), bottomEnd()
    • before(of: UIView), before(of: [UIView])
    • before(of: UIView, aligned: VerticalAlign), before(of: [UIView], aligned: VerticalAlign)
    • after(of: UIView), after(of: [UIView])
    • after(of: UIView, aligned: VerticalAlign), after(of: [UIView], aligned: VerticalAlign)
    • marginStart(_ value: CGFloat)
    • marginEnd(_ value: CGFloat)
    • HorizontalAlign.start
    • HorizontalAlign.end
    • Added by Luc Dion in Pull Request #56

Released on 2017-07-14.

Change

  • Fix missing UIKit import. The problem was occuring while using Swift Package Manager.

Released on 2017-07-09.

Change

  • Implementation of:
    • minWidth
    • maxWidth
    • minHeight
    • maxHeight
    • justify(:HorizontalAlign)
    • align(:VerticalAlign)
    • Added by Luc Dion in Pull Request #53

Released on 2017-06-27.

Change

  • Support Xcode 9 Beta 2
  • Add a Form example
    • Added by Luc Dion in Pull Request #51
    • This example demonstrates:
      • Usage of filter method when using PinLayout's relative methods (above, below, left, right)
      • Adjusting a container's height to match all its children.
      • Animation of the appearance/disappearance of UIViews.

Released on 2017-06-18.

Change

  • Update relative methods signatures when specifying multiple relative views.
    Update the minor version due to a small breaking change with methods above(of…), below(of…), left(of…) and right(of…). They now takes either a single UIView or an Array of UIViews.

Released on 2017-06-12.

Change

  • Add tvOS support & set iOS target to 8.0 (instead of 10.2)

Released on 2017-06-12.

Change

  • Implementation of relative positioning using multiple relative views
    • Added by Luc Dion in Pull Request #43
    • The following methods can now receives one or many relative views. Useful to position a view relative to many UIViews.
      • above(of relativeViews: UIView...)
      • above(of relativeViews: UIView..., aligned: HorizontalAlignment)
      • below(of relativeViews: UIView...)
      • below(of relativeViews: UIView..., aligned: HorizontalAlignment)
      • left(of relativeViews: UIView...)
      • left(of relativeViews: UIView..., aligned: VerticalAlignment)
      • right(of relativeViews: UIView...)
      • right(of relativeViews: UIView..., aligned: VerticalAlignment)

Released on 2017-06-08.

Change

  • Add Swift Package Manager support
  • size(…) methods now tries to apply the width and the height individually
    Previously the size specified was applied only if both the width and height wasn’t specified. Now PinLayout will apply them individually, so if the width has been specified yet, the size’s width will be applied, else a warning will be displayed that indicate that the width won’t be applied. Same thing for the height.
  • Doesn’t display a warning anymore if the new specified width or height value is equal to the currently set value. This is coherent with other methods (top, left, hCenter, ….)
  • Clean up size(...) methods source code
  • Add PinLayout's performance documentation
  • Add 52 more unit tests. Code coverage is now 95.38%.

Fixes

  • Fix an issue with pin.vCenter() and pin.hCenter()

Released on 2017-06-06.

Fixes

  • Fix an issue with pin.vCenter() and pin.hCenter()