or Connect
AppleInsider › Forums › Mobile › iPhone › Apple unveils Swift, a brand new Xcode programming language for developers
New Posts  All Forums:Forum Nav:

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

post #1 of 213
Thread Starter 
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.




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.
post #2 of 213

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. 

post #3 of 213

Amazing. No one expected this.

Proud AAPL stock owner.

 

GOA

Reply

Proud AAPL stock owner.

 

GOA

Reply
post #4 of 213

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

 

/s

post #5 of 213

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.

 

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.

Originally Posted by Marvin

The only thing more insecure than Android’s OS is its userbase.
Reply

Originally Posted by Marvin

The only thing more insecure than Android’s OS is its userbase.
Reply
post #6 of 213
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. 

He's a mod so he has a few extra vBulletin privileges. That doesn't mean he should stop posting or should start acting like Digital Jesus.
- SolipsismX
Reply
He's a mod so he has a few extra vBulletin privileges. That doesn't mean he should stop posting or should start acting like Digital Jesus.
- SolipsismX
Reply
post #7 of 213
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
post #8 of 213

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.

post #9 of 213
No hardware announcements, expecting stock to drop so I can buy buy buy
bb
Reply
bb
Reply
post #10 of 213
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.


Edited by Negafox - 6/2/14 at 12:15pm
post #11 of 213

Its not available yet in iBookStore. 

 

//Edit: Sorry. Its available.

post #12 of 213

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?

post #13 of 213
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.

Congratulation to Samsung Galaxy S5 for winning CNET's Best Android Phone of the Year 2014

 

"From the owner of iPhone 6+, Best Smart Phone of the Year 2014"

Reply

Congratulation to Samsung Galaxy S5 for winning CNET's Best Android Phone of the Year 2014

 

"From the owner of iPhone 6+, Best Smart Phone of the Year 2014"

Reply
post #14 of 213
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?

Originally Posted by Marvin

The only thing more insecure than Android’s OS is its userbase.
Reply

Originally Posted by Marvin

The only thing more insecure than Android’s OS is its userbase.
Reply
post #15 of 213

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. 

post #16 of 213
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.

post #17 of 213
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.

post #18 of 213
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.

post #19 of 213
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.

post #20 of 213

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 :)

You did not come into the world to fail. You came into the world to succeed.

- Gordon Hinckley

Reply

You did not come into the world to fail. You came into the world to succeed.

- Gordon Hinckley

Reply
post #21 of 213
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.
post #22 of 213
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. 

and lose the Metal interface?   There's a reason to 'code to the metal'

 

Metal will be the real game development interface...  Swift will just make loading a Metalcall a one liner.

post #23 of 213
Quote:
Originally Posted by Slurpy View Post

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. 
I called it. I said that developer resources at Apple would have been primarily used to convert iOS to 64bit, which is why iOS 7 wasn't a huge update.

Now that the difficult 64bit transition is done, Apple could devote resources back to iOS 8 itself. And boy did they deliver.
post #24 of 213

Always funny that the developer and app store areas are android-free.  :lol:

2014 27" Retina iMac i5, 2012 27" iMac i7, 2011 Mac Mini i5
iPad Air 2, iPad Mini Retina, iPhone 6, iPhone 5S, iPod Touch 5
Time Capsule 5, (3) AirPort Express 2, (2) Apple TV 3

Reply

2014 27" Retina iMac i5, 2012 27" iMac i7, 2011 Mac Mini i5
iPad Air 2, iPad Mini Retina, iPhone 6, iPhone 5S, iPod Touch 5
Time Capsule 5, (3) AirPort Express 2, (2) Apple TV 3

Reply
post #25 of 213
Quote:
Originally Posted by AppleInsider View Post

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.

 

Apple develops an improved programming language.  Google copied Java.  Everything you need to know, right there.  :lol:

   Apple develops an improved programming language.  Google copied Java.  Everything you need to know, right there.

 

    AT&T believes their LTE coverage is adequate

Reply

   Apple develops an improved programming language.  Google copied Java.  Everything you need to know, right there.

 

    AT&T believes their LTE coverage is adequate

Reply
post #26 of 213
Crap. I just finished learning Objective C and started writing an app. Now I have to learn Swift when the teaching materials come out and rewrite my app using it. Just did a quick look at the language guide and some of it reminds me of Javascript.
post #27 of 213

There are 2 reasons I jailbreak my iOS devices
#1 Swipeselect.  I seriously can't stand typing on an iOS keyboard without swipeselect enabled.
#2 Customized control center (I like quick access to personal hotspot).

 

Seriously that's it... I could care less about pirated apps.  I did when GPS Nav apps were $80, but now I just use Google Maps.  Those 2 things though remain incredibly important to me on a daily use basis.

 

iOS 8 definitely addresses #1 and I suspect the ability to start tethering from my mac will fix #2.

 

While I'm surprised no hardware was announced, I'm not disappointed.  Rather I'm delighted by the insane amount of software announced from Swift to Keyboards.  HealthKit/HomeKit both give developers an entire new universe to develop apps and make money in.  

post #28 of 213
Quote:
Originally Posted by Chipsy View Post

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.

Yes iOS 7 was UI changes and a sound groundwork done on the guts.  iOS 8 has a lot of new Dev stuff.  The UI changes are welcome but not huge but what Devs are going to be able to do is nice.   

 

Yosemite is UI polish.  I'm a fan..they didn't go too crazy.   I'm thinking OS X 10.11 may bring some huge changes to the underpinnings (new filesystem anyone?) 

He's a mod so he has a few extra vBulletin privileges. That doesn't mean he should stop posting or should start acting like Digital Jesus.
- SolipsismX
Reply
He's a mod so he has a few extra vBulletin privileges. That doesn't mean he should stop posting or should start acting like Digital Jesus.
- SolipsismX
Reply
post #29 of 213
How are you guys finding it in the iBookstore? I looked in the store just now on my iPad inside iBooks as well as in iTunes on my Mac. Neither show it.
(the direct link shown above worked though I still cannot find it by searching)

This (Swift) is a big deal. Swift will make iOS (and I assume Mac Apps?) easier to develop with fewer crashes etc. Combine it with Reactive Cocoa for additional benefit (and since it all uses the same runtime, you should be easily able to do that I would presume).

@negafox Not sure why treating warnings as errors helps you avoid threads dying and bizarre behavior. I and all the ObjC/iOS devs I know have no such issues.
post #30 of 213

This actually reminded me of the episode from Silicon Valley (The HBO series) from last night. They run the compression test and it blows away past results. Did anyone else that watched the episode last night think the same thing? 

 

I don't know enough about Swift to say much beyond the fact that I think it looks very impressive and once developers get through that initial painful transition phase where they have to relearn some things their lives just got a whole lot easier. 

post #31 of 213
Quote:
Originally Posted by rtamesis View Post

Crap. I just finished learning Objective C and started writing an app. Now I have to learn Swift when the teaching materials come out and rewrite my app using it. Just did a quick look at the language guide and some of it reminds me of Javascript.

Everything you learned about ObjectiveC in terms of programming and design and how it works (just not the syntax) will help you when you use Swift.  It all resides on the same runtime.

post #32 of 213
Real time REPL. First saw it in a concept product for Clojure called LightTable, but didn't expect Apple to finish it so soon. Apple is clearly aiming at beginners with this language.
post #33 of 213
Quote:
Originally Posted by Chipsy View Post

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.

I disagree on the premise.  the iOS features are nuanced, but overwhelming.

 

- widgets/extensions/services  (plowing through the sandbox walls... interactivity between apps)

 

- Notifications Center becomes something not to ignore... it's your main screen now.  The rest of your apps just tell notifications center they need your attention.

 

- Metal.  pretty much lays down a gaming engine that can take an AppleTV (yeah, that's an iOS system), and turn it into a serious gaming platform, let alone the interface for iPad, iPhone

 

- Swift.   More/better code faster.    My first real boss told me, nothing is impossible with computer programming... it just takes time and money.   (and time = money).   If Swift lives up to its name, coding iterations will be reduced dramatically (because the first 90% of coding time is making it work.... the last 90% is making it fast/secure/bug-free)

 

in the old days... these WERE the features of an OS... not some email app (those you downloaded from some FTP server).

post #34 of 213
Quote:
Originally Posted by Tallest Skil View Post
 

 

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

That link directly worked for me (on iPad)

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

post #35 of 213
Originally Posted by chadbag View Post
(the direct link shown above worked though I still cannot find it by searching)

 

Yep. That’s the App Store/App Store/iBooks Store/iTunes Store for you. YOU CAN’T FIND ANYTHING BY SEARCHING.

 

But they’ve changed all that. I couldn’t be happier.

Originally Posted by Marvin

The only thing more insecure than Android’s OS is its userbase.
Reply

Originally Posted by Marvin

The only thing more insecure than Android’s OS is its userbase.
Reply
post #36 of 213
Quote:
"For the best experience, open this chapter as a playground in Xcode.  Playground allows you to edit the code listings and see the results immediately."

 

:applause:

   Apple develops an improved programming language.  Google copied Java.  Everything you need to know, right there.

 

    AT&T believes their LTE coverage is adequate

Reply

   Apple develops an improved programming language.  Google copied Java.  Everything you need to know, right there.

 

    AT&T believes their LTE coverage is adequate

Reply
post #37 of 213
Quote:
Originally Posted by chadbag View Post

@negafox Not sure why treating warnings as errors helps you avoid threads dying and bizarre behavior. I and all the ObjC/iOS devs I know have no such issues.

This is more common on OS X than iOS. When you start trying to support multiple flavors of OS X the API behaves differently from one version to the next and some calls are deprecated. This is less problematic in more recent versions. Fun times trying to write an app to be compatible with lets say 10.4 through 10.9. A good example would be making a deprecated call that in Objective-C will just stop the thread when the call it hit. Or better yet, typos that are allowed to be compiled (e.g. using different casing).

My last company switched to using Qt and C++ to make developing cross-platform apps faster. I do not have much positive things to say about Qt though.


Edited by Negafox - 6/2/14 at 12:44pm
post #38 of 213
THIS is my out of "left field" and "it will blow your mind" prediction!

THIS is how how Apple has decided to blow past Microsoft and Google (Samsung): ground-breaking new tools based on performance and efficiency = SPEED!

Considering that the 64bit A7 already blows the doors off of anything running Android, Apple just bought themselves the equivalent of 2 years in speed improvements to ALL iOS devices.

Now THAT's impressive!

The only other tech co. working on cleaning up legacy code is Microsoft. Hats off to them for that, regardless of the sly TC remark regarding Win8 acceptance.

Apple just turned up the heat to boiling under the asses of every other companies tool developers: "well guess were not going to be shipping that tool box"... 1smoking.gif
Knowing what you are talking about would help you understand why you are so wrong. By "Realistic" - AI Forum Member
Reply
Knowing what you are talking about would help you understand why you are so wrong. By "Realistic" - AI Forum Member
Reply
post #39 of 213
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

I tried to wrap my head around FORTRAN back in the 70s and couldn't do it.  Needless to say, I am still not a programmer at age 57.

Apparently math and I are sworn enemies.

post #40 of 213
Quote:
Originally Posted by rtamesis View Post

Crap. I just finished learning Objective C and started writing an app. Now I have to learn Swift when the teaching materials come out and rewrite my app using it. Just did a quick look at the language guide and some of it reminds me of Javascript.

 

Obj-C is still a valid Xcode language.  (Until it's not, ref: the Carbon APIs.)

 

The difference seems to be (and I've looked at the Swift book for all of five minutes) is that you'll choose to use Swift and Playground, by preference.

   Apple develops an improved programming language.  Google copied Java.  Everything you need to know, right there.

 

    AT&T believes their LTE coverage is adequate

Reply

   Apple develops an improved programming language.  Google copied Java.  Everything you need to know, right there.

 

    AT&T believes their LTE coverage is adequate

Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: iPhone
  • Apple unveils Swift, a brand new Xcode programming language for developers
AppleInsider › Forums › Mobile › iPhone › Apple unveils Swift, a brand new Xcode programming language for developers