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

Adds the ability to use the collectionView delegate function willDisp… #151

Closed
wants to merge 1 commit into from

Conversation

ablokker
Copy link
Contributor

…lay cell on the brickCell

--This is being added so we know the imageView size before getting the url.
--Updated Tests

@codecov-io
Copy link

codecov-io commented Jul 11, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@a78005e). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #151   +/-   ##
=========================================
  Coverage          ?   93.41%           
=========================================
  Files             ?       39           
  Lines             ?     3159           
  Branches          ?        0           
=========================================
  Hits              ?     2951           
  Misses            ?      208           
  Partials          ?        0
Impacted Files Coverage Δ
Source/Bricks/Image/ImageBrick.swift 78.26% <100%> (ø)
Source/ViewControllers/BrickViewController.swift 83.6% <100%> (ø)
Source/Cells/BrickCell.swift 97.84% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a78005e...5c894ab. Read the comment docs.

}
}

override open func willDisplay() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see if "apply(layoutAttributes" would do the trick instead. Then you don't rely on a delegate

cell = brickViewController.brickCollectionView.cellForItem(at: IndexPath(item: 0, section: 1)) as? DummyBrickCell
XCTAssertEqualWithAccuracy(cell?.frame.width ?? 0, width / 5, accuracy: 0.1)
XCTAssertEqualWithAccuracy(cell?.frame.height ?? 0 , (width / 5) * 2, accuracy: 0.1)
XCTAssertTrue(cell.didCallUpdateContent)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a test to verify that the image has the correct width as that's the issue. We could make a subclass of ImageBrick to verify this...

@jay18001
Copy link
Contributor

This functionally was done with #161

@jay18001 jay18001 closed this Jul 19, 2017
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.

4 participants