kylef / URITemplate.swift

Swift implementation of URI Template (RFC6570)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swift 3 support

sauliusgrigaitis opened this issue · comments

Swift 3 introduced breaking changes:

Compiling Swift Module 'URITemplate' (1 sources)
/home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/Sources/URITemplate.swift:149:40: error: 'joinWithSeparator' has been renamed to 'joined'
        return op!.prefix + expansions.joinWithSeparator(op!.joiner)
                                       ^~~~~~~~~~~~~~~~~
                                       joined
Swift.Sequence:3:17: note: 'joinWithSeparator' has been explicitly marked unavailable here
    public func joinWithSeparator(separator: String) -> String
                ^
/home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/Sources/URITemplate.swift:149:40: error: 'joinWithSeparator' has been renamed to 'joined'
        return op!.prefix + expansions.joinWithSeparator(op!.joiner)
                                       ^~~~~~~~~~~~~~~~~
                                       joined
Swift.Sequence:3:17: note: 'joinWithSeparator' has been explicitly marked unavailable here
    public func joinWithSeparator(separator: String) -> String
                ^
/home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/Sources/URITemplate.swift:179:20: error: 'joinWithSeparator' has been renamed to 'joined'
    return regexes.joinWithSeparator((op ?? StringExpansion()).joiner)
                   ^~~~~~~~~~~~~~~~~
                   joined
Swift.Sequence:3:17: note: 'joinWithSeparator' has been explicitly marked unavailable here
    public func joinWithSeparator(separator: String) -> String
                ^
/home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/Sources/URITemplate.swift:215:44: error: 'enumerate()' has been renamed to 'enumerated'
        for (index, variable) in variables.enumerate() {
                                           ^~~~~~~~~
                                           enumerated
Swift.Sequence:3:17: note: 'enumerate()' has been explicitly marked unavailable here
    public func enumerate() -> EnumeratedSequence<Self>
                ^
/home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/Sources/URITemplate.swift:242:32: error: 'reverse()' has been renamed to 'reversed'
    for match in Array(matches.reverse()) {
                               ^~~~~~~
                               reversed
Swift.Collection:3:17: note: 'reverse()' has been explicitly marked unavailable here
    public func reverse() -> ReverseRandomAccessCollection<Self>
                ^
/home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/Sources/URITemplate.swift:311:27: error: value of type 'Index' (aka 'String.CharacterView.Index') has no member 'advancedBy'
        let index = value.startIndex.advancedBy(prefix, limit: value.endIndex)
                    ~~~~~~^~~~~~~~~~ ~~~~~~~~~~
/home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/Sources/URITemplate.swift:322:54: error: 'joinWithSeparator' has been renamed to 'joined'
    return value.map { self.expand(value: "\($0)") }.joinWithSeparator(joiner)
                                                     ^~~~~~~~~~~~~~~~~
                                                     joined
Swift.Sequence:3:17: note: 'joinWithSeparator' has been explicitly marked unavailable here
    public func joinWithSeparator(separator: String) -> String
                ^
/home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/Sources/URITemplate.swift:335:21: error: 'joinWithSeparator' has been renamed to 'joined'
    return elements.joinWithSeparator(joiner)
                    ^~~~~~~~~~~~~~~~~
                    joined
Swift.Sequence:3:17: note: 'joinWithSeparator' has been explicitly marked unavailable here
    public func joinWithSeparator(separator: String) -> String
                ^
/home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/Sources/URITemplate.swift:444:7: error: 'joinWithSeparator' has been renamed to 'joined'
    }.joinWithSeparator(joiner)
      ^~~~~~~~~~~~~~~~~
      joined
Swift.Sequence:3:17: note: 'joinWithSeparator' has been explicitly marked unavailable here
    public func joinWithSeparator(separator: String) -> String
                ^
/home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/Sources/URITemplate.swift:492:9: error: 'joinWithSeparator' has been renamed to 'joined'
      }.joinWithSeparator(joiner)
        ^~~~~~~~~~~~~~~~~
        joined
Swift.Sequence:3:17: note: 'joinWithSeparator' has been explicitly marked unavailable here
    public func joinWithSeparator(separator: String) -> String
                ^
/home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/Sources/URITemplate.swift:547:7: error: 'joinWithSeparator' has been renamed to 'joined'
    }.joinWithSeparator(joiner)
      ^~~~~~~~~~~~~~~~~
      joined
Swift.Sequence:3:17: note: 'joinWithSeparator' has been explicitly marked unavailable here
    public func joinWithSeparator(separator: String) -> String
                ^
<unknown>:0: error: build had 1 command failures
error: exit(1): /home/saulius/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2016-03-24-a/usr/bin/swift-build-tool -f /home/saulius/workspace/Swifton/Packages/URITemplate-1.3.1/.build/debug.yaml default

@damuellen thanks! I think it's worth to keep both Swift 2 and Swift 3 compatibility.

@kylef any chance you could merge this?

As of URITemplate 2.0, Swift 3 is now supported.

Awesome! Thanks for the great work @kylef 🍻