Apple unveils Swift, a brand new Xcode programming language for developers

Posted:
in iPhone edited February 2020
Calling it "fast, modern, safe and interactive," Apple on Monday unveiled Swift, a brand new Xcode programming language that it says is superior to Objective-C.

image


In a demonstration, Apple showed off the "Swift Playground," where developers write code and how results are displayed as soon as code is written. Apple says Swift was designed from the ground up for Cocoa and Cocoa Touch.

Swift can be used for basic apps, like social networking, or advanced 3D games using the new "Metal" graphics optimization. And because it operates alongside Objective-C, developers will be able to seamlessly interchange languages.




Included in Swift are Generics, which allow developers to get more done with very little code written. In one example, an entire list of images was loaded with one simple line of code.

Swift Playgrounds also allow developers to see the entire history of a value over time as an application runs. Swift also includes full control of time, so a developer can fast forward or backward to see how their app might react in certain situations.




When it ships, Swift will have complete Xcode support, and a language guide is already available to developers on the iBookstore. Developers will also be able to submit apps written in Swift to the App Store when iOS 8 launches later this year.
«13456711

Comments

  • Reply 1 of 214
    ghostface147ghostface147 Posts: 1,629member

    I wish I knew how to program (as I have great ideas on games/apps but not a lick on how to program), but this seems more like an attempt to make their games a bit more exclusive to their platform. 

  • Reply 2 of 214
    SpamSandwichSpamSandwich Posts: 33,407member

    Amazing. No one expected this.

  • Reply 3 of 214
    paxmanpaxman Posts: 4,729member

    Yup - this was definitely underwhelming. No new 6" iPhone.

     

    /s

  • Reply 4 of 214
    tallest skiltallest skil Posts: 43,388member

    I was turned onto a video by GatorGuy a few years (years?) ago. Can’t find the link. Maybe he can. I have the video downloaded, but uploading it again would be unnecessary.

     

    EDIT: FOUND IT.

    image

     

    This guy’s giving a talk about software development and the power that could be afforded to developers if the coding software gave them realtime feedback. It blew me away, because that’s exactly what is needed! Being able to see where elements on the screen are going, changing them on the fly, building the world based on the realtime feedback, scrubbing through the execution, etc.

     

    And Swift+Xcode is much exactly that. 

     

    I am absolutely thrilled by this. Can’t wait to see it in action.

     

    This is what Apple has over Windows and Android. The mentally inadequate scream that features are being “copied” (ignoring that they’re not), while refusing to acknowledge that they don’t even have anything remotely like what Apple has on the back end.

     

    Originally Posted by SpamSandwich View Post

    Amazing. No one expected this.

     

    From the icon, I expected the language to be called PeregrineSwift works, too.

  • Reply 5 of 214
    hmurchisonhmurchison Posts: 12,419member
    Quote:

    Originally Posted by ghostface147 View Post

     

    I wish I knew how to program (as I have great ideas on games/apps but not a lick on how to program), but this seems more like an attempt to make their games a bit more exclusive to their platform. 


     

    Swift isn't a gaming API it's general purpose.  If a developer wants to keep things portable they'll simply write as much OpenGL code as they can. 

  • Reply 6 of 214
    ezhikezhik Posts: 101member
    Oooh, very exciting, can't wait to try this. I tried to get into iOS development, but just couldn't wrap my head around Obj-C
  • Reply 7 of 214
    jasenj1jasenj1 Posts: 923member

    https://itunes.apple.com/us/book/the-swift-programming-language/id881256329

     

    iBooks says it is unavailable. :(

     

    I went in through iTunes, not iBooks, and was able to download it. Maybe they flipped the switch and it's now available.

  • Reply 8 of 214
    bloggerblogbloggerblog Posts: 2,462member
    No hardware announcements, expecting stock to drop so I can buy buy buy
  • Reply 9 of 214
    negafoxnegafox Posts: 480member
    Quote:
    Originally Posted by Ezhik View Post



    Oooh, very exciting, can't wait to try this. I tried to get into iOS development, but just couldn't wrap my head around Obj-C

    You can do iOS development in C/C++. Makes the code portable if you plan to go that route. I am curious to learn more about Swift. Objective-C was a tad slow and I am forced to treat all warnings as errors to avoid threads dying and leading to bizarre behavior.

  • Reply 10 of 214
    chandra69chandra69 Posts: 638member

    Its not available yet in iBookStore. 

     

    //Edit: Sorry. Its available.

  • Reply 11 of 214
    darklitedarklite Posts: 229member

    Wait, what? How is putting Swift, C and Objective-C code in the same file going to work? Some sort of .swift{} tags around the code so that Xcode knows which bits are which language?

  • Reply 12 of 214
    fallenjtfallenjt Posts: 4,053member
    Quote:

    Originally Posted by ghostface147 View Post

     

    I wish I knew how to program (as I have great ideas on games/apps but not a lick on how to program), but this seems more like an attempt to make their games a bit more exclusive to their platform. 


    Spend some time and learn the language..."I wish" is not working in the tech world.

  • Reply 13 of 214
    tallest skiltallest skil Posts: 43,388member
    Originally Posted by Chandra69 View Post

    //Edit: Sorry. Its available.


     

    Link’s broken and I can’t find it manually BECAUSE SUBCATEGORIES AREN’T IMPLEMENTED YET. Anyone have a fixed link?

  • Reply 14 of 214
    slurpyslurpy Posts: 5,382member

    There's no way anyone that gives a shit about software could feel "udnerwhelming" by this keynote. It was the single most impressive event, that I've EVER seen from Apple when it comes to iOS/OSX features, API, and development tools. Not only did they address pretty much every major complaint in some ways, they added features that I didnt even imagine, but make perfect fucking practical sense. Apple has clearly been busy, and all the additions and changes are thoughtful, well considered features that are incredibly practical and useful. I was literally cheering at so many points. Cant WAIT for the new OSX and iOS- the phone/message integration and "continuity" features will be used by me literally all the time. Hardware announcements will come later, but this exceeded my expectations in terms of software. Well done Apple- you haven't lost your touch, and are firing on all cylinders. iOS development was already far, far ahead of Android dev, but these improvements widen the gap infinitely more. 

  • Reply 15 of 214
    nhtnht Posts: 4,522member
    Quote:

    Originally Posted by hmurchison View Post

     

     

    Swift isn't a gaming API it's general purpose.  If a developer wants to keep things portable they'll simply write as much OpenGL code as they can. 


     

    For a 10x improvement I'd code to metal if I were going to write in either ObjC or Swift. 

     

    For cross platform most indies will use something like Unity anyway.

  • Reply 16 of 214
    nhtnht Posts: 4,522member
    Quote:

    Originally Posted by DarkLite View Post

     

    Wait, what? How is putting Swift, C and Objective-C code in the same file going to work? Some sort of .swift{} tags around the code so that Xcode knows which bits are which language?


     

    Same project.  Not same file.

  • Reply 17 of 214
    richlrichl Posts: 2,213member
    Quote:

    Originally Posted by nht View Post

     

    For cross platform most indies will use something like Unity anyway.


     

    Cross platform developers will use Unity. Unity itself will use Metal. Everyone wins.

  • Reply 18 of 214
    negafoxnegafox Posts: 480member
    Quote:



    Originally Posted by RichL View Post

     

     

    Cross platform developers will use Unity. Unity itself will use Metal. Everyone wins.


    This. Cross-platform game engines are likely to be updated to use Metal.

  • Reply 19 of 214

    Wow.  That's a lot more 'big' announcements than I'd expected, honestly.  Although I shouldn't have been surprised.  I'm wondering what iOS 9 will do to 1-up these by the same amount that these surpass iOS 7's features.  :)

     

    Going to have to check out Swift. Just downloaded the iBook :)

  • Reply 20 of 214
    chipsychipsy Posts: 287member
    Now this I like. The new iOS features are a bit underwhelming although very welcome of course. But it seems like Apple is focusing on the back end this year. Nice to see.
Sign In or Register to comment.