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

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.)

Related

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.

How to initialize a CKSubscription in iOS 10.3

I am building an app that needs to subscribe to record changes in the public database of iCloud. Now, after watching the apple video's and reading their documentation, I decided to get to work. However, I immediately got stuck here:
All initialization methods on a CKSubScription are deprecated. This can be seen here, but meanwhile apple still seems to use the very same methods in their documentation here.
This left me surprised. Looking around on the web and SO, there doesn't seem too be much information or any tutorials available (at least, none with up to date info on initializing subscriptions), probably because this technology is relatively new and these changes are recent. I have very superficial experience with CloudKit, so I'd rather ask for a decent way to do this than to improvise something myself. My question is:
How to initialize a CKSubscription?
Obviously, if the entire idea of subscriptions is outdated I am open to any answer that will result in my app receiving pushes when records of specific types appear in my public database.
Seems like CKSubscription is really more or less deprecated.
According to http://iosdevetips.blogspot.de/2016/06/deprecated-apis-in-ios-10.html you should use CKRecordZoneSubscription and CKQuerySubscription now.
Update:
Like Trevis pointed out, the docs are not really helpful here, but at least Xcode shows a somewhat helpful Warning:
If you are looking for a new class to substitute Apple's own documentation, use CKQuerySubscription in place of CKSubscription. They have almost identical initializers.

Tackling deprecation of viewWillAppear in later versions of 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

Documentation of linphone (open source sip library) for iphone

Can anybody help me to find the developers documentation of linphone for iOS.
I want to understand the architecture and functionality of the project.
Thanks in advance.
I am afraid that apart from http://www.linphone.org/eng/documentation/ (that you've supposedly seen already) there is no documentation on this project. You will need to read the source code if you need more information about the architecture/etc. Since open source projects are developed very often in the author's spare time, it is quite common that they concentrate on the actual code writing instead of drawing architectural diagrams and design documents.
If you need a SIP stack for iOS I would recommend you to have a look at pjsip. It is definitely a more mature project with extensive documentation on every level.
All you need is google the function you want to check, and then there will be many documentation links. Those documentation may be different because of different versions. I think it is enough for you.
For example:
http://fossies.org/dox/linphone-3.5.2/index.html

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