Workaround for profile header changing size when statuses are loaded in the background

Closes #250
This commit is contained in:
Shadowfacts 2022-11-20 13:57:51 -05:00
parent c8375b742a
commit 001a73af3c
2 changed files with 8 additions and 1 deletions

View File

@ -1616,7 +1616,7 @@
TargetAttributes = {
D6D4DDCB212518A000E1C4BB = {
CreatedOnToolsVersion = 10.0;
LastSwiftMigration = 1200;
LastSwiftMigration = 1410;
};
D6D4DDDF212518A200E1C4BB = {
CreatedOnToolsVersion = 10.0;

View File

@ -61,6 +61,13 @@ class ProfileHeaderCollectionViewCell: UICollectionViewCell {
}
}
// overrides an internal method
// when the super impl is used, preferredLayoutAttributesFitting(_:) isn't called while the view is offscreen (i.e., window == nil)
// and so the collection view imposes a height of 44pts which breaks the layout
@objc func _preferredLayoutAttributesFittingAttributes(_ attributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes {
return preferredLayoutAttributesFitting(attributes)
}
enum State {
case unloaded
case placeholder(heightConstraint: NSLayoutConstraint)