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

IOS-10266 [iOS] Header does not display correctly in initial permissions with iOS 14 #372

Merged

Conversation

DavidMarinCalleja
Copy link
Contributor

@DavidMarinCalleja DavidMarinCalleja commented Jun 5, 2024

🎟️ Jira ticket

IOS-10266 [iOS] Header does not display correctly in initial permissions with iOS 14

πŸ₯… What's the goal?

in iOS 14 the Header component is not displayed correctly, for example in the initial permissions windows.

🚧 How do we do it?

There seems to be a problem in iOS 14 when using layoutMargins as when integrating it as Header of a tableView it does not calculate the height correctly and the component is displayed incorrectly.

πŸ§ͺ How can I verify this?

iOS 14 iPhone Xr iOS 17.2 iPhone 14 Pro

πŸ‘ AppCenter build

You can use the build generating in Mistica Alpha https://install.appcenter.ms/orgs/tuenti-organization/apps/mistica-swiftui-ios/distribution_groups/public
Screenshot 2024-06-06 at 07 36 56

@@ -201,7 +201,7 @@ extension UICatalogHeaderViewController: UITableViewDataSource, UITableViewDeleg
vc.headerView.title = titleText
vc.headerView.descriptionValue = descriptionText

show(vc, sender: self)
present(vc, animated: true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Show it as modal to see it the same as in most uses (initial permissions, profile, etc..)
Simulator Screen Recording - iPhone 14 Pro (17 2) - 2024-06-05 at 16 59 11

bottomAnchor.constraint(equalTo: stackView.bottomAnchor)
stackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Constants.marginLeft),
stackView.topAnchor.constraint(equalTo: topAnchor, constant: Constants.marginTop),
stackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Constants.marginRight),
Copy link
Contributor

Choose a reason for hiding this comment

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

To avoid using negative constraints I think it's enough changing the order:

Suggested change
stackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Constants.marginRight),
trailingAnchor.constraint(equalTo: stackView.trailingAnchor, constant: Constants.marginRight),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Copy link
Contributor

@dhidalgofadrique dhidalgofadrique left a comment

Choose a reason for hiding this comment

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

Good job! πŸ‘

Copy link
Contributor

@idenjoe idenjoe left a comment

Choose a reason for hiding this comment

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

Good job and thanks!!

@DavidMarinCalleja DavidMarinCalleja merged commit c0edf11 into main Jun 6, 2024
2 checks passed
@DavidMarinCalleja DavidMarinCalleja deleted the IOS-10266-Header-does-not-display-correctly-in-iOS14 branch June 6, 2024 08:05
@tuentisre
Copy link
Collaborator

πŸŽ‰ This PR is included in version 30.1.1 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants