Apple introduced a new programming language for iOS 8 / OS X. Which version of xcode supports Swift?
I am trying on Xcode 5.1, but it is not supported.
Swift programming language was introduced in Xcode 6 beta version.
Xcode 6 has deep support for Swift throughout. It’s easy to create a brand new app using 100% Swift code, add new Swift code or frameworks to existing apps, and view documentation in either Swift, Objective-C, or both. All the popular affordances such as “Jump to Definition” or “Open Quickly” work equally well with Swift, and even Objective-C header definitions can be shown in Swift syntax.
Please refer the following links for more detail:
https://itunes.apple.com/us/book/swift-programming-language/id881256329?mt=11
https://developer.apple.com/xcode/
It’s Xcode 6+. And you have to save the Swift code in a .swift file, not .m.
You need xcode 6.1 Minimum for osx apps. If you try to use the orginial version of xcode 6, you will only be able to use the playground and create osx apps.
Related
Apple recently released Xcode 9, which ships with a Swift 3.2/4 compiler. Swift 3.2 includes numerous features (such as support for where constraints on associated types), while still being a member of the Swift 3 family. So, my question is:
Is Swift 3.2 production ready? Can I write and deploy apps to the App Store using Xcode 9 beta?
You currently cannot deploy to the App Store, it will take some time and upcoming Xcode betas until that's possible. In the last years we didn't need the GM to upload to the App Store, but the first Xcode Betas didn't let you do that.
I want to start learning Swift but I am not familiar with Xcode. On the developer apple site you can download a playground that you can use while learning from their book "The Swift Programming Language". But I use an older version of Xcode (v6.2), and the playground is made for version 7. Is there a way of opening the playground without upgrading to the latest version of Xcode? Thanks
You can't. The only workaround is to copy and paste the code.
I have just create a simple project using swift language, then i compile and archive it to generate .ipa file. IPA file is so big, it is about 5 MB.
is it right(no problem) at there? when i create it in Objective-C, it is only about 500kb.
Yes, that's about right. The libraries containing the entire Swift language have to be embedded in the IPA. Those libraries are part of the app, not part of the system - because Swift has to work even with backwards compatibility, in part because it is constantly changing (independently of system updates), and in part in order to work on iOS 7 (where the system has never heard of Swift). And they are about 5MB in size.
To expand on matt's answer, here's a quote from the Swift blog on compatibility:
You can trust that your app will work well into the future. […] This is possible because Xcode embeds a small Swift runtime library within your app’s bundle. Because the library is embedded, your app uses a consistent version of Swift that runs on past, present, and future OS releases.
So if your newest app version was built with Xcode 6.0, and a user of your app is running iOS 8.1, and breaking changes to Swift were introduced to your app in between, your app won't break due to the iOS update. If your app just used system libraries, it could.
This allows the developers of Swift to iterate more quickly without needing to build backwards compatibility between every version.
An additional warning:
While your app’s runtime compatibility is ensured, the Swift language itself will continue to evolve, and the binary interface will also change. To be safe, all components of your app should be built with the same version of Xcode and the Swift compiler to ensure that they work together.
As the title,I just want to do some simple practice ranther than big project for I'm just new to Swift language.So is there any way to setup an environment for Swift without 'Xcode 6' installed?THX for answering.
Not at the moment.
The Swift Language is actually new and still in development, evolving day after day.
This means also that new funcitions and classes will be created and modified int the next months. Until then no one will create an "Online Playground" for Swift or similar.
I've planned to make an online Apple Swift Playgroung myself, but that will be once the language has finished developing.
You need XCode 6 to try and use the Swift language, even only in Apple Playground.
You can't use Swift without installing Xcode6. It isn't a stand alone language at the moment.
With each beta of Swift, Apple is changing the language. At the moment [August 2014] noone could make a lightweight environment of Swift, because of these many changes.
If you think that you have to pay for playing around with the Xcode 6 Beta, this isn't true. You don't need the "Mac Developer Plan" for 99 US$/year.
You only need to register as a developer at this page:
https://developer.apple.com/
If you're done, than you can download the Xcode 6 Beta at this page:
https://developer.apple.com/xcode/downloads/
After installing Xcode 6, you can start a new "Playground", which is your lightweight environment for Switch you're searching.
If I only have xcode 3 what am I missing? Should I hold off my project until I get xcode 4?
This would be for ios programming.
Thanks.
You'll be missing the ability to ship software in the App Store. Building for iOS 5 (which is required for App Store acceptance) requires Xcode 4.2. That's probably the single biggest thing. If you're just looking to try things out a bit, Xcode 3 will work. But if you're planning on shipping iOS software, you'll need to have Xcode 4.
Other than that, it's mostly just feature updates. Xcode 4 has a number of features intended to speed up development. By sticking with Xcode 3, you'll be missing out on:
Automatic Reference Counting
Storyboards
The ability to drag directly from Interface Builder to your code
A much faster compiler
Various bug fixes
The ability to follow along with any of the recent tutorials referencing Xcode 4.
By sticking with Xcode 3, you get this:
The ability to follow along with some of the older tutorials referencing Xcode 3.
The ability to whine about "the good ol' days" when you finally switch to Xcode 4.