Swiftyjson: '++' is deprecated: it will be removed in Swift 3

Created on 17 Feb 2016  路  17Comments  路  Source: SwiftyJSON/SwiftyJSON

The following code triggers this warning when building with Swift 3:

    public mutating func next() -> JSONGenerator.Element? {
        switch self.type {
        case .Array:
            if let o = self.arrayGenerate!.next() {
                return (String(self.arrayIndex++), JSON(o)) // *** This is the line with the warning
            } else {
                return nil
            }
        case .Dictionary:
            if let (k, v): (String, AnyObject) = self.dictionayGenerate!.next() {
                return (k, JSON(v))
            } else {
                return nil
            }
        default:
            return nil
        }
    }

All 17 comments

Wonder why they took that out, anyone know?

+1

How did you test it for swift 3? Unable to find a way to start writing code in swift 3 beta version

It gives that warning in the latest Xcode 7.3 beta 5 update (may be in older betas too, can't remember, but they put in a bunch of future deprecation warnings in there)

+1 on fixing this now, rather than when Swift 3 launches

This is also occurring on the latest stable version of Xcode. Is this going to be fixed?

Fixed on March 1st. Use master with CP/Carthage (no new tags since Dec 2015)

Hi!
Any progress on this? It would be nice if the fix is released and available via CocoaPods (without pointing to the master branch manually). I've seen that it was fixed in a commit, but there is not new tags for it to specify in the Podfile.

You can specify a commit or use HEAD :wink:

True, but a release would be still much nicer.

Is SwiftyJSON still being maintained? This error has been around for a while now

Doesn't seem that way. Although there's a Swift 3 branch, nothing's been released for a long while.

Seems strange to have had a fix without a release for so long. And no-one is assigned to this issue.
Pointing to master or an untagged commit isn't really acceptable.
Who should we mention in order to get a release out?

The nuclear option is to fork the project and do a release, but this should probably be avoided in the hope of any approved committers agreeing to do it. The two members of the SwiftyJSON organisation are @lingoer and @tangplin, so one of these two would be able to do it.

If neither are interested in making a release, then forking the repository or finding an alternative JSON library might be the only other option.

Looking at 99 open issues and 35 open pull requests, and the dates on them, I for one am tempted to just fork and tag it for Swift 2.x and look for better supported options for Swift 3.x.

The Big Nerd Ranch did one that I should take another look at. https://www.bignerdranch.com/blog/introducing-freddy-an-open-source-framework-for-parsing-json-in-swift/

Please someone fork this and start a new library for swift3

SwiftyJSON is now available for swift 3, closing this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Xedart picture Xedart  路  13Comments

Joe2Code picture Joe2Code  路  12Comments

j-h-a picture j-h-a  路  15Comments

artjomzab picture artjomzab  路  13Comments

debayanb picture debayanb  路  12Comments