Skip to content
This repository has been archived by the owner on Jan 17, 2019. It is now read-only.

Calculate parent component’s view size up-front when creating children #100

Merged

Conversation

JohnSundell
Copy link
Contributor

This patch fixes a bug where child components would get a CGSizeZero container view size, if created before their parent component was resized by UICollectionView. This is done by using layout attributes directly when computing the container view size for root body components.

This lookup is very fast (O(1)), since we cache the layout attributes by index path.

JohnSundell and others added 2 commits October 25, 2016 15:56
This patch fixes a bug where child components would get a `CGSizeZero`
container view size, if created before their parent component was resized
by `UICollectionView`. This is done by using layout attributes directly
when computing the container view size for root body components.

This lookup is very fast (`O(1)`), since we cache the layout attributes
by index path.
@JohnSundell
Copy link
Contributor Author

@spotify/objc-dev

Copy link
Contributor

@krris krris left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@codecov-io
Copy link

codecov-io commented Oct 25, 2016

Current coverage is 92.82% (diff: 85.71%)

Merging #100 into master will decrease coverage by 0.01%

@@             master       #100   diff @@
==========================================
  Files            57         57          
  Lines          4021       4027     +6   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           3733       3738     +5   
- Misses          288        289     +1   
  Partials          0          0          

Powered by Codecov. Last update d7eab34...9d9254b

@JohnSundell JohnSundell merged commit 9b01f01 into spotify:master Oct 25, 2016
@JohnSundell JohnSundell deleted the fix-initial-child-component-frame branch October 25, 2016 14:09
kant added a commit to kant/HubFramework that referenced this pull request Mar 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants