Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Ian Rushton
Ian Rushton
15,789 Points

If I'm learning Swift 2.0, is it worth learning Objective-C?

I am currently learning Swift 2.0 with the view to ultimately creating iOS apps. Should I continue focussing on Swift or do you think it would be worthwhile me learning Objective-C?

I kinda got the impression that Objective-C was obsolete but there seem to have been courses added fairly recently.

Can anyone give me any guidance on this please?

Manuel Schulze
Manuel Schulze
12,739 Points

Hey Ian,

this depends heavily on how you want to work with iOS in the future. If you try to work as an indie developer than Swift is enough for sure. You work on your own and try to make money with your apps in the app store. If you want to work for companies or as a freelancer then you should learn Objective-C, too.

In my working experience, the recent projects are mostly done with Swift. Many companies are interested in this new language because they like its modern concepts. It's also a lot easier for new developers to learn than Objective-C. But over the last 6 months I was working quite often on older projects. Some very big companies (at least in Europe) have a lot of very expensive created apps and don't want to spend thousands of dollars to convert them to Swift and don't get new features or things that the customer sees. Most new projects are done with Swift but if you want to work for an agency or a software company you should consider, that they still have apps based on Objective-C and that's the reason why I'm glad that I know both languages.

I hope this will help you!

Have a nice day, best wishes,

Manuel

3 Answers

Martin Wildfeuer
PLUS
Martin Wildfeuer
Courses Plus Student 11,071 Points

Hey there!

IMHO that's not to easy to answer. If you had asked me that a few month ago, I would have said: you definitely have to know Objective-C. With the introduction of Swift 2.0, however, I think the time where "Swift-only" developers are born might have come. You have to consider the following:

Swift is fairly new, so most of the code out there is still written entirely or mostly in Objective-C. This is also true for 3rd party plugins and frameworks. It will still take years until companies and clients will have their code rewritten in Swift (which they might never do), so if you are looking for freelance projects, chances are you have to code a lot in Objective-C. Even if new code is written in Swift, you will have to make sure it works with "legacy" Objective-C code, thus you have to have a profound understanding of it.

Having said that, if you are doing your own or client projects from scratch, your chance to do them completely in Swift has come. With version 2.X, the most annoying bugs have been fixed and API coverage is now almost on par with Objective-C. Apple and the community are pushing to Swift, so it won't be long until new 3rd party plugins and SDKs are written in Swift only, if not already.

So ask yourself these questions:

  1. Do I want to work for clients with existing apps?
  2. Do I need 3rd party plugins or SDKs that have been around for a while?

If you answer 1 with yes, chances are you have to work on Objective-C code, because (as mentioned before) they have been around "pre-Swift. So knowing Objective-C is inevitable, even if new code will be written in Swift.

If you answer 2 with yes, that does not mean you can't write code in Swift, it just means you should know Objective-C well enough so you can read and understand the API. Swift and Objective-C work well together in one project, but you have to make sure you are bridging it the right way.

This is not the whole picture and I am sure I forgot to mention a few things, but for a start I hope that helps :)

Ian Rushton
Ian Rushton
15,789 Points

Ye that's really useful, thank you!

Do you think it would be difficult to learn Objective-C having learned Swift? I imagine most people have learned them in the opposite order.

Manuel Schulze
Manuel Schulze
12,739 Points

Well, Objective-C got a strange syntax. But there are also things in common with Swift. All the frameworks are very similar to the Swift ones and most functions are called exactly the same, just in another syntax. So I think this will be no big deal at all. It's just a little weird. But if you know who to use Swift then it will be much easier than starting with Objective-C. I would argue that it's the better way to learn the iOS languages.

Ian Rushton
Ian Rushton
15,789 Points

Thank you both.

You have both been very helpful :)