Skip to content

Commit

Permalink
Fix a bug introduced by the previous release regarding safeArea.
Browse files Browse the repository at this point in the history
  • Loading branch information
srdanrasic committed May 2, 2018
1 parent 471f372 commit 9b8ce44
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Layoutless.podspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Pod::Spec.new do |s|
s.name = "Layoutless"
s.version = "0.1.4"
s.version = "0.1.5"
s.summary = "Write less UI code"
s.description = "Layoutless enables you to spend less time writing UI code. It provides a way to abstract common layout patterns and enable consistent styling approach."
s.homepage = "https://github.com/DeclarativeHub/Layoutless"
s.license = 'MIT'
s.author = { "Srdan Rasic" => "[email protected]" }
s.source = { :git => "https://github.com/DeclarativeHub/Layoutless.git", :tag => "0.1.4" }
s.source = { :git => "https://github.com/DeclarativeHub/Layoutless.git", :tag => "0.1.5" }

s.ios.deployment_target = '9.3'
s.tvos.deployment_target = '11.0'
Expand Down
2 changes: 1 addition & 1 deletion Layoutless/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1.4</string>
<string>0.1.5</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
10 changes: 7 additions & 3 deletions Sources/Layout/Layoutless.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ extension LayoutProtocol where LayoutNode: Anchorable {
public func layoutRelativeToParent(safeArea: Bool, layout: @escaping (Anchorable, LayoutNode) -> Void) -> Layout<ChildNode<LayoutNode>> {
return Layout {
return ChildNode(self.makeLayoutNode()) { parent, node in
if #available(iOS 11.0, *), safeArea {
layout(parent.safeAreaLayoutGuide, node)
if safeArea {
if #available(iOS 11.0, *) {
layout(parent.safeAreaLayoutGuide, node)
} else {
layout(parent.___safeAreaLayoutGuide, node)
}
} else {
layout(parent.___safeAreaLayoutGuide, node)
layout(parent, node)
}
}
}
Expand Down

0 comments on commit 9b8ce44

Please sign in to comment.