Are all iOS APIs in swift... also available in obj c

I am returning to app development after 4 years and I want to know if all iOS apis that are in swift also available in obj c or has apple gone swift specific now? I came across an Api that doesn’t load the obj c version of the api. I want to know before getting in again if it could be a bug or one should expect only swift apis and learn swift inadvertently.


Neerav

Accepted Reply

I asked:

"More to the point, what is your question?"

You answered:

"So objective c is still default supported except for APIs that concern only swift language & language Features."


I'm not sure there is a question there. Objective C is still supported and will most likely be supported for many years to come. Many new 'how to do that' code descriptions are written only in Swift as you have just discovered.

Replies

Yes. I see the first snippet in obj c and second in swift inspite of selecting obj c.

Any insight? I have filed a bug report

I suspect that showing code snipets only in Swift is a feature not a bug.


I have never heard a reasonable explanation for why Apple decided to 'improve' Objective C with what is really a line-for-line equivalent language and thereby split their programming base in half.

Yes. I see the first snippet in obj c and second in swift inspite of selecting obj c.

OK, that’s expected behaviour. The core reference library pages will honour the Objective-C / Swift popup — for example, this works on the documentation page for the

+isHealthDataAvailable
method — but code snippets in articles, which is the type of page you referenced, generally do not.

Frankly, I encourage Objective-C developers to get a basic reading understanding of Swift and vice versa. You don’t have to become an expert in both languages, but there’s a lot of good stuff out there in the ‘other’ language and it’s as shame to miss out on that.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

"I suspect that showing code snipets only in Swift is a feature not a bug."



PBK. how can it be? i want to implement the Transcation Observer & Payment Queue in my app to enable inapp purchase. how do i begin an app with inapp purchase capabilities with the code to do so in swift only?


My guess is trying and figuring out the objc code equivalent for the snippet. how are other developers doing it?

Because IAP predates Swift there will be lots of Objective C code samples for you to follow - search for it. Or write it yourself.


Apple is using their influence to move programmers to Swift. Big mistake IMHO.