What are Non Public APIs?

4 Solutions Collect From Internet About “What are Non Public APIs?”

The non-public API refers to Apple API methods that are not documented and offered to the programmer.

Apple does not guarantee that this part of the API will work in future upgrades. They can freely change this part.

They forbid usage, so that your app won’t break in iOS updates, and so protect your future users/buyers of your app!

The webservice is external, hence does not fall under non-public. This part you need to guarantee, not Apple.

There is no difference. They both mean any iOS API that isn’t documented.

External APIs don’t count because they have nothing to do with iOS itself, so you’re safe as long as you don’t use undocumented calls in your Objective-C code.

In the evolution of iOS Apple usually starts out with having an API private until it is polished and documented enough to allow developers to use it.

There are many more methods and classes on iOS than you have headers or documentation for. for example there is a class to convert NSAttributedString to HTML, named NSHTMLWriter. This is not documented and not public but gets used internally by UITextView.

Other examples for private APIs include direct access to things like cellular network infos, low-level hardware access or something as benign as the exact battery loading percentage (the public API only returns 5% increments)

Not making an API not public allows Apple to polish it further and possibly even changing names which would break software relying on the previous naming. Apple can do that because they control all of the system software. To change something in published APIs they have to do this dance with deprecation.

The App Store Review team has a scanner app that looks through your submitted app and flags alls calls to undocumented methods and classes. There are ways to circumvent those with obfuscating method selectors, but generally you want to play nice with Apple because they don’t like it if you break the rules.

There are some very very rare examples where a private API is made public retroactively. i.e. a method already existed in iOS 5 that Apple allowed us to use even though there was no documentation for it, only a Tech Note.

In Summary: Only use classes and methods that you find documented in official Apple docs.

PS: there are methods to get the data for and from UIWebViews via official channels. A more detailed technical answer here depends entirely on what you are trying to do.

Objective C allows to use internal ( private ) methods in different ways.
What Apple asks is not to use methods from their Frameworks that are not designed to be used in the ‘client’ code.
So when you access a private method, property it’s not good.