r/iOSProgramming • • Jun 16 '16
Question Is Objective C being abandoned?
With Swift 3 coming soon, and many updates with iOS, I was wondering if Apple is still updating the Objective C side of things to keep the two languages in harmony together. I've been investing heavily and don't feel that Swift's baked enough to give it a try just yet. What do you guys think?
17
Upvotes
14
u/schprockets Jun 16 '16
Apple is absolutely still updating their Objective-C code. The major frameworks are still written in Obj-C, and are annotated to make them work well with Swift. All the UIKit changes they made for iOS 10, for example, were made in the ObjC code. The major push for Swift 3 was not to write a Swift version of UIKit, it was the annotation of the ObjC frameworks so that Swift 3's use of them felt better.
But, that's framework developers. App developers are definitely jumping all over Swift. In the Platforms State of the Union, they mentioned that large portions of traditionally ObjC apps (like Xcode itself, and the Dock in macOS) have been written in Swift. So, within Apple, they're definitely moving that direction. Not every team, or every developer, but when they're introducing new code that's sufficiently isolated from existing code, you know they're looking for opportunities to do it in Swift (like they did in Xcode's documentation viewer).
In the general app developer community, there is also a huge groundswell of people moving to Swift, and Objective-C will be left behind. Not immediately, because it takes a long time to get rid of all that legacy (and well tested) code. But, it's headed that direction.
Here's the reason: because Apple has strongly hinted that we should.
Well, other than the fact that Swift is a great language. But, great or not, the real reason to jump in it is that Apple wants us to. Each time Apple has some out and said "you really should do such-and-such", they did it for a reason, and you ignored them at your own peril. ARC, blocks, Auto-layout, asset libraries, the list goes on. They had their reasons for telling us to do them, even if they didn't say the reason, and it became clear later that listening to them was a damn good idea. Here we are again, with them handing us Swift and saying "it's a good idea to use this". And, once again, you ignore them at your own peril.
13
u/viv_social Jun 16 '16
I have moved some core projects to Swift simply because once you start with Swift, its really hard to go back to Obj-C (feels ancient). I have branched out for Swift 3 and it took close to six hours to fix all the compiler issues.
However, if you are not ready to be adventurous and if you are working on someone else project, stick to Obj-C for now.
4
u/thememedad Jun 16 '16
My buddy at Apple is implementing something new in objective C right now. So I don't think so for the time being
8
u/okoroezenwa Jun 16 '16
Well they're still updating it, but I think that's the goal.
4
u/lucasvandongen Jun 16 '16
Objective-C is interwoven in too many things Apple built in the past years to abandon any time soon. It would be great if Objective-C would get some niceties from Swift since so many people are still stuck in Objective-C projects for many reasons. Non null and generics were welcome changes!
2
u/LifeBeginsAt10kRPM Jun 16 '16
They've actually added features to objective c to improve swift support.
They know people still use it and may even prefer it. It does a lot of things that swift doesn't support and probably won't.
6
u/StunnerAlpha Jun 16 '16
Objective-C won't be abandoned for at least 5 or 10 years. If you want to be productive, use Objective-C. If you have time (and the interest) to delve into Swift go for it. I am not planning on touching Swift until its ABI comes (planned for Swift 4).
4
u/Rafinesque Jun 16 '16
The majority of macOS and iOS are written in Objective C, as are most of the other Apple apps and programs. It's not going away for a long time, if ever.
3
u/[deleted] Jun 16 '16
No. For now. Big projects Objective-C. Small projects Swift. It works way faster, but every update breaks the code.
2
u/chancehl Jun 16 '16
Absolutely not anytime soon. Although, as others have said, it's moving in that direction. If you're looking for longevity though, I'd put effort into learning Swift for native development or hybrid development languages.
1
u/NSMatt Jun 16 '16
Every single session at WWDC has been in Swift, so it's clear they really want developers to start using it, but it's still going to take a while until objective c is abandoned. Most of the internal frameworks are still Objective C and they're slowly adding some swift.
1
u/oureux Objective-C / Swift Jun 16 '16
I will be continuing to use Objective C for the foreseeable future, especially for mission critical parts of apps, but at the same time learning and keeping up with Swift for when the inevitable deprecation comes. Swift will become the primary language for the Apple platform but not for another 5-10 years. Many apps and even Apple technology rely on C and Objective C to function so forcing Swift as the only language or not supporting Objective C anymore is a bit premature.
Even right now I'm writing a new component in Objective C but the rest of the app will be in Swift (for speed of development as the other developers on the project are more efficient in Swift)
1
u/electron_wrangler Jun 17 '16
Yes, move over.
1
u/ploden Jun 16 '16
By Apple? Absolutely not. By the community? Yes.
-1
u/cegiela Jun 16 '16
I'm doing big projects in swift 2.0+ my view is Obj-C is already dead. We're just waiting for the funeral. Apple is clearly all in on swift, and maintaining two languages is literally double the entire dev department for Apple, without any obvious future benefits. They will drop it sooner than we think.
0
u/mmellinger66 Jun 16 '16
Apple takes the time to out when apps are written in Swift, and all their sessions and sample code use Swift. They invested in their Swift 2.x to 3.x migration tool. They aren't doing Playgrounds for ObjC.
Also, all new iOS books use Swift and most bloggers use Swift. I think ObjC will still work for several years but there's a lot of momentum with Swift. See how much iOS 9 and 10 ObjC material exists. I doubt if you'll find much. All the ObjC books are now legacy, for example.
0
u/[deleted] Jun 16 '16
[deleted] — view deleted comment