diff --git a/Tusker.xcodeproj/project.pbxproj b/Tusker.xcodeproj/project.pbxproj index c6a27eb7..92f4d36c 100644 --- a/Tusker.xcodeproj/project.pbxproj +++ b/Tusker.xcodeproj/project.pbxproj @@ -1616,7 +1616,7 @@ TargetAttributes = { D6D4DDCB212518A000E1C4BB = { CreatedOnToolsVersion = 10.0; - LastSwiftMigration = 1200; + LastSwiftMigration = 1410; }; D6D4DDDF212518A200E1C4BB = { CreatedOnToolsVersion = 10.0; diff --git a/Tusker/Screens/Profile/ProfileHeaderCollectionViewCell.swift b/Tusker/Screens/Profile/ProfileHeaderCollectionViewCell.swift index e2ba1e71..c4c9d234 100644 --- a/Tusker/Screens/Profile/ProfileHeaderCollectionViewCell.swift +++ b/Tusker/Screens/Profile/ProfileHeaderCollectionViewCell.swift @@ -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)