I am using https://github.com/kylef/JSONWebToken.swift package for handling encoding and decoding of JWT.
I am on Swfit 3 and xcode 8.0.1. The problem that I am having is, after importing JWT into my controller file, when I call
JWT.encode(claims: ["my": "payload"], algorithm: .hs256("secret".data(using: .utf8)!))
The compiler complains:
Ambiguous reference to member 'encode(_:algorithm)'.
I then pressed command + click on the JWT.encode method and traced the method down and found out that the JWT.encode method actually referencing to the .encode method in MultipartFormData.swift of Alamofire.
I have imported both JWT and Alamofire.
Basically, the JWT and Alamofire MultipartFormData.swift both have a public method called encode, and I am calling it explicitly JWT.encode, why would it refer to the encode method in the Foundation library?
How should I fix it?
Thanks