ElaWorkshop / TagListView

Simple and highly customizable iOS tag list view, in Swift.
MIT License
2.64k stars 492 forks source link

Intrinsic Content Size returning wrong size #105

Closed skeithtan closed 7 years ago

skeithtan commented 7 years ago

The TagListView wouldn't properly fit on my Table View Cell, so I've printed the intrinsic content size instead, and found that it was giving wrong values. I modified the TagListView.swift file only to make the row variable public, it seems to think I have 2 rows when I really have three.

The intrinsic content size returns the right values eventually upon modifying the tag list view or rotating the device. I've tried invalidateIntrinsicContentSize() and layoutSubviews(), and none of them helped get me the right intrinsic content size at table view load.

EDIT: It seems as though the source of the problem is from the frame.width. The TagListView frame width returns a wider value than it really is, which is why there are only 2 rows when there should be three.

EDIT 2: Might have been an Apple bug as it thinks the frame's width is wrong. Fixed it by re-applying the same constraints on the Tag List View.