swiftlang /
swift-syntax
A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
Loading repository data…
pNre / repository
A set of Swift extensions for standard types and classes.
Set of Swift extensions for standard types and classes.
Because of Xcode errors it's not possible to integrate this project with Cocoapods or as Embedded Framework. Read more at Dev Forum
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 targetcomponents.takeFirst() { $0.completed }
Examples in the Wiki
| 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? |
| Name | Signatures |
|---|---|
range | range <U: ForwardIndex> (range: Range<U>) -> Array<U> |
| 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 |
Examples in the Wiki
| Name |
|---|
NSTimeIntervalyears |
NSTimeIntervalyear |
NSTimeIntervaldays |
NSTimeIntervalday |
NSTimeIntervalhours |
NSTimeIntervalhour |
NSTimeIntervalminutes |
NSTimeIntervalminute |
NSTimeIntervalseconds |
NSTimeIntervalsecond |
| 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>) -> Intclamp (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 |
| Name | Signatures |
|---|---|
random | random(min: Int = 0, max: Int) -> Int |
Examples in the Wiki
| Name | Signature |
|---|---|
abs | abs () -> Float |
sqrt | sqrt () -> Float |
round | round () -> Float |
ceil | ceil () -> Float |
floor | floor () -> Float |
clamp | clamp (min: Float, _ max: Float) -> Float |
| Name | Signatures |
|---|---|
random | random(min: Float = 0, max: Float) -> Float |
Examples in the Wiki
| Name |
|---|
length |
capitalized |
| 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? |
| Name | Signature |
|---|---|
random | func random (var length len: Int = 0, charset: String = "...") -> String |
| 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 |
Examples in the Wiki
| Name | Signatures |
|---|---|
times | times (call: (T) -> ())times (call: () -> ()) |
each | each (call: (T) -> ()) |
toArray | toArray () -> [T] |
| Name | Signature |
|---|---|
random | random (from: Int, to: Int) -> Range<Int> |
| Name | Signature | Function |
|---|---|---|
= | == <U: ForwardIndex> (first: Range<U>, second: Range<U>) -> Bool | Compares 2 ranges |
Examples in the Wiki
| 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 (group |
Selected from shared topics, language and repository description—not editorial ratings.
swiftlang /
A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
ChiliLabs /
A set of cool animated page controls written in Swift to replace boring UIPageControl. Mady by @ChiliLabs - https://chililabs.io
nsomar /
Swiftline is a set of tools to help you create command line applications.
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]] |
MakeAWishFoundation /
Framework for automatic mock generation. Adds a set of handy methods, simplifying testing. One of the best and most complete solutions, including generics support and much more.
HHK1 /
A set of tools to trim, crop and select frames inside a video
marmelroy /
Swift-friendly API for a set of powerful Objective C runtime functions.