Skip to content

Commit

Permalink
Removed align named param.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Amaral committed Aug 28, 2016
1 parent 9c3794d commit f5f2ce4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Demo/IconButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ class IconButton: UIView {
super.layoutSubviews()

imageView.anchorToEdge(.Top, padding: 0, width: 24, height: 24)
label.align(align: .UnderCentered, relativeTo: imageView, padding: 5, width: self.width, height: 15)
label.align(.UnderCentered, relativeTo: imageView, padding: 5, width: self.width, height: 15)
}
}
4 changes: 2 additions & 2 deletions Demo/TestViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class TestViewController: UIViewController {
super.viewWillLayoutSubviews()

anchorViewA.anchorInCorner(.TopLeft, xPad: 20, yPad: 20, width: 200, height: 200)
view1.align(align: .ToTheRightMatchingTop, relativeTo: anchorViewA, padding: 20, width: 100, height: 100, offset: 20)
view2.align(align: .UnderMatchingLeft, relativeTo: anchorViewA, padding: 20, width: 100, height: 100, offset: 20)
view1.align(.ToTheRightMatchingTop, relativeTo: anchorViewA, padding: 20, width: 100, height: 100, offset: 20)
view2.align(.UnderMatchingLeft, relativeTo: anchorViewA, padding: 20, width: 100, height: 100, offset: 20)
}
}
1 change: 1 addition & 0 deletions Neon.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Pod::Spec.new do |s|
s.social_media_url = 'http://twitter.com/MikeAmaral'
s.authors = { 'Mike Amaral' => 'mike.amaral36@gmail.com' }
s.source = { :git => 'https://github.com/mamaral/neon.git', :tag => "v0.3.0" }
s.osx.deployment_target = '10.7'
s.ios.deployment_target = '8.0'
s.source_files = 'Source/*.swift'
s.requires_arc = true
Expand Down
6 changes: 3 additions & 3 deletions Source/NeonAlignable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public extension Alignable {
/// match the specified `Align`. For example, if you specify `.ToTheRightMatchingTop` and provide an offset value of `5`, the
/// view's y origin will be lower than the sibling view's y origin by 5 points.
///
public func align(align: Align, relativeTo sibling: Frameable, padding: CGFloat, width: CGFloat, height: CGFloat, offset: CGFloat = 0) {
public func align(_ align: Align, relativeTo sibling: Frameable, padding: CGFloat, width: CGFloat, height: CGFloat, offset: CGFloat = 0) {
var xOrigin : CGFloat = 0.0
var yOrigin : CGFloat = 0.0

Expand Down Expand Up @@ -97,11 +97,11 @@ public extension Alignable {

if height == AutoHeight {
self.setDimensionAutomatically()
self.align(align: align, relativeTo: sibling, padding: padding, width: width, height: self.height, offset: offset)
self.align(align, relativeTo: sibling, padding: padding, width: width, height: self.height, offset: offset)
}
if width == AutoWidth {
self.setDimensionAutomatically()
self.align(align: align, relativeTo: sibling, padding: padding, width: self.width, height: height, offset: offset)
self.align(align, relativeTo: sibling, padding: padding, width: self.width, height: height, offset: offset)
}
}

Expand Down

0 comments on commit f5f2ce4

Please sign in to comment.