swift - Programming for iOS 7.1, and using a UIAlertView, will this work for iOS 8.0 as well? -
I'm programming an app with Swift, and I'm targeting iOS 7.1 as the least, and I've noticed that UIAlertView has been deprecated in iOS 8.
Does this mean that I should only use UIAlertView to display a warning in my app?
Should I use some code that is running the version of iOS, and use UIAlertController for iOS 8 based on the version of iOS run, and Then UIAlertView if they are running iOS 7?
Editing: I should add that UILartView works on iOS 7 and 8, but I'm just wondering if I should just use UILartView for both, or they have an investigation And instead of running UILART, if they are on iOS 8. I know that since its use of the new API, it is best practice, so I am curious if it is only an issue to use both UILartview
You should do it in any way. It does not matter unless it works.
If your app supports many iOS versions and a certain API is only deprecated then some apps are in supported iOS versions, then there is no problem using the old API (
< P> Think like this - you have two options:- Just use
UIAlertView
for now and it works as your app because Your app supports both iOS 7 and 8. Any day, maybe next year, you Decided to leave support for iOS 7. At that time, you haveUIAlertView
withUIAlertController
. This is the only hit to make changes. - Other Update your code in the code, type the code which now checks if
UIAlertController
is available. If it is, then use it, use the otherUIAlertView
. The year you leave iOS 7 support, and then you have to remove the check for theUIAlertController
You can date and use theUIAlertView
to extract the code. So you add a lot of code now and later make a bunch of changes. It works twice for option 1 to profit.
Comments
Post a Comment