Storyboard warning: attribute of the first base layout before iOS 8.0

I can’t figure out how to get rid of this warning, I use a storyboard with many viewControllers (with shortcuts, text fields and lots of restrictions), they are all created in much the same way.

enter image description here

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

enter image description here

There are many limited UILabels in this scrollView, I tried everything I could find, including: Unavailable attribute: The first attribute of the baseline layout in iOS versions prior to 8.0

This warning does not crash my application, I tried the simulator and iPhone 4 (ios 7.1.2). But I'm worried about approving the AppStore.

+5
source share
1 answer

I think the problem is that you have a lot of restrictions that use NSLayoutAttributeFirstBaseline , and when you click on the warning, Xcode indicates an invalid restriction.

To define a constraint search in Xcode using "firstBaseline". Change all restrictions that are used by NSLayoutAttributeFirstBaseline .

enter image description here

Note. You may need to customize your views. In my case, NSLayoutAttributeBaseline worked well.

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

NSLayoutAttributeBaseline
Source object. Source object. Available in iOS 6.0 and later.

+7
source

Source: https://habr.com/ru/post/1237859/


All Articles