mapbox / mapbox/mapbox-navigation-ios
Fix layout constraints warnings.
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 918
- Forks
- 326
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
Multiple broken layout constraints warnings are emitted during device rotation, when presenting NavigationViewController etc.
For example:
2020-09-16 15:42:16.866985-0700 Example[33378:535029] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x60000025bd40 H:|-(8)-[UIImageView:0x7f92dc821120] (active, names: '|':MapboxNavigation.NavigationMapView:0x7f92da68d000 )>",
"<NSLayoutConstraint:0x6000002597c0 H:|-(0)-[MapboxNavigation.NavigationMapView:0x7f92da68d000] (active, names: '|':MapboxNavigation.NavigationView:0x7f92dc81c130 )>",
"<NSLayoutConstraint:0x600000259cc0 UIImageView:0x7f92dc821120.leading == MapboxNavigation.NavigationView:0x7f92dc81c130.leading + 10 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000025bd40 H:|-(8)-[UIImageView:0x7f92dc821120] (active, names: '|':MapboxNavigation.NavigationMapView:0x7f92da68d000 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
In scope of this ticket such broken constrains should be detected, UI components constrained correctly and warnings fixed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the warnings during device rotation while presenting NavigationViewController and inspect the listed active constraints, especially those involving NavigationMapView and UIImageView. Trace each constraint to the UI component that creates it, then verify that rotation and presentation complete without broken-constraint warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100