Objectmapper: Problem to compile in Xcode 10 beta for version 2.2.9

Created on 8 Aug 2018  路  9Comments  路  Source: tristanhimmelman/ObjectMapper

Got a lot of compiling error messages like:

Invalid redeclaration of '<-'

Invalid redeclaration of 'optionalBasicType(_:object:)'

I want to still use Swift 3 so that I'm using ObjectMapper 2.2.9. Any idea? Thanks.

Most helpful comment

@gcharita So that means I can use library in Pods in Swift 4 and still keep my project in swift 3? Thanks.

All 9 comments

@zhouhao27 just install the latest version.

@gcharita The latest version is for Swift 4, right? I'm still using Swift 3 in my project.

Actually there is another reason I still need to use 2.2.9. The AlamofireObjectMapper is depends on this for Swift 3.

@zhouhao27 since Xcode 9 you can have different swift versions per target.
So, you can have swift 4 pods in a swift 3 project.
Having said that, just install the latest version of AlamofireObjectMapper and you are good to go.

Keep in mind though, that, as Apple mentioned in WWDC 2018, Xcode 10 is tha last Xcode version that support swift 3.

@gcharita Here is the screenshots for my demo project using AlamofireObjectMapper.

screenshot 2018-08-12 at 11 10 54 pm

I can't find any target for Swift 3.

@zhouhao27 in this screenshot you can see the target of the project (you can keep this in swift 3)

screen shot 2018-08-20 at 13 54 22

And in this screenshot is the target of the ObjectMapper (swift 4)
screen shot 2018-08-20 at 13 55 17

@gcharita So that means I can use library in Pods in Swift 4 and still keep my project in swift 3? Thanks.

@zhouhao27 if the installation of the latest version fixed the compiler errors, please close this issue.

This should be resolved

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VictorAlbertos picture VictorAlbertos  路  3Comments

patchthecode picture patchthecode  路  3Comments

danyalaytekin picture danyalaytekin  路  4Comments

nearspears picture nearspears  路  4Comments

liltimtim picture liltimtim  路  3Comments