Storyboard warning : First baseline layout attribute before iOS 8.0
Asked Answered
C

1

5

I can't figure out how to get rid of this warning, I'm using a storyboard with many viewControllers (with labels, textfields and a lot of constraints ) all of them have been created almost the same way.

enter image description here

When I click on the warning it highlights a UILabel inside a scrollView :

enter image description here

This scrollView has many UILabels with constraints, I tried everything I could find on so including : Attribute Unavailable: First baseline layout attribute on iOS versions prior to 8.0

This Warning doesn't cause my app to crash,I've tried on the simulator and an iPhone 4 (ios 7.1.2). But I'm worried about the AppStore approval.

Centralization answered 10/12, 2015 at 16:34 Comment(0)
K
7

I think the issue is you have many constraints that are using NSLayoutAttributeFirstBaseline and when you click on the warning Xcode is pointing to wrong constraint.

To identify the constraints search in Xcode with "firstBaseline". Change all constraints that are using NSLayoutAttributeFirstBaseline.

enter image description here

Note: You may need to adjust your views. In my case NSLayoutAttributeBaseline worked well.

NSLayoutAttributeFirstBaseline
The object’s baseline. For objects with more than one line of text, this is the baseline for the topmost line of text. The object’s baseline. For objects with more than one line of text, this is the baseline for the topmost line of text. Available in iOS 8.0 and later.

NSLayoutAttributeBaseline
The object’s baseline. The object’s baseline. Available in iOS 6.0 and later.

Kancler answered 11/2, 2016 at 5:32 Comment(3)
Perfect thanks a lot, (I have to wait another 8h to give you the bounty award)Centralization
Thanks. Actually waiting is good. It means more people will see this question and more chance of getting an up-vote ;)Kancler
Brilliant answer. But just want to add that where to search is "Document outline" not the xcode itself.Adamec

© 2022 - 2024 — McMap. All rights reserved.