Swiftpack.co -  mediamonks/MMMCataphote as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Limited reflection for Swift Decodable types.
.package(url: "https://github.com/mediamonks/MMMCataphote.git", from: "1.0.2")


Limited reflection for Decodable types.

(This is a part of MMMTemple suite of iOS libraries we use at MediaMonks.)

The main objective for this is to be able to automatically generate lists of object fields and child entities to be included into responses when working with JSONAPI-style responses.


  1. there is very limited support for enum fields (only the ones that can decode from a string "dummy");
  2. any dictionary is assumed to have String keys, could be resolved by parsing type names;
  3. it might not work well with Decodables that use custom initializers.



source 'https://github.com/mediamonks/MMMSpecs.git'
source 'https://cdn.cocoapods.org/'
pod 'MMMCataphote'


A quick example here:

import MMMCataphote

struct Person: Decodable {
	let id: Int
	let name: String
	let height: Height

struct Height: Decodable {
	let height: Double


Prints the following:

Object(Person) where:

 - height: Double

 - height: Object(Height)
 - id: Int
 - name: String

I.e. the value returned by MMMCataphote.reflect can be browsed to automatically build the lists of fields or entities to include into JSONAPI-like responses, for example.


Stars: 0
Last commit: 5 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API