I'm writing an app in SWIFT 2.0 using Xcode 7, but my deployment target is iOS7.
While writing and OptionSetType struct, I've seen in the Quick Help that the availability of this protocol is iOS9.
In the "header" and official documentation nothing is mentioned, but I'm really wondering if this protocol is also available in lower iOSes versions since SWIFT 2.0 should be fine until iOS7.
Since all swift standard library ships with your app to AppStore, all this protocol will be available on iOS 7 and above.
Related
RestKit version(0.25.0) I am using in my app uses AFNetworking1.3.4 which in turn uses NSURLConnection. But Apple deprecated NSURLConnection in iOS9. Is there a latest RestKit version available that I can use in my iOS9 app or will the same version(0.25.0) work on iOS9 also?
The same version works on iOS 9 also.
But unless you are prepared to help update RestKit, you might consider it a red flag to depend on a library that requires deprecated iOS APIs, because who knows if those APIs will still be available in iOS 10?
It looks like the latest work is focused on removing the AFNetworking dependency and using NSURLSession directly.
I would expect NSURLConnection to be around for a long time to come, as it is very broadly used. It will not, however, get any new features, in all likelihood.
Either way, it works fine in iOS 9.
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.
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.
I want to detect air printers in my app and connect to them. How can I do this for iOS3.1, 3.2, 3.3, ... ??? For iOS4.2 is supported the UIPrintInteractionController but this don't work on lower versions.
You can't. It's an iOS 4.2 feature; the relevant code is in iOS 4.2 only. You'd have to reverse engineer and reimplement the entire protocol.
We're building an iPad app and don't plan to use any APIs that are not available in iOS 3.2. Our deployment target is already set to 3.2, but I would like to set our base SDK to 3.2 so that we get compiler warnings/errors if we accidentally invoke APIs not available in 3.2, rather than runtime failures.
Is this a good idea? If so, is the 3.2 sdk still available for download, and will older sdks work with newer XCode versions, like 4? Thanks.
There's no guarantee Xcode will support older SDK versions but as an example the current install of Xcode 4 goes all the way back to 3.0. I would drop 3.2 if I were you (few iPad users are on that; most iOS apps enforce 4.X in the App Store so I'd bet most people have upgraded) but if you are going to support it perhaps you should consider using conditional code for different OS' versions.