A set of Swift extensions for standard types and classes.

Overview

ExSwift

CocoaPods Carthage compatible Build Status

Set of Swift extensions for standard types and classes.

Installation

Because of Xcode errors it's not possible to integrate this project with Cocoapods or as Embedded Framework. Read more at Dev Forum

Use submodule and copy source code

  1. Add ExSwift as a submodule
  2. Open the ExSwift project folder, and drag ExSwift sub folder with source code into the file navigator of your Xcode project. Make sure you select add to target
  3. Use it
components.takeFirst() { $0.completed }

Contents

Extensions

Array

Examples in the Wiki

Instance Methods

Name Signature
first first () -> Element?
last last () -> Element?
get get (index: Int) -> Element?
remove remove <U: Equatable> (element: U)
at at (indexes: Int...) -> Array
take take (n: Int) -> Array
takeWhile takeWhile (condition: (Element) -> Bool) -> Array
takeFirst takeFirst (condition: (Element) -> Bool) -> Element?
tail tail (n: Int) -> Array
skip skip (n: Int) -> Array
skipWhile skipWhile (condition: (Element) -> Bool) -> Array
contains contains <T: Equatable> (item: T...) -> Bool
difference difference <T: Equatable> (values: [T]...) -> [T]
intersection intersection <U: Equatable> (values: [U]...) -> Array
union union <U: Equatable> (values: [U]...) -> Array
unique unique <T: Equatable> () -> [T]
indexOf indexOf <T: Equatable> (item: T) -> Int?
indexOf indexOf (condition: Element -> Bool) -> Int?
lastIndexOf lastIndexOf <T: Equatable> (item: T) -> Int?
zip zip (arrays: Array<Any>...) -> [[Any?]]
partition partition (var n: Int, var step: Int? = nil) -> [Array]
partition (var n: Int, var step: Int? = nil, pad: Element[]?) -> [Array]
partitionAll partitionAll (var n: Int, var step: Int? = nil) -> [Array]
partitionBy partitionBy <T: Equatable> (cond: (Element) -> T) -> [Array]
shuffle shuffle ()
shuffled shuffled () -> Array
sample (random) sample (size n: Int = 1) -> [T]
max max <T: Comparable> () -> T
min min <T: Comparable> () -> T
each each (call: (Element) -> ())
each (call: (Int, Element) -> ())
eachRight eachRight (call: (Element) -> ())
eachRight (call: (Int, Element) -> ())
any any (call: (Element) -> Bool) -> Bool
all all (call: (Element) -> Bool) -> Bool
reject reject (exclude: (Element -> Bool)) -> Array
pop pop() -> Element
push push(newElement: Element)
shift shift() -> Element
unshift unshift(newElement: Element)
insert insert (newArray: Array, atIndex: Int)
groupBy groupBy <U> (groupingFunction group: (Element) -> (U)) -> [U: Array]
countBy countBy <U> (groupingFunction group: (Element) -> (U)) -> [U: Int]
countWhere countWhere (test: (Element) -> Bool) -> Int
reduce reduce (combine: (Element, Element) -> Element) -> Element?
reduceRight reduceRight <U>(initial: U, combine: (U, Element) -> U) -> U
mapFilter mapFilter <V> (mapFunction map: (Element) -> (V)?) -> [V]
implode implode <C: ExtensibleCollection> (separator: C) -> C?
flatten flatten <OutType> () -> [OutType]
flattenAny flattenAny () -> [AnyObject]
toDictionary toDictionary <U> (keySelector:(Element) -> U) -> [U: Element]
toDictionary toDictionary <K, V> (transform: (Element) -> (key: K, value: V)?) -> [K: V]
cycle cycle (n: Int? = nil, block: (T) -> ())
bSearch bSearch (block: (T) -> (Bool)) -> T?
bSearch bSearch (block: (T) -> (Int)) -> T?
sortUsing sortUsing<U:Comparable>(block: ((T) -> U)) -> [T]
transposition transposition (array: [[T]]) -> [[T]]
permutation permutation (length: Int) -> [[T]]
repeatedPermutation repeatedPermutation(length: Int) -> [[T]]
combination combination (length: Int) -> [[Element]]
repeatedCombination repeatedCombination (length: Int) -> [[Element]]

Class Methods

Name Signatures
range range <U: ForwardIndex> (range: Range<U>) -> Array<U>

Operators

Name Signature Function
- - <T: Equatable> (first: Array<T>, second: Array<T>) -> Array<T> Difference
- - <T: Equatable> (first: Array<T>, second: T) -> Array<T> Element removal
& & <T: Equatable> (first: Array<T>, second: Array<T>) -> Array<T> Intersection
| | <T: Equatable> (first: Array, second: Array) -> Array Union
* Int * <ItemType> (array: ItemType[], n: Int) -> [ItemType] Returns a new array built by concatenating int copies of self
* String * (array: String[], separator: String) -> String Equivalent to array.implode(String)
[rangeAsArray: x..y]
[rangeAsArray: x...y]
subscript(#rangeAsArray: Range<Int>) -> Array Returns the sub-array from index x to index y
[x, y, ...] subscript(first: Int, second: Int, rest: Int...) -> Array Returns the items at x, y

Int

Examples in the Wiki

Properties

Name
NSTimeIntervalyears
NSTimeIntervalyear
NSTimeIntervaldays
NSTimeIntervalday
NSTimeIntervalhours
NSTimeIntervalhour
NSTimeIntervalminutes
NSTimeIntervalminute
NSTimeIntervalseconds
NSTimeIntervalsecond

Instance Methods

Name Signatures
times times <T> (call: (Int) -> T)
times <T> (call: () -> T)
times (call: () -> ())
isEven isEven () -> Bool
isOdd idOdd () -> Bool
upTo upTo (limit: Int, call: (Int) -> ())
downTo downTo (limit: Int, call: (Int) -> ())
clamp clamp (range: Range<Int>) -> Int
clamp (min: Int, max: Int) -> Int
isIn isIn (range: Range<Int>, strict: Bool = false) -> Bool
digits digits () -> Array<Int>
abs abs () -> Int
gcd gcd (n: Int) -> Int
lcm lcm (n: Int) -> Int

Class Methods

Name Signatures
random random(min: Int = 0, max: Int) -> Int

Float

Examples in the Wiki

Instance Methods

Name Signature
abs abs () -> Float
sqrt sqrt () -> Float
round round () -> Float
ceil ceil () -> Float
floor floor () -> Float
clamp clamp (min: Float, _ max: Float) -> Float

Class Methods

Name Signatures
random random(min: Float = 0, max: Float) -> Float

String

Examples in the Wiki

Properties

Name
length
capitalized

Instance Methods

Name Signature
explode explode (separator: Character) -> [String]
at at (indexes: Int...) -> [String]
matches matches (pattern: String, ignoreCase: Bool = false) -> [NSTextCheckingResult]?
insert insert (index: Int, _ string: String) -> String
ltrimmed ltrimmed () -> String
ltrimmed ltrimmed (set: NSCharacterSet) -> String
rtrimmed rtrimmed () -> String
rtrimmed rtrimmed (set: NSCharacterSet) -> String
trimmed trimmed () -> String
rtrimmed rtrimmed (set: NSCharacterSet) -> String
toDouble toDouble() -> Double?
toFloat toFloat() -> Float?
toUInt toUInt() -> UInt?
toBool toBool() -> Bool?
toDate toDate(format : String? = "yyyy-MM-dd") -> NSDate?
toDateTime toDateTime(format : String? = "yyyy-MM-dd hh-mm-ss") -> NSDate?

Class Methods

Name Signature
random func random (var length len: Int = 0, charset: String = "...") -> String

Operators

Name Signature
[x] subscript(index: Int) -> String?
[x..y]
[x...y]
subscript(range: Range<Int>) -> String
[x, y, z] subscript (indexes: Int...) -> [String]
S * n * (first: String, second: Int) -> String
=~ =~ (string: String, pattern: String) -> Bool
=~ (string: String, options: (pattern: String, ignoreCase: Bool)) -> Bool
=~ (strings: [String], pattern: String) -> Bool
=~ (strings: [String], options: (pattern: String, ignoreCase: Bool)) -> Bool
|~ |~ (string: String, pattern: String) -> Bool
|~ (string: String, options: (pattern: String, ignoreCase: Bool)) -> Bool

Range

Examples in the Wiki

Instance Methods

Name Signatures
times times (call: (T) -> ())
times (call: () -> ())
each each (call: (T) -> ())
toArray toArray () -> [T]

Class Methods

Name Signature
random random (from: Int, to: Int) -> Range<Int>

Operators

Name Signature Function
= == <U: ForwardIndex> (first: Range<U>, second: Range<U>) -> Bool Compares 2 ranges

Dictionary

Examples in the Wiki

Instance Methods

Name Signatures
difference difference <V: Equatable> (dictionaries: [Key: V]...) -> [Key: V]
union union (dictionaries: [Key: Value]...) -> [Key: Value]
intersection intersection <K, V where K: Equatable, V: Equatable> (dictionaries: [K: V]...) -> [K: V]
has has (key: Key) -> Bool
map map <K, V> (mapFunction map: (Key, Value) -> (K, V)) -> [K: V]
mapFilter mapFilter <K, V> (mapFunction map: (Key, Value) -> (K, V)?) -> [K: V]
mapValues mapValues <V> (mapFunction map: (Key, Value) -> (V)) -> [Key: V]
mapFilterValues mapFilterValues <V> (mapFunction map: (Key, Value) -> V?) -> [Key: V]
each each(eachFunction each: (Key, Value) -> ())
filter filter(testFunction test: (Key, Value) -> Bool) -> [Key: Value]
merge merge (dictionaries: [Key: Value]...) -> [Key: Value]
shift shift () -> (Key, Value)
groupBy groupBy <T> (groupingFunction group: (Key, Value) -> (T)) -> [T: Array<Value>]
countBy countBy <T> (groupingFunction group: (Key, Value) -> (T)) -> [T: Int]
countWhere countWhere (test: (Key, Value) -> (Bool)) -> Int
any any (test: (Key, Value) -> (Bool)) -> Bool
all all (test: (Key, Value) -> (Bool)) -> Bool
reduce reduce <U> (initial: U, combine: (U, Element) -> U) -> U
pick, at pick (keys: [Key]) -> Dictionary
pick (keys: Key...) -> Dictionary
at (keys: Key...) -> Dictionary
toArray toArray <V> (mapFunction map: (Key, Value) -> V) -> [V]

Operators

Name Signature Function
- - <K, V: Equatable> (first: Dictionary<K, V>, second: Dictionary<K, V>) -> Dictionary<K, V> Difference
& & <K, V: Equatable> (first: Dictionary<K, V>, second: Dictionary<K, V>) -> Dictionary<K, V> Intersection
| | <K, V: Equatable> (first: Dictionary<K, V>, second: Dictionary<K, V>) -> Dictionary<K, V> Union

NSArray

Examples in the Wiki

Instance Methods

Name Signatures
cast cast <OutType> () -> [OutType]
flatten flatten <OutType> () -> [OutType]
flattenAny flattenAny () -> [AnyObject]

SequenceOf

The following operations can be performed on sequences and are evaluated lazily. Each operation only takes the data it requires from the source sequence in order to return its result.

The Sequence protocol cannot be extended, hence the following are extensions to SequenceOf. They can be used as follows:

var source: Sequence = ...
var filteredSequence = SequenceOf(source).filter { ... }

Instance Methods

Name Signatures
first first () -> T?
any any (call: (T) -> Bool) -> Bool
get get (index: Int) -> T?
get get (range: Range<Int>) -> SequenceOf<T>
indexOf indexOf <U: Equatable> (item: U) -> Int?
filter filter(include: (T) -> Bool) -> SequenceOf<T>
reject reject (exclude: (T -> Bool)) -> SequenceOf<T>
skipWhile skipWhile(condition:(T) -> Bool) -> SequenceOf<T>
skip skip (n:Int) -> SequenceOf<T>
contains contains<T:Equatable> (item: T) -> Bool
take take (n:Int) -> SequenceOf<T>
takeWhile takeWhile (condition:(T?) -> Bool) -> SequenceOf<T>

Double

Examples in the Wiki

Instance Methods

Name Signature
abs abs () -> Double
sqrt sqrt () -> Double
round round () -> Double
ceil ceil () -> Double
floor floor () -> Double
clamp clamp (min: Double, _ max: Double) -> Double
roundToNearest roundToNearest(increment: Double) -> Double

Class Methods

Name Signatures
random random(min: Double = 0, max: Double) -> Double

NSDate

Properties

Name Signatures
year Int
month Int
weekday Int
weekMonth Int
days Int
hours Int
minutes Int
seconds Int

Instance Methods

Name Signatures
add add(seconds:Int=0, minutes:Int = 0, hours:Int = 0, days:Int = 0, weeks:Int = 0, months:Int = 0, years:Int = 0) -> NSDate
addSeconds addSeconds (seconds:Int) -> NSDate
addMinutes addMinutes (minute:Int) -> NSDate
addHours addHours(hours:Int) -> NSDate
addDays addDays(days:Int) -> NSDate
addWeeks addWeeks(weeks:Int) -> NSDate
addMonths addMonths(months:Int) -> NSDate
addYears addYears(years:Int) -> NSDate
isAfter isAfter(date: NSDate) -> Bool
isBefore isBefore(date: NSDate) -> Bool
getComponent getComponent (component : NSCalendarUnit) -> Int

Operators

Name Signatures
== ==(lhs: NSDate, rhs: NSDate) -> Bool
< <(lhs: NSDate, rhs: NSDate) -> Bool
> >(lhs: NSDate, rhs: NSDate) -> Bool
<= <=(lhs: NSDate, rhs: NSDate) -> Bool
>= >=(lhs: NSDate, rhs: NSDate) -> Bool
== ==(lhs: NSDate, rhs: NSDate) -> Bool

Utilities

Examples in the Wiki

Class Methods

Name Signatures
after after <P, T> (n: Int, function: P -> T) -> (P -> T?)
func after <T> (n: Int, function: () -> T) -> (() -> T?)
once once <P, T> (function: P -> T) -> (P -> T?)
once <T> (call: Void -> T) -> (Void -> T?)
partial partial <P, T> (function: (P...) -> T, _ parameters: P...) -> ((P...) -> T?)
bind bind <P, T> (function: (P...) -> T, _ parameters: P...) -> (() -> T)
cached cached <P, R> (function: P -> R) -> (P -> R)
cached <P, R> (function: (P...) -> R) -> ((P...) -> R)
cached <P, R> (function: (P...) -> R, hash: ((P...) -> P)) -> ((P...) -> R)

Operators

Name Signatures
<=> <=> <T: Comparable>(lhs: T, rhs: T) -> Int

To Do

  • Wiki
  • Xcode project for both iOS & OS X
  • Review code comments
  • Example project
  • Installation instructions
  • Benchmark
Comments
  • Add partition, partitionAll, and partitionBy

    Add partition, partitionAll, and partitionBy

    I've found these functions fairly useful during my Clojure days! You said in the last pull request that it took you some hijinks to get the project to build, how is it you did that? I'm still writing my tests via copying code into another project since this won't build hah.

    partition produces an array of arrays, each containing n elements, each offset by step (optional). It also allows an optional padding array which will attempt to fill the last partition to n elements if short.

    partitionAll allows the last partition to be less than n elements long without using padding elements.

    partitionBy applies a condition to each element in array, splitting it each time the condition returns a new value.

    opened by zolrath 10
  • Format Number

    Format Number

    Hi,

    I have added a simple method to format numbers (Double, Int, Float) using a NSNumberFormatter saved as a class var in a new class ExSwiftFormatter because formatters are expensive to create.

    Tell me if you are interested in this PR before merging, I will add doc and update the readme.

    I have also added a NSNumberFormatter extension to set the formatter precision.

    formatter.setPrecision(3)
    

    instead of

    formatter.minimumFractionDigits = 3
    formatter.maximumFractionDigits = 3
    
    var price:Double = 12356789.424
    var formatter = ExSwiftFormatter.numberFormatter
    formatter.numberStyle = .DecimalStyle
    formatter.setPrecision(3)
    price.format() // "12,356,789.424"
    
    formatter.numberStyle = .CurrencyStyle
    price.format() // "$12,356,789.424"
    

    If you agree I would like to add other formatters and also unit converters

    opened by PGLongo 8
  • Transpose

    Transpose

    This needs to be turned into a method that transposes the array it's called on, but I can't figure out how to enforce that the array be composed of arrays, similar to how we enforce that an array be composed of Equatables when we call unique() on it. Any ideas?

    opened by michaeleisel 8
  • Added count methods

    Added count methods

    Hey!

    I added one method (both in Dictionary and Array) in order to count elements meeting a criteria.

    Maybe the name is not the best (possible conflicts with count standard property), but I think the idea is worth

    Thanks!

    opened by jmnavarro 6
  • Swift 3 vs ExSwift.swift

    Swift 3 vs ExSwift.swift

    Swift3 tip, not a bug

    This code give operator warning: "operator should not be with body"

    infix operator =~ {} infix operator |~ {} infix operator .. {} infix operator <=> {}

    Commenting/Removing brackets solve the warning.

    opened by arodeus 5
  • NSDate.addDays does not work on ios7

    NSDate.addDays does not work on ios7

    change add to below works

    public func add(seconds: Int = 0, minutes: Int = 0, hours: Int = 0, days: Int = 0, weeks: Int = 0, months: Int = 0, years: Int = 0) -> NSDate {
        var calendar = NSCalendar.currentCalendar()
        let version = floor(NSFoundationVersionNumber)
        if ( version <= NSFoundationVersionNumber_iOS_7_1 || version <= NSFoundationVersionNumber10_9_2  ) {
            var component = NSDateComponents()
            component.second = seconds
            component.minute = minutes
            component.hour = hours
            component.day = days + weeks * 7
            component.month = months
            component.year = years
            return calendar.dateByAddingComponents(component, toDate: self, options: nil)!
        }
    
        var date : NSDate! = calendar.dateByAddingUnit(.CalendarUnitSecond, value: seconds, toDate: self, options: nil)
        date = calendar.dateByAddingUnit(.CalendarUnitMinute, value: minutes, toDate: date, options: nil)
        date = calendar.dateByAddingUnit(.CalendarUnitDay, value: days, toDate: date, options: nil)
        date = calendar.dateByAddingUnit(.CalendarUnitHour, value: hours, toDate: date, options: nil)
        date = calendar.dateByAddingUnit(.CalendarUnitWeekOfMonth, value: weeks, toDate: date, options: nil)
        date = calendar.dateByAddingUnit(.CalendarUnitMonth, value: months, toDate: date, options: nil)
        date = calendar.dateByAddingUnit(.CalendarUnitYear, value: years, toDate: date, options: nil)
        return date
    }
    
    opened by xinwo 5
  • Swift Compile Error on Xcode 6.1

    Swift Compile Error on Xcode 6.1

    My project won't compile onXcode 6.1. It gives me a bunch of errors on the Array.swift in the methods declarations. (Extension of generic type 'Array' from a different module cannot provide public declarations)

    Does anyone know what needs to be changed?

    opened by Lukaz32 5
  • Add takeWhile and skipWhile to Array

    Add takeWhile and skipWhile to Array

    takeWhile and skipWhile allow taking or skipping array elements that meet a given condition.

    (I'd rename skip to drop in order to match the function names of other languages but I'll leave that decision up to you)

    [1, 2, 3, 4, 5, 2].takeWhile { $0 < 4 }
    // → [1, 2, 3]
    
    [1, 2, 3, 4, 5, 2].skipWhile { $0 < 4 }
    // → [4, 5, 2]
    
    opened by zolrath 5
  • Issue with Ayn's fork

    Issue with Ayn's fork

    @ayn thanks so much for creating a fork that works on later versions of Swift, but unfortunately I get lots of errors, like "availability has been replaced with available", any ideas?

    opened by michaeleisel 4
  • Array.get() wraps if index out of bounds

    Array.get() wraps if index out of bounds

    As a developer becomes familiar with Swift, they will likely find it strange that Apple would provide optional accessors on all of their data structures (which play nicely with the "if let" idiom), with the singular exception of Array.

    Instead of being able to do this:

    if let foo = array[3]
    {
        // do something with foo
    }
    

    Instead you have to do something which feels clumsy in comparison:

    if array.count > 3
    {
        let foo = array[3]!
        // do something with foo
    }
    

    Writing an optional accessor seems a very obvious thing to do, to make Array fit better with the style of the rest of the language.

    So I was quite shocked to discover that your "get()" method automatically wraps an out-of-bounds index, and that this behavior was intentional. I'm just having trouble wrapping my head around it.

    Who would expect out-of-bounds index wrapping to be the default behavior of a method named "get()"?

    If someone needed the (somewhat uncommon) behavior of out-of-bounds index wrapping, why would they want to hide that implementation detail behind a method call, instead of doing something explicit which calls better attention to it, like "array.get(index % array.count)"?

    If they insist on hiding the behavior behind a method call, why wouldn't they choose a method name which at least hints at the behavior, like maybe .wrappedGet()?

    This behavior and this method name just don't belong together.

    opened by cellularmitosis 4
  • Add getter and comparison to NSDate

    Add getter and comparison to NSDate

    Hi,

    I have added getters to NSDate. Now you can do:

    let date = NSDate()
    let year = date.year
    

    instead of

    let date = NSDate()
    let calendar = NSCalendar.currentCalendar()
    let components = calendar.components(.CalendarUnitYear, fromDate: date)
    let year = components.year
    

    I have also added Comparison operator: <, <=, >, >=, == and updated the docs and README.md

    opened by PGLongo 4
  • Swift 3

    Swift 3

    I know this is no longer maintained, but just submitting this PR so others can try my swift 3 branch if you need this stuff to continue to work. I’ll push to my branch if I have more fixes.

    opened by ayn 8
  • Correct the spelling of CocoaPods in README

    Correct the spelling of CocoaPods in README

    This pull requests corrects the spelling of CocoaPods 🤓 https://github.com/CocoaPods/shared_resources/tree/master/media

    opened by ReadmeCritic 0
  • Suggestion for Boolean Extension methods(Smalltalk style conditionals)

    Suggestion for Boolean Extension methods(Smalltalk style conditionals)

    Well lately I've been reading a book about smalltalk, and I find its object oriented boolean class very impressive, and it's the truly object oriented way to handle conditionals. A sample of smalltalk's conditionals is show below:

    aBoolean
    ifTrue: [someCode]
    ifFalse: [otherCode]
    

    In swift, the syntax can be something like this:

    aBooolean.ifTrue{
    
    }.ifFalse{
    
    }
    

    I tried to implement this in a C# library I am working on, but the language of C# has limitations on closure that you have to pass closure with syntax ifTrue(() => {}), rather than just ifTrue{}, which is a bit inconvenient. In Smalltalk, I know that it's possible to remove the parenthesis and arrow sign if closure is the last parameter in a function/method, which is very neat.

    So what do you think? Will you consider implementing the extension methods ifTrue{} and ifFalse{} for boolean?

    opened by HallofFamer 1
  • Swift 2 update issue

    Swift 2 update issue

    Hi, in NSArray.swift class there's a problem due to swift update. In fact in flatten function says "reflect is unavailable: call the Mirror(reflecting: ) initializer"

    opened by MaxFrax 6
Releases(v0.2.0)
Owner
Pierluigi D'Andrea
Pierluigi D'Andrea
A functional utility belt implemented as Swift 2.0 protocol extensions.

Oriole [![CI Status](http://img.shields.io/travis/Tyler Thompson/Oriole.svg?style=flat)](https://travis-ci.org/Tyler Thompson/Oriole) Oriole is a set

Tyler Paul Thompson 11 Aug 10, 2019
Swift µframework with extensions for the Optional Type

OptionalExtensions Why? Swift's Optional is pretty awesome, but it can always get better. This repository is an humble attempt to add some utility met

Rui Peres 183 Dec 15, 2022
Functional chaining and promises in Swift

Forbind Functional chaining and promises in Swift Note: still in an experimental state. Everything could change. I would love some feedback on this. W

Ulrik Flænø Damm 45 Sep 1, 2022
Functional programming tools and experiments in Swift.

Funky The documentation (courtesy of realm/jazzy) is available here: https://brynbellomy.github.io/Funky Master branch is currently compatible with: S

Bryn Bellomy 12 May 2, 2017
Collection of must-have functional Swift tools

NOTE: This project has been merged with and superceded by Rob Rix's Result µframework. LlamaKit Collection of must-have functional tools. Trying to be

null 619 Aug 5, 2022
Swift µframework of simple functional programming tools

Prelude This is a Swift µframework providing a number of simple functions that I use in many of my other frameworks. Rather than continue to reimpleme

Rob Rix 405 Jun 29, 2022
Functional programming in Swift

Swiftz Swiftz is a Swift library for functional programming. It defines functional data structures, functions, idioms, and extensions that augment the

TypeLift 3.3k Dec 25, 2022
Functional JSON parsing library for Swift

Argo Argo is a library that lets you extract models from JSON or similar structures in a way that's concise, type-safe, and easy to extend. Using Argo

thoughtbot, inc. 3.5k Jan 7, 2023
Infix operators for monadic functions in Swift

Indecipherable symbols that some people claim have actual meaning. Please see the documentation for installation instructions. What's included? Import

thoughtbot, inc. 825 Dec 7, 2022
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift

Bow is a cross-platform library for Typed Functional Programming in Swift. Documentation All documentation and API reference is published in our websi

Bow 613 Dec 20, 2022
Functional programming in Swift

Swiftz Swiftz is a Swift library for functional programming. It defines functional data structures, functions, idioms, and extensions that augment the

TypeLift 3.3k Jan 6, 2023
A set of Swift extensions for standard types and classes.

ExSwift Set of Swift extensions for standard types and classes. Installation Because of Xcode errors it's not possible to integrate this project with

Pierluigi D'Andrea 3.4k Dec 27, 2022
Extensions for Swift Standard Types and Classes

Cent Cent is a library that extends certain Swift object types using the extension feature and gives its two cents to Swift language. Dollar is a Swif

Ankur Patel 225 Dec 7, 2022
How Swift standard types and classes were supposed to work.

How Swift standard types and classes were supposed to work. A collection of useful extensions for the Swift Standard Library, Foundation, and UIKit.

Goktug Yilmaz 3k Dec 22, 2022
A set of extensions and utilities to work with CoreVideo types.

core-video-tools A set of extensions and utilities to work with CoreVideo types. CVPixelFormat While debuging Core Video objects, you need to understa

eugene 6 Dec 30, 2022
Extensions and classes in Swift that make it easy to get an iOS device reading and processing MIDI data

MorkAndMIDI A really thin Swift layer on top of CoreMIDI that opens a virtual MIDI destination and port and connects to any MIDI endpoints that appear

Brad Howes 11 Nov 5, 2022
A Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and other native frameworks.

ZamzamKit ZamzamKit is a Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and othe

Zamzam Inc. 261 Dec 15, 2022
A μframework of extensions for SequenceType in Swift 2.0, inspired by Python's itertools, Haskell's standard library, and other things.

SwiftSequence Full reference here. (If you're looking for data structures in Swift, those have been moved to here) SwiftSequence is a lightweight fram

Donnacha Oisín Kidney 376 Oct 12, 2022
BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.

Features • Classes and Extensions Compatibility • Requirements • Communication • Contributing • Installing and Usage • Documentation • Changelog • Exa

Fabrizio Brancati 992 Dec 2, 2022
A set of helper classes and functions in Swift

SwiftTools This is a set of tools written in Swift that add some sugar and some small functionality. Mainly meant for small projects and scripts, as a

Vinicius Vendramini 0 Dec 13, 2021