New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for “Remainder” BrickDimension #40
Conversation
Current coverage is 93.01% (diff: 95.45%)
|
case .Auto(let dimension): return dimension.value(for: otherDimension, in: view) | ||
default: return BrickDimension._rawValue(for: otherDimension, in: view, with: actualDimension) | ||
case .Auto(let dimension): return dimension.value(for: otherDimension, startingAt: origin, in: view) | ||
default: return BrickDimension._rawValue(for: otherDimension, startingAt: origin, in: view, with: actualDimension) | ||
} | ||
} | ||
|
||
/// Function that gets the raw value of a BrickDimension. As of right now, only Ratio and Fixed are allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to update this comment
// If the origin is bigger than the actual dimension, just return the whole dimension | ||
return otherDimension | ||
} | ||
return otherDimension - origin | ||
default: fatalError("Only Ratio and Fixed are allowed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this as well
@@ -27,6 +27,7 @@ extension UIView { | |||
public indirect enum BrickDimension { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you update the Docs with documentation on this new BrickDimension?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated docs
let section = BrickSection("TestSection", bricks:[ | ||
BrickSection(bricks: [ | ||
DummyBrick(width: .Fixed(size: 50), height: .Fixed(size: 25)), | ||
DummyBrick(width: .Remainder, height: .Fixed(size: 25)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does height
support .Remainder
? This is probably only relevant if we still support fixed heights on BrickSections
(I forget if we still do), if not then you can ignore this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Height does not support remainder yet
@@ -27,6 +27,7 @@ extension UIView { | |||
public indirect enum BrickDimension { | |||
case Ratio(ratio: CGFloat) | |||
case Fixed(size: CGFloat) | |||
case Remainder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be able to take the place of a Ratio(ratio: 1.0)
dimension? For example, if you called this Fill
instead of Remainder
, it would cover cases of a 100% ratio brick AND a "remainder" brick. Just a thought.
A Remainder BrickDimension will have a width that is the remainder that is left on a row Fixes #39
b394495
to
a5d0059
Compare
A Remainder BrickDimension will have a width that is the remainder that is left on a row
Fixes #39