How to stop swift syntax updates in Xcode? - swift

Is there any way to stop Swift syntax updates for Xcode? The errors are quite difficult to figure out and existing projects fail to run the apps. Thanks.

If you open the project in the latest xcode 7. It will automatically ask you whether you want to update the syntax or not.
Hope this helps.

Xcode only ships with the latest Swift version. You will need to upgrade your Swift code or stay with an older version of Xcode.

Related

Conversion from Swift 3.0 to 4

How can I convert my code that I wrote a few years ago to Swift 4.0 without using XCode 10.1? Is there any way to run it on some online simulator or on the newest version of XCode? This is some code that I wrote for messing around and seeing what features the touchbar has. I get this message when I'm trying to open the project.
I'm not aware of any automatic migration tools other than the one that Apple provides in some versions of Xcode. I think your choices here are:
Use migration assistant in Xcode 10.1 (which is still available from developer.apple.com) to update the code more or less automatically.
Rewrite the code yourself.
If it's just code for experimenting with the Touch Bar, why not migrate it yourself? There are lots of resources to help you figure out what you need to change. While you're at it, you might as well move all the way to Swift 5.7 -- you'll be modernizing both your code and your knowledge of Swift.

objc[29733]: Swift class extensions and categories on Swift classes are not allowed to have +load methods xcode 10.2 running on ios 12.2

I updated my Xcode to Version 10.2 (10E125) and my existing swift project crashes with "objc[29733]: Swift class extensions and categories on Swift classes are not allowed to have +load methods" while running in iPhoneX simulator 12.2
Apparently in iOS 12.2 you can't use anymore + (void) load.
You should refactor your code to use __attribute__ instead of + (void) load.
The old answer was given incorrectly but has good talk material to understand the problem.
I ask to any Developer to give a better answer that this one. I reckon my lack of knowledge is a speed bump on this answer but my idea is to at least start giving some insight on how to solve it!
If at least one developer can make is code work, my job here is done :)
===============================Old Answer==================================
It's a known bug.
It seems the new 12.2 don't allow some method's to load swift modules.
A Fix was already made, let's hope it enters the react native 59.3. (Fingers Crossed.)
For more information:
https://github.com/facebook/react-native/issues/24139
There are some temporary work arounds pls check the link above.
=============================EDIT old answer===============================
react-native 59.3 was released a few moments ago with this bug fixed, pls update.
For anyone encountering this error in a React Native project with Xcode 10.2, check that you are using version 0.59.3 or later of react-native, which includes a fix for this issue, which is related to using RCT_EXTERN_MODULE for Swift classes.
This issue was due to incompatible version of pod library for Xcode 10.2. Solved by updating all the library with version compatible to Xcode 10.2.

Module compiled with Swift 2.3 cannot be imported in Swift 3.0

i add Facebook SDK (Swift) to my project.
And now i update Xcode 8 and Swift 3.
I have error in build time
Module compiled with Swift 2.3 cannot be imported in Swift 3.0
It is very strange that is not supported.
Has anyone had similar problems?
Remember to set Use Legacy Swift Language Version to YES for your project target
You are building your project in 2.3 and not in 3.0
Have in mind that if you want to use Swift 3 as your main project's language you have to use pods that are either Swift 3, or Swift 2.2-. If you try to use a Swift 2.3 project, they will not compile (as in the error you describe).
So the best thing to do is to use either Swift 3 pods, or Swift 2 (2.1 or 2.2) pods and select Use Legacy SLV for that specific pod (in 'Pods' build setting for the specific target you want to use).
Try to remove all files under /tmp/Build/Products/... and /tmp/Build/Intermediates/... and Build again.
This maybe a little late but changing the settings to\fro Yes and No didn't help me but just clearing my derived data from the simulators just made everything work.
Currently the Facebook SDK does not yet support projects written in Swift 3.0.
There are a couple of issues you can subscribe to on their Github for updates.
You'll have to use Swift 2.3 for now. Facebook said it was planning to release an update soon after the GM was released, which has already happened, so it will probably come within the next few weeks.

how to update ios?

i have
xcode=3.2.5
ios=4.2
NOW
i want to update only ios to 4.3
i don't want to update xcode,
how to do so?
Thanks,
Shyam
Recent versions of Xcode will work with devices that have newer version of iOS. When you plug it in afterwards it will volunteer to download the symbols; it should "just work" after that. (I say "recent versions" since I'm not sure exactly which version was the first to do that.)
Having said that, I'm not sure that's a good idea for anything other than a point update (i.e., 4.3.1 to 4.3.2). What's your objection to updating Xcode? The download link for Xcode 3 is still present if you'd rather not move to version 4 just yet.
As Jim said, you can't only update the iOS SDK version.
You can, however, install the latest Xcode in another directory and copy over the SDK to your older developer installation.
EDIT: Actually, it depends whether or not you don't want to update at all, or just to Xcode 4. The current available version of Xcode 3 includes the latest iOS SDK, 4.3, so you could update to that. Older Xcode versions will probably be phased out eventually, though.
You can't, as far as I know. Apple couples the IDE and the SDK. You can't download one without the other.
Edit: someone may know a way involving copying files from one later XCode installation to an older one, that seems feasible.

iPhone SDK 3.0 Targetting 2.2.1 SDK

Just got the latest beta for iPhone SDK up. This is the update for the upcoming 3.0 release of the iPhone SDK. Unfortunately, I'm not getting a bunch of errors for targetting the 3.0 platform. This is nice to know for me to mark future work, but I need to get some other stuff done first. Unfortunately, the "target" field no longer shows me the 2.2.1 SDK, and defaults to 3.0, resulting in a myriad of errors that I'd like to fix later.
What actions should I follow to fix this? I've already tried changing the default base SDK in the properties for the project to no avail. Does installing 3.0 basically remove the 2.2.1 SDK?
Thanks in advance.
Figured it out. The error I was getting occurs for a beta build so this probably shouldn't be a persistent solution, but if anyone else is having trouble with trying to use the latest beta of XCode+iPhone0S3 installation, you will find that you can only target the 3.0 OS after you select it in the Overview dropdown. Even if you were targetting a different active SDK previously, they will all be gone as soon as you select the 3.0 target.
The way to fix this problem is to just delete all the user-specific project files and to reopen the project. Before that, make sure the base SDK is 2.2.1, etc.
This is a lot easier than downloading the 2GB stable XCode just to target the previous SDK.
Hope this helps someone.