Skip to content
EnumKit is a library that gives you the ability to simply access an enum associated value, without having to use pattern matching. It also offers many utilities available to other swift types, like updatability of an associated value and transformations.
Swift Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
EnumKit.xcodeproj
Sources/EnumKit
Tests add availability constraints for other platforms other than iOS Sep 30, 2019
.gitignore
.swift-version version bump Oct 2, 2019
.travis.yml update travis yml Sep 30, 2019
EnumKit.podspec version bump Oct 2, 2019
LICENSE
Package.swift Add documentation to Combine extension Sep 29, 2019
README.md Update README.md Oct 6, 2019
codecov.yml
enumKit.png Update readme Aug 16, 2019

README.md

EnumKit

Build Status codecov Swift Package Manager cocoapods

EnumKit is a library that gives you the ability to simply access an enum associated value, without having to use pattern matching. It also offers many utilities available to other swift types, like updatability of an associated value and transformations.

EnumKit comes with an extension of Sequence to extend functions like compactMap, flatMap, filter to Sequences of enums cases.

All you need to do to get these features is to declare your enum conformant to the marker protocol CaseAccessible.

enum MyEnum: CaseAccessible { ... }

For more please read our wiki.

Usage

Requirements

V 1.0.0

  • Xcode 10.2
  • Swift 5.0

V 1.1.0

  • Xcode 11
  • Swift 5.1

Installation

EnumKit offers cocoapods and swiftPM

Via Cocoapods

# Podfile
use_frameworks!

target 'YOUR_TARGET_NAME' do
    pod 'EnumKit', '~> 1.1.0'
end

Replace YOUR_TARGET_NAME and then, in the Podfile directory, type:

$ pod install

via Swift Package Manager

Create a Package.swift file.

// swift-tools-version:5.1

import PackageDescription

let package = Package(
  name: "YourProjectName",
  dependencies: [
    .package(url: "https://github.com/gringoireDM/EnumKit.git", from: "1.1.0")
  ],
  targets: [
    .target(name: "YourProjectName", dependencies: ["EnumKit"])
  ]
)
$ swift build

External Resources

You can’t perform that action at this time.