Fixed crash on launch on iOS 7
In #1793, I conflated the compass container’s constraints to its parent view with the compass container’s content size constraints, but only in the iOS 7 code path. The result was a crash on launch due to an unprepared view hierarchy. Fixes #1818.
This commit is contained in:
@@ -539,7 +539,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
|
||||
multiplier:1
|
||||
constant:5]];
|
||||
|
||||
[compassContainerConstraints addObject:
|
||||
[compassContainer addConstraint:
|
||||
[NSLayoutConstraint constraintWithItem:compassContainer
|
||||
attribute:NSLayoutAttributeWidth
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
@@ -548,7 +548,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
|
||||
multiplier:1
|
||||
constant:self.compassView.image.size.width]];
|
||||
|
||||
[compassContainerConstraints addObject:
|
||||
[compassContainer addConstraint:
|
||||
[NSLayoutConstraint constraintWithItem:compassContainer
|
||||
attribute:NSLayoutAttributeHeight
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
@@ -562,7 +562,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
|
||||
}
|
||||
else
|
||||
{
|
||||
[compassContainer addConstraints:compassContainerConstraints];
|
||||
[constraintParentView addConstraints:compassContainerConstraints];
|
||||
}
|
||||
|
||||
// logo bug
|
||||
|
||||
Reference in New Issue
Block a user