Skip to content
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

Merged
merged 1 commit into from Dec 6, 2016

Conversation

rubencagnie
Copy link
Contributor

A Remainder BrickDimension will have a width that is the remainder that is left on a row

Fixes #39

@codecov-io
Copy link

codecov-io commented Dec 4, 2016

Current coverage is 93.01% (diff: 95.45%)

No coverage report found for master at dfe0610.

Powered by Codecov. Last update dfe0610...a5d0059

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
Copy link

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")
Copy link

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 {
Copy link

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?

Copy link
Contributor Author

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))
Copy link

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.

Copy link
Contributor Author

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
Copy link

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
@rubencagnie rubencagnie merged commit f1b2c97 into master Dec 6, 2016
@rubencagnie rubencagnie deleted the 39-remainder-brickdimension branch February 8, 2017 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants