Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #1803: Constraint runtime errors. #1736

Merged
merged 5 commits into from
Nov 8, 2019
Merged

Conversation

iccub
Copy link
Contributor

@iccub iccub commented Oct 18, 2019

Summary of Changes

This fixes some constraint problems in:

  • bvc(there's still one more runtime error I haven't managed to fix)
  • search controller
  • shields view controller

There's one error I couldn't fix, shows up when keybard is shown for the first time

This pull request fixes issue #1803

Submitter Checklist:

  • Unit Tests are updated to cover new or changed functionality
  • User-facing strings use NSLocalizableString()

Test Plan:

This is for reviewer: run the app and look at logs if there's still some constraint errors.

Screenshots:

Reviewer Checklist:

  • Issues include necessary QA labels:
    • QA/(Yes|No)
    • release-notes/(include|exclude)
    • bug / enhancement
  • Necessary security reviews have taken place.
  • Adequate unit test coverage exists to prevent regressions.
  • Adequate test plan exists for QA to validate (if applicable).
  • Issue is assigned to a milestone (should happen at merge time).

@iccub iccub force-pushed the nobug/constraint_fixes branch 3 times, most recently from a956c3d to 24965df Compare October 28, 2019 13:03
@iccub iccub requested a review from Brandon-T October 28, 2019 16:09
@iccub iccub changed the title Nobug/constraint fixes Fix #1803: Constraint runtime errors. Oct 28, 2019
@iccub iccub marked this pull request as ready for review October 28, 2019 16:13
@iccub iccub added the blocked If a ticket is blocked for some reason, if not using a sub-block label, please provide info in issue label Oct 28, 2019
override func layoutSubviews() {
super.layoutSubviews()

scrollView.snp.remakeConstraints {
Copy link
Collaborator

@Brandon-T Brandon-T Oct 31, 2019

Choose a reason for hiding this comment

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

Hmm, is there a reason we constrain the scrollView in layoutSubviews?
Just wondering if this will trigger another layout.

I tested it and it doesn't seem to trigger anything so looks good to me.

}

stackView.snp.remakeConstraints {
$0.edges.equalToSuperview()
Copy link
Collaborator

@Brandon-T Brandon-T Oct 31, 2019

Choose a reason for hiding this comment

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

This works. It will also work if constrained to the contentLayoutGuide.

IE: scrollView.frameLayoutGuide.constrain(to: self) and stackView.constrain(to: scrollView.contentLayoutGuide).

But your code works so it's fine :)

@kylehickinson
Copy link
Collaborator

@iccub Please rebase :)

@kylehickinson kylehickinson removed the blocked If a ticket is blocked for some reason, if not using a sub-block label, please provide info in issue label Nov 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants