OSS TanbouSign in with GitHub

define API endpoints as typed targets and unify networking, stubs, and plugins

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
15,353
Primary language
Swift
License
MIT
Repository last updated
Jul 14, 2026
On this page

Overview

Moya is a Swift networking abstraction built on Alamofire. Endpoints are modeled as enum cases conforming to TargetType, centralizing URLs, HTTP methods, parameter encoding, headers, and sample data while using the same provider API for live requests and stubs.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Model API endpoints as enum cases that conform to TargetType

Each endpoint can define its base URL, path, method, task, headers, and sample data in one typed target. This keeps request construction out of ad hoc view and service code.

Sources: [3]

Use MoyaProvider for both live requests and test stubs

MoyaProvider<Target> sends a target and returns either a Response or MoyaError. Sample data and endpoint configuration make it possible to build stubs around the same TargetType definitions used by live networking.

Sources: [3]

Best fit

Fits iOS applications that want consistent networking conventions across many endpoints

It is useful when teams want URLs, methods, parameters, and headers expressed as typed API definitions while reducing direct Alamofire calls. CombineMoya, RxMoya, and ReactiveMoya are also exposed as package products.

Sources: [2][4]

Before adoption

The latest GitHub release is 15.0.3, so verify compatibility with the current toolchain

Release 15.0.3 was published in 2022. Its Package.swift declares Swift tools 5.3, iOS 10+, and an Alamofire 5 dependency. The repository has 2026 activity, but the long release interval makes it important to verify builds, warnings, and dependency resolution with the Swift and Xcode versions used by the application.

Sources: [5][4][1]

Official sources

  1. [1]Moya/Moya — GitHub repository(2026-10-06)
  2. [2]Moya 15.0.3 — Readme(2026-10-06)
  3. [3]Moya 15.0.3 — Basic Usage(2026-10-06)
  4. [4]Moya 15.0.3 — Package.swift(2026-10-06)
  5. [5]Moya 15.0.3 release(2026-10-06)
  6. [6]Moya MIT license(2026-10-06)
Supplemental curator note

Moya fits iOS applications that want one typed convention for endpoint URLs, methods, parameters, and headers. The latest release is 15.0.3 and is relatively old, so verify it with the Swift/Xcode and Alamofire versions used by your CI before adoption.

Try it in 3 steps

  1. 1

    Add Moya 15.0.3 with SwiftPM

    Pin the reviewed latest GitHub release. The Moya target depends on Alamofire 5.x.

    .package(url: "https://github.com/Moya/Moya.git", exact: "15.0.3")
  2. 2

    Define an API endpoint with TargetType

    Follow the official Basic Usage example and keep URL, path, method, task, and sample data in one typed target.

    import Moya enum MyService { case zen } extension MyService: TargetType { var baseURL: URL { URL(string: "https://api.myservice.com")! } var path: String { "/zen" } var method: Moya.Method { .get } var task: Task { .requestPlain } var headers: [String: String]? { nil } var sampleData: Data { Data("ok".utf8) } }
  3. 3

    Send the target through MoyaProvider

    Retain the provider, send the target, and confirm that the request completes as a Moya Result.

    let provider = MoyaProvider<MyService>() provider.request(.zen) { result in print(result) }
Check the official README

Growth

Growth trends · Last 30 days

15,353 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
0
Open PRs
19

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • swift
  • reactiveswift
  • rxswift
  • alamofire
  • networking
  • hacktoberfest
Stars
15,353
Forks
1,993
Watchers
243
Open issues
159
Contributors
219
Owner type
Organization
Primary language
Swift
License
MIT
Repository last updated
Jul 14, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?