Do I have to rebuild my existing apps with the Swift language in order to support iOS8 when it will be released and the most of iPhone owners upgrade to this version? If I must rebuild my apps to new standards or not? At moment my apps are running under iOS6.
My main concern is if I have to abandon the iOS6 version or not.
I watched the announcement, but here's a blog to support me :
Matter of fact, Swift code can co-exist with Objective-C...
Developers don’t need to choose between C for Mac development and Objective-C for iOS development because Swift supports both iOS and OS X and can co-exist with C and Objective-C code.
For the time being, Apple plans to support both Swift, Objective-C, and hybrid apps built with both.
No, you do not need to abandon iOS 6 .. although with 89% of devices running iOS 7, you may considering doing it soon ...
No, you will not need to rebuild your apps with Swift. The compiler compiles Objective C and Swift down to the same code to run on your iPhone and both languages can co-exist. Objective C will likely be phased out gradually over a number of years.
If you still wish to switch your existing apps over to Swift, here's a handy migration guide from Apple.
Related
The app I developed (with Swift 3 and xcode 8) is ready for iOS 10, but my boss wants it to work with iOS 8 because he has an iPhone with 8.2: when I plugged his iPhone to my Mac and started to build the project, it failed because some features are available only on iOS 9.0 or higher.
I did some research and came across some options, but since I'm a beginner I don't know what would be better. Let me share them with you:
rewrite the whole app with Objective-C: I think the less convenient, since I never studied this language and my boss wants the app to be uploaded to the store as soon as possible;
call Obj-C code from Swift for iOS 8 needs;
upload the app anyway: I managed to modify the app and make it compatible with iOS 9, do you know any recommendation or proposal from Apple to not develop app for too much old iOS versions so that I can convince my boss to not obsess over this matter? 87% of devices are using iOS 10 so we would not cut off too many people;
upload the app AND add iOS 8.0 compatibility in a future update: can I change iOS target in next updates?
use Appcelerator or React Native.
The best solution would be to check the iOS version programatically and only call the problematic methods if the user's phone actually supports them. Otherwise keep that functionality hidden from the user.
This is how you can check iOS version from code:
if #available(iOS 9, *) {
// iOS 9 Swift code
} else {
//Hide the methods from the users on older OS versions
}
That wouldn't work, since most system APIs are not language dependent. If a certain API/feature was only added in a certain iOS version, that requirement stays the same regardless of whether you use Objective-C or Swift.
Same as 1.
This is a feasible option of course.
AFAIK, you can change the target iOS version in a later update.
If you want to achieve a functionality that uses an API which was only introduced in iOS9, even hybrid frameworks need that iOS version if they use built-in iOS APIs.
To add iOS 8 compatibility you must change the deployment target version to 8.0 and resolve every warning/issue that Xcode give you when you try to build/run.
You will need to use if #available(iOS 9, *) {} code if you use APIs that changed between the versions 8 and 10.
You don’t need to rewrite anything in objective c. For the features that are getting called out, research the iOS 8 compatible way to implement them (if even possible) and add checks in your code for iOS version so that certain blocks only execute for certain os’s. (See technical answers already provided)
But, first show your boss how to update his phone.
Then show your boss that 97% of users are using 9 or 10.
https://developer.apple.com/support/app-store/
Next remind him that the 3% of out of date users are also the 3% least likely to be downloading apps and only part of that 3% are on iOS 8. Many are even more out of date.
Then calculate the number of hours required to support iOS 8. Multiply that by your hourly rate. Then ask your boss if it’s worth $X to expand your app’s user base by, at best,1%.
If he says yes, then go for it.
There is an iOS app developed in iOS 4.3. Now I want to upgrade this app to iOS 9 and later. I can able to run the application even on iOS 10 devices. But there are lot of deprecated warnings regarding the latest SDK.
The main reason I'm posting this question is, while upgrading the app from lower version to latest version, what are the action items to be consider to make the application perfect on latest SDK?
Here are few points I've noted,
Clear all deprecated warning.
Do analyser for memory leak.
Enable ARC if not enabled yet.
Proper unit testing.
Please advice me some more point.
Note: I'm not converting the app to Swift, using Objective-C only.
Update: I know the basic things like changing the deployment targets, update the used libraries / Frameworks to latest one, etc., I want more high level points those features are available in latest SDK comparing with lower one.
Thanks
Here are some more points you have to consider for latest iOS support,
Change deployment target in general setting.
Check for device compatibility for design constraint. There are new devices.
Change the version of your app in general settings.
If there are any functionality for touch event than check if it is possible to implement 3D touch for newer device.
And go for proper testing of functionality and design.
Hope it will help you.
If i create an iOS application in XCode 7.2 with SDK 9.2, will that application work in iOS 6 in iPhone 4?
In general, this is possible - that is where the availability information in the apple documentation comes into play.
You may use iOS 6 as your deployment target and only use the API available on iOS 6.
This will mean your code completion on the current Xcode will suggest unavailable methods and you will be very limited in terms of what the API can do for you.
Also, to cherry pick one of the problems you might run into:
iOS 6 has a whole different approach to authorization for location usage than iOS 9, so you would have to (partly) clutter your code with a lot of version checks to give different implementations for the different versions (and version checks were not available back then). Because, a iOS 9 device will not even ask the user for permissions if you do it the way iOS 6 documentation says you have to do it.
The very fact that you do ask this question might already give away that in general, the answer is
Yes, that can be done with a lot of work that is almost intractable for a single person and in almost all cases not needed.
as the market share of iOS 6 is only a tiny fraction, but in your case, the answer might even be
You will probably fail horribly at some point and should reconsider if this is really necessary. The market share of iOS 6 is really small and you are basically putting in weeks of extra work for basically a hand full of potential users.
Also, as you might have guessed from this (and other answers), if your question is if this works out of the box, the answer is
No.
in general yes or no terms.. yes it is possible.
(Our app spans between 7 and 9)
Supporting ios6 will require a lot of work though since you must take care not to use any features that aren't available on ios6 and iOS sdk6 and iOS sdk9 differ quite a bit :)
I'd consider if it is worth the effort.
My team has developed a big social networking app. Now i want to publish it to app store. But the app is not written in Objective C. What is the way to get it published in app store? Or least how can i open in in Xcode simulator for testing and enhancement?
My guess is that you created an app in android and now want to port it to iOS. Unfortunately Xcode isn't able to transform Java to Objective-C and iOS cannot run Java apps, so you will not be able yo submit your app as-is to the App Store.
You will have to do it the hard way and rewrite the entire app in Objective-C. Luckily Google recently launched a translator that might help with part of the work: http://google-opensource.blogspot.com.br/2012/09/j2objc-java-to-ios-objective-c.html
You cannot. Sorry.
I recently worked on an app for iOS and Android launch and we settled for parallel development.
Your Java code is incompatible with iOS and Xcode has no process to convert it to Obj-c.
The only options for cross-platform development that I am aware of are:
1) Heavy use of c/c++ based libraries; these can be utilised in both Android applications and iOS applications (this is what we used). But the entire front end of the apps must be re-implemented.
2) A cross-platform framework such as PhoneGap or Appcelerator, but this would require significant redevelopment from your current code-base.
3) A 'translator' such as the one Breno Gazzola suggested (another option is XMLVM) but these only do some of the work for you, and they're far from perfect.
It's very hard to judge without knowing your code, but if I were you I'd look at combining options 1 and 3 as much as possible, but budget for a complete re-write.
What exactly does this mean? I've seen Availability: iOS (6.0 and later) and other version numbers, but I don't think thats exactly what it means. Does it truly mean that its only available with iOS 6 and up? If thats the case, then why is the comparable method for iOS 2.0f and later depreciated? Shouldn't I still be using it when the iOS version is less that 6.0 or the specified availability?
An example is NSTextAlignmentCenter. It specifies that it is Availability: iOS (6.0 and later), but I'm building an app for iOS 4.3 and up. I'm currently performing a check on the iOS version of the device and choosing the text alignment between NSTextAlignmentCenter and UITextAlignmentCenter. To me, this seems odd. Shouldn't it be for iOS SDK 6.0 and later, rather than iOS 6.0 and later?
I know this seems like nitpicking, but it makes a pretty big difference.
I've seen Availability: iOS (6.0 and later) and other version numbers,
but I don't think thats exactly what it means. Does it truly mean that
its only available with iOS 6 and up?
Yes, it truly means only available in iOS 6 and later.
Most of the Apple-provided frameworks that you link into your app are dynamic -- they're not built into your app, but linked in when the app launches. They exist on the device as part of the operating system. That means that making retroactive changes such as adding a new method is somewhere between difficult and impossible. Important changes, such as security fixes, are typically made in minor OS updates. Feature changes to the API are usually reserved for more significant upgrades.
Some changes do happen retroactively. For example, object literals work not just in iOS 6 but also in 5 and (I think) even 4. That's because in the case of object literals, the change is in the compiler, not in the operating system or frameworks. As long as you're using a compiler that understands the object literal syntax, the object code that the compiler emits will be compatible with older systems.
It means what it says. If it says "2.0 and later" then you can safely use it in any app that target SDK 2.0 or later.
It means that you can use it starting from this x.x OS version.
Think about this in following way - each feature including API has initial version on which it's born (x.x). It lives for some time (through several versions) and at some point it becomes old (new features can do the same thing, but better) and it's marked as deprecated. It's still could be used, but it's not recommended anymore. And at some moment this feature/API dies (becomes unsupported).
So, if you plan to support iOS 4.3 and up, you will have to choose features which alive in iOS 4.3 to 6.0 (already born, but aren't dead yet).
It doesn't refer to SDK version - it iOS version. Every version of iOS adds new APIs that it it supports so you can't use an API (like NSTextAlignmentCenter) that don't exist in that version.