You’re a smart developer. You probably use Alamofire to abstract away access to URLSession and all those nasty details you don’t really care about. But then, like lots of smart developers, you write ad hoc network abstraction layers. They are probably called APIManager or NetworkModel, and they always end in tears. So the basic idea of Moya is that we want some network abstraction layer that sufficiently encapsulates actually calling Alamofire directly. It should be simple enough that common things are easy, but comprehensive enough that complicated things are also easy. If you use Alamofire to abstract away URLSession, why not use something to abstract away the nitty gritty of URLs, parameters, etc? After some setup, using Moya is really simple. Even cooler are the reactive extensions. Moya provides reactive extensions for ReactiveSwift and RxSwift.

Features

  • Compile-time checking for correct API endpoint accesses
  • Lets you define a clear usage of different endpoints with associated enum values
  • Treats test stubs as first-class citizens so unit testing is super-easy
  • In any file you’d like to use Moya in, don’t forget to import the framework with import Moya
  • Add Alamofire, Result & Moya as a git submodule
  • No more typos in URLs. No more missing parameter values. No more messing with parameter encoding

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Moya

Moya Web Site

Other Useful Business Software
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

Build gen AI apps with an all-in-one modern database: MongoDB Atlas

MongoDB Atlas provides built-in vector search and a flexible document model so developers can build, scale, and run gen AI apps without stitching together multiple databases. From LLM integration to semantic search, Atlas simplifies your AI architecture—and it’s free to get started.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Moya!

Additional Project Details

Operating Systems

Apple iPhone, Mac

Programming Language

Swift

Related Categories

Swift Software Development Software, Swift Networking Software

Registered

2021-04-30