Moya: How to use Moya in swift3.0

Created on 14 Sep 2016  路  13Comments  路  Source: Moya/Moya

today ,i updated my Xcode to 8.0 and found that moya does not support swift 3.0,what can i do then?

question

Most helpful comment

Hey @lixingshi! We are currently working hard on releasing Moya for Swift 3.0 in #608. For now you can use Moya with CocoaPods specifying the branch "swift-3.0", like:

pod "Moya", :git => "https://github.com/Moya/Moya", :branch => "swift-3.0"

And switch to Moya 8.0 when the release happens.

Hope it helps!

All 13 comments

Hey @lixingshi! We are currently working hard on releasing Moya for Swift 3.0 in #608. For now you can use Moya with CocoaPods specifying the branch "swift-3.0", like:

pod "Moya", :git => "https://github.com/Moya/Moya", :branch => "swift-3.0"

And switch to Moya 8.0 when the release happens.

Hope it helps!

@sunshinejr What if we need moya with rxswift and swift 3.0?
What is the rxswift for moya?

This should work:

pod "Moya/RxSwift", :git => "https://github.com/Moya/Moya", :branch => "swift-3.0"

Let us know how it goes :+1:

Hi @ashfurrow, I tried using the above but it doesn't seem to work as Moya/RxSwift is pointing to this branch of RxSwift (~> 3.0.0-beta.1). Is there any temporary solution to this?

Is there a problem with Moya here, or the RxSwift branch? @gordoneliel

@BasThomas The RxSwift branch
screen shot 2016-09-15 at 12 02 09 am

But does that not work? It should point to the / a Swift 3 branch of Rx of course.

use of undeclared type RxMoyaProvider...the same problem,how to slove

Any idea @sunshinejr?

waiting for answer 锛宼hank

Hmm, what is your Podfile @zhaoyunyi? Can you download our Demo and check if it works for you? Because I've downloaded it, and RxMoyaProvider works just fine in the Demo. Another idea could be that you maybe forgot importing RxSwift at the top of your file along with Moya?

you are right , i check my Podfile and modify it.
use this can slove it

pod "Moya/RxSwift", :git => "https://github.com/Moya/Moya", :branch => "swift-3.0"

@sunshinejr thank you ,it works well

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pedrovereza picture pedrovereza  路  3Comments

fenixsolorzano picture fenixsolorzano  路  3Comments

holysin picture holysin  路  3Comments

JoeFerrucci picture JoeFerrucci  路  3Comments

ghost picture ghost  路  3Comments