Tackling deprecation of viewWillAppear in later versions of iOS - ios

soon I found out that viewWillAppear has been deprecated since iOS 6. I am pretty upset because
it was used in all the tutorials that I learned from. So what should I do now when I want to develop apps for later versions and when I want to call this method. Is there some kind of substitution for it?
Thanks

Is NOT depracated as you can see in Apple doc here. Maybe you are talking about viewDidUnload. Apple changed the view controllers lifecycle and is not needed anymore. If you want to relese memory during memory warning you can still use the method -didReceiveMemoryWarning

Related

Does Apple provide a way to determine why a specific code is deprecated?

I'm currently maintaining legacy code project that requires me to resolve deprecation warnings for outdated iOS versions. Looking through documentation as well as Xcode warnings, I'm able to determine which methods are deprecated and recommendations on which methods should be used to replace deprecated code.
Out of curiosity, is there a way we can determine why a specific code was deprecated? Is there a system design explanation that tells us devs why this deprecation was needed? Thanks in advance.
There isn't anything built into the documentation. But by looking at the header and the replacement, and/or by watching the relevant WWDC video, you can usually get the point. (I've certainly never had any difficulty with this.)

What does it mean an Apple implementation is deprecated while still being able to use it. Reasons not to use it?

I'm using GLKit's GLKView in one of my projects. As per Apple's documentation it is deprecated. I can still use it in my app and it is fully functional (for what I want it to do) with latest iOS versions. I'm using it because of an older SDK that I'm using has good functionality for it. What are reasons not to use it anymore?
If something is deprecated, that means they may remove it in future versions. If you continue to use it, your code may break next time you update the library.
They left it in despite being deprecated to give you an opportunity to switch to a new solution.
A function being deprecated means that it is still supported for now, but they are planning on deleting it. Often times this is because there is other better ways to achieve the same. A reason to not use it anymore is because it will very probably be deleted eventually.
You can use it now,but maybe can't in the future.Such as UIWebView just like Apple said:
Apple will stop accepting submissions of apps that use UIWebView APIs.
It's the same.

What does "deprecated" really mean in iOS

In iOS development, deprecated methods can be used until they are "removed".
I understand deprecated methods are not suggested to be used but does that mean they might not work properly or can cause fatal problem?
What are deprecated methods:
Deprecated methods or classes that are outdated one which will eventually be removed.
Apple deprecates some methods/ classes, when they introduce a superior replacement, usually because they want to take advantage of new hardware, OS or language features (e.g. blocks) that were’t around when the original method was conceived.
When a deprecated method will be removed:
It depends according to the severity of method/property. For example:
cell.textColor
This property has been deprecated since iOS 3.0 and we can still use it. So unfortunately there's no any tight deadline of removing the stuff being deprecated.

Best way to implement UIPopoverView on iPhone?

It's available on iPad, but unfortunately not on iPhone. I want to use a service such as this to display some options to the user without summoning a new viewcontroller, and I'm curious what the best library/way to do this is.
I found this one: https://github.com/runway20/PopoverView
Which seems fantastic, but it is a little outdated, and hasn't been updated for iOS 6 (gives a lot of warnings in regards to deprecated methods being used).

iPhone - When does a deprecated method usually becomes obsolete?

I'm using some methods in some apps that are now marked as deprecated since iOS5. I'd like to know when these updates will become urgent.
So, usually, when does a deprecated method becomes obsolete ? Is there a chance that this will be with iOS 5.1 ? Or is this always with a major version like iOS 6.0 ?
This depends and changes from method to method and property to property. If you look at something like the
cell.textColor
it has been deprecated since iOS 3.0 and can still be used. So unfortunately there's not a specific answer to the general thing about stuff being deprecated.
As far as I know, no published API has actually been removed from iOS yet, but that's no reason to be complacent. There's no reason to keep using deprecated methods as long as the replacement is available in all the versions of iOS that you need to support.
As for when they'll actually be removed, that's entirely speculation. Keep an eye on the release notes for new versions as they become available. My guess is that they'd only remove them in a major release but there are no guarantees...
For the most part, its in Apple's favor to keep backward-compatibility with older apps.
So when they finally do cut something out, it will be because maintaining it has gotten too expensive or because maintaining it would make adding some new feature difficult or impossible. (And that reasoning might include cutting deprecated code out because the system is getting too big to fit into the device.)
A better reason to avoid using deprecated methods is the app approval process. Apple may require new submissions to avoid deprecated code well in advance of actually cutting out that code.

Resources