Skip to main content

Apple announces new Xcode, ‘Swift’ programming language

iOS Simulator Screen shot 2 Jun 2014 19.46.26

Apple has introduced a brand new programming language alongside a brand new version of Xcode.

Swift is a big deal for developers. The language includes loads of features third-party developers have been asking for. It sits alongside Objective-C and C, meaning developers can interchange between languages in the same project.

Swift includes type inference, generics and multiple return types and much much more. Swift will enable Apple developers to create new games without worrying about Objective-C cruft that has built up over the last decade.

The new language integrates with a new development feature of Xcode, called ‘Playgrounds’. Playgrounds is a testing ground that renders developer code in realtime. Developers can jump in and out of game time, for example, whilst typing.

Apple claims Swift brings all of these new realtime development features without bearing any additional cost. In many ways, Swift acts like a modern JavaScript language but runs natively on the device. Developers can start submitting apps written in Swift from day 1 of iOS 8’s and Yosemite’s public release.

FTC: We use income earning auto affiliate links. More.

You’re reading 9to5Mac — experts who break news about Apple and its surrounding ecosystem, day after day. Be sure to check out our homepage for all the latest news, and follow 9to5Mac on Twitter, Facebook, and LinkedIn to stay in the loop. Don’t know where to start? Check out our exclusive stories, reviews, how-tos, and subscribe to our YouTube channel

Comments

  1. Sven Lücke - 10 years ago

    I wonder what the parrallels to http://swift-lang.org/ are. Even the logo looks quite alike

    • Untitled (@Untitled_007) - 10 years ago

      It isn’t available anymore. Coincidence? I think not.

      • proch - 10 years ago

        It’s a coincidence (the name). It’s not a coincidence the server fault: after the keynote the world is coming there. Its a parallel framework used by scientist in general, and bioinformaticians like me, in particular.

  2. Untitled (@Untitled_007) - 10 years ago

    I don’t know if I should be thrilled or pissed. I am a teenage developer who has been learning objective-C for a month (well I tried a few month before and gave up and picked it up after the last exam). And I borrowed a few books to learn about it and paid a online course to learn Objective-C. Now apple is releasing a new language. I was like ..seriously..? I just learnt a part of it and there is a new one???????????

    • rosstex - 10 years ago

      Objective-C isn’t going anywhere, you don’t need Swift if you don’t want it.

    • Christoph Schüpfer - 10 years ago

      Well it isn’t like Objective-C will become obsolete. On top of that, as a programmer myself i can tell you: You will never learn a programming language for nothing ;).

      • Colin McGraw - 10 years ago

        Objective-C was obsolete 10 years ago! It was just your only option for iOS development till now.

        Anyway, the high-schooler should definitely be learning Swift, IMO: investing heavily in a programming language based on C is probably not the best move for the future.

        That said, I’m sure the iOS APIs are identical between Objective-C and Swift even if the language is newer, so the time spent learning Objective-C/iPhone development won’t be totally wasted (and a month isn’t a lot of time lost anyway).

    • Tallest Skil - 10 years ago

      Did you watch the keynote? Swift is “Objective-C without the C”. It builds on O-C principles without the archaic C language underpinnings.

      There’s a book in the iBooks Store regarding it. Check it out.

    • Vegas Guy - 10 years ago

      Welcome to your life as a software developer….

    • Be happy. Swift if for your generation. We geezers toggled switches on consoles. Now you young whipper snappers can fly ….

    • joshua kenzie (@psjak) - 10 years ago

      I am in a similar situation however, objective-c is still supported alongside swift and knowledge of objective-c seems necessary to use swift… so many it wasn’t a waste of time after all!

    • You will be OK. They say Swift is Objective-C without the C part.
      I was getting pissed too, then it seems we are still going in the same path. Besides, you can still use Objective-C in XCode together with Swift; a good way to become more familiar with it.

      • Untitled (@Untitled_007) - 10 years ago

        hey mate, there is an upside for us. At least there will be no job title like “programmer with swift 10 years + experience” HAHAHAHA

      • rogerrodgers - 10 years ago

        Don’t piss on yourself too much, whiny baby.

      • Jan Krynicky - 10 years ago

        Don’t worry Untitled_007, there will be. Within a year Indians will catch up and include ten years of experience with Swift. They always do.

    • Brennan Holzer - 10 years ago

      You’ll be better off getting in on Swift from day 1. It will put you on a more level playing field in a way. Blessing in disguise, maybe?

    • jesse (@jesse_des) - 10 years ago

      You can still write your apps in objective-c but now there is even more you can do. Just write some objective-c code and if you have the time check out if it can be done more efficient or convenient in Swift.

    • rogerrodgers - 10 years ago

      Quit whining, if you don’t like to learn new things, perhaps coding is not your thing, loser.

    • Edward Anthony - 10 years ago

      Dude please,
      The world has to go forward, it’s not gonna wait for you.

    • Sven Lücke - 10 years ago

      It’s never a bad thing to learn new stuff. Some say a good developer learns at least one new programming language per year and I think that might be a little bit low. And if you are already familiar with JS, Ruby or Haskell you will feel quite familiar with many aspects of Swift

    • Justin Kemmerer - 10 years ago

      If you plan on being a developer get used to it. It’s extremely rare for a good programmer to know only one language.

    • Leif Paul Ashley - 10 years ago

      Honestly, if you’re going to be a software dev, learning a new language will be common. Learning new libraries is what’s burns most of your time.

    • Jan Krynicky - 10 years ago

      Welcome to real life!

    • Marcel Brown - 10 years ago

      In the grand scheme of things, one month is nothing. But the really important things you have learned or will learn from Objective-C (or any object-oriented language) are the underlying concepts. You will find that the syntax of any particular language is usually the quickest thing you will pick up. The fundamental concepts of programming are what are really important.

  3. Christoph Schüpfer - 10 years ago

    I’m so happy to see this. Could never get into Objective-C. This Bracket in Bracket in Bracket thing drove me crazy. But i will give Swift a chance :)

    • bojennett - 10 years ago

      I know other people who felt this way, but frankly, I don’t understand why this was so hard for people to grasp, compared to thing arrow thing arrow thing arrow thing. I mean, it’s the same problem just different syntax. I could see it as being a problem if you decided to do development without using the XCode IDE, for example, but seriously that’s the only real problem with it.

      Once I figured it out, I have no problem going between this mechanism for object element finding and C++/PHP/Perl/etc. It’s just a different way of saying the same thing.

      But, hey, the only constant is change. Perhaps it was time.

  4. Tyler (@ClownVommit) - 10 years ago

    I’m excited, it looks way easier than Objective C and Cocoa.

  5. lhwagner - 10 years ago

    Looks like this Forth development system, first released in 1997 (and trademarked): http://www.forth.com/swiftforth/

  6. Neal Dreher - 10 years ago

    Yea where is it in iBooks? Maybe I’m not searching for the right keywords???

  7. Nathan (@ZalemNathan) - 10 years ago

    can’t find the book in iStore…anyone know the link?

  8. bojennett - 10 years ago

    I personally don’t get it. The thing i *liked* about Objective-C was that it was “C”. I have written apps that use SQLite, and I could just link right into it. No need for learning some new framework that was SQLite for some new language. C#, for example, requires you use a C# inspired SQlite. Documentation was not as easily available for the C# version as it is for the ubiquitous C version.

    In the grand scheme of things, I don’t really use older, native C libraries, but the idea that I could just plop in C-code whenever I wanted and C libraries whenever i wanted was great to me.

    I simply have no idea why this would be “better”.

    But, I guess if you are a 20 year old now who started programming 5 years ago using some of the new scripting languages, this makes sense. As much as I would like to think that “real programmers should learn C”, I dont’ want to sound like the luddites who still are mad at compilers because everybody should be coding in assembly language.

    “The only constant is change”, right?

    • Marcel Brown - 10 years ago

      It sounds like you’ll be able to continue using Obj-C and C alongside Swift. So best of both worlds, it sounds like.

      • bojennett - 10 years ago

        Yeah, that’s what I need to figure out. I don’t quite see how I can mix and match C-code in the same source code file as swift as they are so different. It “looks” like the C-code would have to be isolated into its own “.h/.cpp”.

        If i can mix and match the way I could mix and match Objective-C 1.0 and 2.0, great – I can still do things the way I used to, but now slowly start taking advantage of “@syntheize” for example.

        Time will tell.

  9. drtyrell969 - 10 years ago

    God let’s hope the debacle that is Objective-C has numbered days.

    • bojennett - 10 years ago

      That’s a religious statement. The facts say otherwise. Lots of incredible apps have been written using Objective-C. I mean, if it was all about the languages, shouldn’t everybody have moved to Android apps by now? I mean, Java is “so much better” of a way of doing things over that idiotic “C” and its derivatives, right?

      Wrong.

      The language was fine. It took some initial getting used to, but once you figure it out, it is actually quite clean and nice. Especially if you compare it to some of the monstrosities added to C++, like templates.

      The language syntax is but one of many issues with doing development. And I dont’ think it’s been some boat anchor keeping people from writing apps… it isn’t like people were “I just want to write a cool app, but Objective-C is so hard and unwieldly”.

  10. thejonty - 10 years ago

    What’s the best way to learn a new language like Swift? I only currently do web programming (in my spare time) – HTML/CSS and a bit of javascript, but I want to venture into app development for iPhone/iPad and so learning Swift would seem like a good way to go.

    • Jeremy Kates (@jkates1) - 10 years ago

      Learn the underlying principles of OOP. Once you understand the underlying fundamentals of OOP, you can learn any OOP language (and their quirks).

  11. Patrick (@Wpcrumbley1) - 10 years ago

    Im not a developer so pardon my ignorance, but will swift do anything for people that write apps for iOS and android. As far as can people use swift to write android apps? if not will this be a game changer as far as less people writing android apps?

Author

Avatar for Benjamin Mayo Benjamin Mayo

Benjamin develops iOS apps professionally and covers Apple news and rumors for 9to5Mac. Listen to Benjamin, every week, on the Happy Hour podcast. Check out his personal blog. Message Benjamin over email or Twitter.