Will Objective-C deprecated for existing application in future?

We have an application which was developed before 3 years ago in Objective-C language. But now we want to update the application with some features and UI changes. As we are observing that programing language Swift 3.0 and Swift 4.0 looks like a very stable now. So, our question is that how long apple will support Objective-C and what are the chances that apple will stop support Objective-C for existing project? Should we move further to update current application with Objective-C language?

Replies

No one can give you a definitive answer to this. The folks outside of Apple are limited to what Apple has publicly announced, and the folks within Apple can’t speculate about the future.

My recommendation is that you use Swift if and when it suits your needs. I personally use Swift for all my day-to-day work, but my requirements are not the same as your requirements.

Also, keep in mind that Swift is not an all-or-nothing proposition. Interoperability between Swift and Objective-C is very good, so it’s perfectly reasonable for you to use Swift for parts of your app while the bulk of it remains in Objective-C.

ps This question has come up before here on DevForums and the responses on that thread are pretty interesting.

Share and Enjoy

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

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

>>what are the chances that apple will stop support Objective-C for existing project?


Basically, 0%.


The Swift compiler is written in C++, and is compiled using the same 'clang' compiler that you use for Objective-C. ('clang' supports C, C++, Obj-C and Obj-C++.) There is no plan to re-write Swift in Swift, ever. Apple needs clang basically forever, which means you get Obj-C basically forever.


Of course, I don't speak for Apple, but any other outcome would be madness.


>> Should we move further to update current application with Objective-C language?


Yes. I would strongly discourage you from trying to rewrite it in Swift, until after you've finished at least one significant new Cocoa project in Swift. The cognitive load of translating and learning simultaneously is really, really big.

Thanks for the reply.

But what about third party frameworks of Objective-C used in the project?

But what about third party frameworks of Objective-C used in the project?

I’m not sure I understand this question properly, so please let me know if I misinterpreted you.

I believe you’re asking whether it’s OK to use third-party Swift frameworks in your Objective-C project. Again, that’s a decision that you’re going to have to make, trading off the wealth of cool functionality available in Swift frameworks against the potential pitfalls of managing two languages.

I can, however, speak to the technical aspects of this. A lot of this ground is covered in the official documentation, most notably Using Swift with Cocoa and Objective-C, but here’s a quick summary:

  • Using third-party Objective-C frameworks from Swift is very much like interacting with system frameworks [1], that is, it works very smoothly. If you have a third-party Objective-C framework there should be no problem using it in a Swift app, or indeed in Swift framework code.

  • The reverse in not always as smooth. There are certain Swift features that Objective-C is not able to access. For example:

    • Swift value types (structs and enums) are not visible to Objective-C code

    • Objective-C code can use Swift classes, but it can’t subclass them

    So, if you want to call your Swift code from Objective-C, you have to write that code with those limitations in mind.

Share and Enjoy

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

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

[1] There are a few small differences, but they’re relatively obscure.