Skip to content

Commit

Permalink
Not set translatesAutoresizingMaskIntoConstraints for root view by …
Browse files Browse the repository at this point in the history
…default
  • Loading branch information
evan-liu committed Nov 28, 2016
1 parent ad59047 commit 5da9697
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Sources/FormationLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ public final class FormationLayout: LayoutManager {

public let rootView: View

public init(rootView: View, translatesAutoresizing: Bool = false, autoresizing: UIViewAutoresizing? = nil) {
rootView.translatesAutoresizingMaskIntoConstraints = translatesAutoresizing
if translatesAutoresizing, let autoresizingMask = autoresizing {
rootView.autoresizingMask = autoresizingMask
public init(rootView: View, translatesAutoresizing: Bool? = nil, autoresizing: UIViewAutoresizing? = nil) {
if let translatesAutoresizing = translatesAutoresizing {
rootView.translatesAutoresizingMaskIntoConstraints = translatesAutoresizing

if translatesAutoresizing, let autoresizingMask = autoresizing {
rootView.autoresizingMask = autoresizingMask
}
}
self.rootView = rootView
}
Expand Down

0 comments on commit 5da9697

Please sign in to comment.