@@ -178,14 +178,18 @@ class PermissionsGuideViewController: OnboardingViewController {
178178 headerTitle. translatesAutoresizingMaskIntoConstraints = false
179179 headerTopConstraint = headerTitle. topAnchor. constraint ( equalTo: headerImage. bottomAnchor,
180180 constant: Metrics . headerTopPaddingNarrow)
181+ headerTopConstraint? . priority = . defaultHigh
181182 headerTopConstraint? . isActive = true
183+
182184 headerTitle. textColor = ArduinoColorPalette . goldPalette. tint400
183185 headerTitle. font = ArduinoTypography . boldFont ( forSize: 28 )
184186 headerTitle. textAlignment = . center
185187 headerTitle. text = String . permissionsGuideWelcomeTitle. localizedUppercase
186188 headerTitle. numberOfLines = 0
187189 headerTitle. leadingAnchor. constraint ( equalTo: wrappingView. readableContentGuide. leadingAnchor) . isActive = true
188190 headerTitle. trailingAnchor. constraint ( equalTo: wrappingView. readableContentGuide. trailingAnchor) . isActive = true
191+ headerTitle. topAnchor. constraint ( greaterThanOrEqualToSystemSpacingBelow: headerImage. bottomAnchor,
192+ multiplier: 1 ) . isActive = true
189193
190194 // Shared label config.
191195 [ initialMessage, finalMessage, notificationsMessage, microphoneMessage, cameraMessage,
@@ -233,11 +237,15 @@ class PermissionsGuideViewController: OnboardingViewController {
233237
234238 // Shared button config.
235239 [ startButton, completeButton, continueButton] . forEach {
240+ $0. contentEdgeInsets = UIEdgeInsets ( top: 0 ,
241+ left: Metrics . buttonHeight/ 2.0 ,
242+ bottom: 0 ,
243+ right: Metrics . buttonHeight/ 2.0 )
236244 wrappingView. addSubview ( $0)
237245 $0. translatesAutoresizingMaskIntoConstraints = false
238246 $0. centerXAnchor. constraint ( equalTo: wrappingView. centerXAnchor) . isActive = true
239247 $0. heightAnchor. constraint ( equalToConstant: Metrics . buttonHeight) . isActive = true
240- $0. widthAnchor. constraint ( equalToConstant : Metrics . buttonWidth) . isActive = true
248+ $0. widthAnchor. constraint ( greaterThanOrEqualToConstant : Metrics . buttonWidth) . isActive = true
241249 $0. setBackgroundImage ( UIImage ( named: " rounded_button_background " ) , for: . normal)
242250 $0. titleLabel? . font = ArduinoTypography . boldFont ( forSize: 16 )
243251 $0. setTitleColor ( view. backgroundColor, for: . normal)
@@ -270,14 +278,19 @@ class PermissionsGuideViewController: OnboardingViewController {
270278 continueTopConstraint =
271279 continueButton. topAnchor. constraint ( equalTo: notificationsMessage. bottomAnchor,
272280 constant: Metrics . buttonSpacing)
281+ continueTopConstraint? . priority = . defaultHigh- 1
273282 continueTopConstraint? . isActive = true
274283
284+ startButton. topAnchor. constraint ( greaterThanOrEqualToSystemSpacingBelow: initialMessage. bottomAnchor,
285+ multiplier: 1 ) . isActive = true
286+
275287 // Step counter
276288 configureStepsImageView ( )
277289 }
278290
279291 private func configureArduinoLogo( ) {
280292 logoImageView. translatesAutoresizingMaskIntoConstraints = false
293+ logoImageView. contentMode = . scaleAspectFit
281294 wrappingView. addSubview ( logoImageView)
282295 logoImageView. centerXAnchor. constraint ( equalTo: wrappingView. centerXAnchor) . isActive = true
283296 logoImageView. bottomAnchor. constraint ( equalTo: wrappingView. safeAreaLayoutGuide. bottomAnchor,
@@ -317,10 +330,13 @@ class PermissionsGuideViewController: OnboardingViewController {
317330 private func configureStepsImageView( ) {
318331 stepsImageView. isHidden = true
319332 stepsImageView. translatesAutoresizingMaskIntoConstraints = false
333+ stepsImageView. setContentCompressionResistancePriority ( . required, for: . vertical)
320334 wrappingView. addSubview ( stepsImageView)
321335 stepsImageView. centerXAnchor. constraint ( equalTo: wrappingView. centerXAnchor) . isActive = true
322336 stepsImageView. bottomAnchor. constraint ( equalTo: wrappingView. safeAreaLayoutGuide. bottomAnchor,
323337 constant: - Metrics. arduinoLogoBottomPadding) . isActive = true
338+ stepsImageView. topAnchor. constraint ( greaterThanOrEqualToSystemSpacingBelow: continueButton. bottomAnchor,
339+ multiplier: 1.0 ) . isActive = true
324340 }
325341
326342 // Updates constraints for labels. Used in rotation to ensure the best fit for various screen
@@ -558,6 +574,7 @@ class PermissionsGuideViewController: OnboardingViewController {
558574 continueTopConstraint? . isActive = false
559575 continueTopConstraint = continueButton. topAnchor. constraint ( equalTo: label. bottomAnchor,
560576 constant: Metrics . buttonSpacing)
577+ continueTopConstraint? . priority = . defaultHigh- 1
561578 continueTopConstraint? . isActive = true
562579 continueButton. layoutIfNeeded ( )
563580 }
0 commit comments