Deprecated UITextAlignment enumeration in favor of NSTextAlignment in iOS6

When compiling my application for iOS6, I get the following failure message:

From iOS 6 and later, the UITextAlignmentCenter is deprecated. Use NSTextAlignmentCenter instead.

A simple fix, I thought, but it seems that NSTextAlignment is available in iOS 6.0 and later, and I also still want to support iOS 5. What is the best solution to this problem?

Should I check which iOS user is running and then use NSTextAlignment or UITextAlignment based on this?

+4
source share
1 answer

Outdated means exactly this - to leave it in the future. If it were me, I would wait until your application is iOS6 or newer (I assume that you will do it next year). It is highly unlikely that Apple will remove it before Xcode ceases to support the previous release that it needs.

+8
source

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


All Articles