qmetrics.net

Moya

Swift network abstraction over Alamofire

Moya screenshot

Moya wraps Alamofire with a structured layer for HTTP APIs in Swift. Endpoints are expressed as enums so paths, methods, and parameters are checked at compile time.

Overview

Moya targets iOS and broader Apple-platform developers who want a consistent pattern instead of ad hoc API manager classes. It sits above Alamofire and URLSession, encoding routes, parameters, and task types into type-safe endpoint definitions.

Each API surface is typically modeled as an enum conforming to Moya’s target protocol, which reduces typos in URLs and keeps parameter encoding explicit. Test stubs are treated as first-class citizens so unit tests can return canned responses without hitting the network.

Optional flavors integrate ReactiveSwift, RxSwift, and Combine, exposing requests as signals, singles, observables, or publishers with helpers to map JSON, images, or strings and to react to HTTP status codes. Distribution options include Swift Package Manager, CocoaPods, Carthage, and manual Xcode embedding alongside Alamofire.

The project is used in production settings such as Artsy’s auction application and is positioned as a network abstraction that keeps common calls simple while still supporting richer request definitions.

Key features

  • Compile-time endpoint enums
  • Alamofire-backed HTTP requests
  • Built-in test stubbing
  • ReactiveSwift extension
  • RxSwift extension
  • Combine publisher extension
  • Parameter encoding in targets
  • Multi-target provider support

Use cases

  • iOS app REST client structure
  • Unit testing network layers
  • Rx or Combine reactive networking
  • Replacing ad hoc API managers
  • Typed multi-service API clients

Tags

Similar software

FastAPI

Python web framework for building APIs with type hints

FastAPI is a Python web framework for building APIs using standard type hints. It builds on Starlette and Pydantic and generates interactive OpenAPI documentation for the endpoints you define.

★ 105.1k⟳ 9 days agoMIT

NestJS

Progressive TypeScript framework for Node.js backends

Nest organizes Node server apps with modules, dependency injection, and first-party packages for auth, data, queues, and observability.

★ 77.2k⟳ todayMIT

OkHttp

HTTP client for JVM, Android, and GraalVM

OkHttp is an HTTP client library tuned for efficient networking on Android, Java, and GraalVM native images. It offers synchronous and asynchronous call APIs with a fluent request builder.

★ 47.1k⟳ yesterdayApache-2.0
Frameworks & PlatformsDesktop/CLI app

gRPC

Cross-language remote procedure call framework

gRPC is an RPC framework that lets client and server programs communicate transparently and supports building connected, multi-language systems.

★ 45.5k⟳ todayApache-2.0

tRPC

End-to-end typesafe TypeScript APIs without code generation

tRPC helps teams define server procedures and call them from clients with full TypeScript types for inputs, outputs, and errors—no schemas or codegen step.

★ 40.9k⟳ todayMIT
Frameworks & PlatformsDesktop/CLI app

go-zero

Cloud-native Go microservices and RPC framework

go-zero is a Go web and RPC framework with code generation, built-in resilience middleware, and tooling aimed at stable high-traffic services.

★ 33.5k⟳ 9 days agoMIT