{"id":13396590,"url":"https://github.com/pNre/ExSwift","last_synced_at":"2025-03-13T23:31:30.065Z","repository":{"id":17648270,"uuid":"20452776","full_name":"pNre/ExSwift","owner":"pNre","description":"A set of Swift extensions for standard types and classes.","archived":true,"fork":false,"pushed_at":"2019-02-11T00:45:31.000Z","size":2391,"stargazers_count":3376,"open_issues_count":37,"forks_count":318,"subscribers_count":148,"default_branch":"master","last_synced_at":"2024-10-20T16:03:39.221Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pNre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-03T17:40:32.000Z","updated_at":"2024-10-15T09:38:30.000Z","dependencies_parsed_at":"2022-09-02T22:01:01.888Z","dependency_job_id":null,"html_url":"https://github.com/pNre/ExSwift","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pNre%2FExSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pNre%2FExSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pNre%2FExSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pNre%2FExSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pNre","download_url":"https://codeload.github.com/pNre/ExSwift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243500069,"owners_count":20300740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T18:00:57.572Z","updated_at":"2025-03-13T23:31:29.763Z","avatar_url":"https://github.com/pNre.png","language":"Swift","readme":"# ExSwift\n![CocoaPods](https://img.shields.io/cocoapods/v/ExSwift.svg) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/pNre/ExSwift.svg)](https://travis-ci.org/pNre/ExSwift)\n\nSet of Swift extensions for standard types and classes.\n\n# Installation\n\nBecause of Xcode errors it's not possible to integrate this project with Cocoapods or as Embedded Framework.\n[Read more at Dev Forum](https://devforums.apple.com/message/983747#983747)\n\n## Use submodule and copy source code\n1. Add ExSwift as a submodule\n2. 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\n3. Use it\n\n``` swift\ncomponents.takeFirst() { $0.completed }\n```\n\n## Contents ##\n\n- [ExSwift extensions](#extensions)\n\t- [Array](#array)\n    \t- [Instance Methods](#instance-methods)\n\t\t- [Class Methods](#class-methods)\n\t\t- [Operators](#operators)\n    - [Int](#int)\n       - [Properties](#properties)\n    \t- [Instance Methods](#instance-methods-1)\n    \t- [Class Methods](#class-methods-1)\n    - [Float](#float)\n    \t- [Instance Methods](#instance-methods-2)\n    \t- [Class Methods](#class-methods-2)\n    - [String](#string)\n    \t- [Properties](#properties-1)\n    \t- [Instance Methods](#instance-methods-3)\n\t\t- [Class Methods](#class-methods-3)\n\t\t- [Operators](#operators-1)\n    - [Range](#range)\n    \t- [Instance Methods](#instance-methods-4)\n    \t- [Class Methods](#class-methods-4)\n    \t- [Operators](#operators-2)\n    - [Dictionary](#dictionary)\n    \t- [Instance Methods](#instance-methods-5)\n    \t- [Operators](#operators-3)\n    - [NSArray](#nsarray)\n    \t- [Instance Methods](#instance-methods-6)\n   \t- [SequenceOf](#sequenceof)\n    \t- [Instance Methods](#instance-methods-7)\n\t- [Double](#double)\n\t\t- [Instance Methods](#instance-methods-8)\n\t\t- [Class Methods](#class-methods-5)\n\t- [NSDate](#nsdate)\n\t\t- [Instance Methods](#instance-methods-9)\n\t\t- [Operators](#operators-4)\n\n- [Utilities](#utilities)\n\t- [Class Methods](#class-methods-6)\n\t- [Operators](#operators-5)\n\n# Extensions #\n\n## Array ##\n\nExamples in the [Wiki](https://github.com/pNre/ExSwift/wiki/Array)\n\n#### Instance Methods ####\n\nName | Signature\n---- | ---------\n**`first`**|`first () -\u003e Element?`\n**`last`**|`last () -\u003e Element?`\n**`get`**|`get (index: Int) -\u003e Element?`\n**`remove`**|`remove \u003cU: Equatable\u003e (element: U)`\n**`at`**|`at (indexes: Int...) -\u003e Array`\n**`take`**|`take (n: Int) -\u003e Array`\n**`takeWhile`**|`takeWhile (condition: (Element) -\u003e Bool) -\u003e Array`\n**`takeFirst`**|`takeFirst (condition: (Element) -\u003e Bool) -\u003e Element?`\n**`tail`**|`tail (n: Int) -\u003e Array`\n**`skip`**|`skip (n: Int) -\u003e Array`\n**`skipWhile`**|`skipWhile (condition: (Element) -\u003e Bool) -\u003e Array`\n**`contains`**|`contains \u003cT: Equatable\u003e (item: T...) -\u003e Bool`\n**`difference`**|`difference \u003cT: Equatable\u003e (values: [T]...) -\u003e [T]`\n**`intersection`**|`intersection \u003cU: Equatable\u003e (values: [U]...) -\u003e Array`\n**`union`**|`union \u003cU: Equatable\u003e (values: [U]...) -\u003e Array`\n**`unique`**|`unique \u003cT: Equatable\u003e () -\u003e [T]`\n**`indexOf`**|`indexOf \u003cT: Equatable\u003e (item: T) -\u003e Int?`\n**`indexOf`**|`indexOf (condition: Element -\u003e Bool) -\u003e Int?`\n**`lastIndexOf`**|`lastIndexOf \u003cT: Equatable\u003e (item: T) -\u003e Int?`\n**`zip`**|`zip (arrays: Array\u003cAny\u003e...) -\u003e [[Any?]]`\n**`partition`**|`partition (var n: Int, var step: Int? = nil) -\u003e [Array]`\u003cbr\u003e`partition (var n: Int, var step: Int? = nil, pad: Element[]?) -\u003e [Array]`\n**`partitionAll`**|`partitionAll (var n: Int, var step: Int? = nil) -\u003e [Array]`\n**`partitionBy`**|`partitionBy \u003cT: Equatable\u003e (cond: (Element) -\u003e T) -\u003e [Array]`\n**`shuffle`**|`shuffle ()`\n**`shuffled`**|`shuffled () -\u003e Array`\n**`sample`** *(random)*|`sample (size n: Int = 1) -\u003e [T]`\n**`max`**|`max \u003cT: Comparable\u003e () -\u003e T`\n**`min`**|`min \u003cT: Comparable\u003e () -\u003e T`\n**`each`**|`each (call: (Element) -\u003e ())`\u003cbr\u003e`each (call: (Int, Element) -\u003e ())`\n**`eachRight`**|`eachRight (call: (Element) -\u003e ())`\u003cbr\u003e`eachRight (call: (Int, Element) -\u003e ())`\n**`any`**|`any (call: (Element) -\u003e Bool) -\u003e Bool`\n**`all`**|`all (call: (Element) -\u003e Bool) -\u003e Bool`\n**`reject`**|`reject (exclude: (Element -\u003e Bool)) -\u003e Array`\n**`pop`**|`pop() -\u003e Element`\n**`push`**|`push(newElement: Element)`\n**`shift`**|`shift() -\u003e Element`\n**`unshift`**|`unshift(newElement: Element)`\n**`insert`**|`insert (newArray: Array, atIndex: Int)`\n**`groupBy`**|`groupBy \u003cU\u003e (groupingFunction group: (Element) -\u003e (U)) -\u003e [U: Array]`\n**`countBy`**|`countBy \u003cU\u003e (groupingFunction group: (Element) -\u003e (U)) -\u003e [U: Int]`\n**`countWhere`**|`countWhere (test: (Element) -\u003e Bool) -\u003e Int`\n**`reduce`**|`reduce (combine: (Element, Element) -\u003e Element) -\u003e Element?`\n**`reduceRight`**|`reduceRight \u003cU\u003e(initial: U, combine: (U, Element) -\u003e U) -\u003e U`\n**`mapFilter`**|`mapFilter \u003cV\u003e (mapFunction map: (Element) -\u003e (V)?) -\u003e [V]`\n**`implode`**|`implode \u003cC: ExtensibleCollection\u003e (separator: C) -\u003e C?`\n**`flatten`**|`flatten \u003cOutType\u003e () -\u003e [OutType]`\n**`flattenAny`**|`flattenAny () -\u003e [AnyObject]`\n**`toDictionary`**|`toDictionary \u003cU\u003e (keySelector:(Element) -\u003e U) -\u003e [U: Element]`\n**`toDictionary`**|`toDictionary \u003cK, V\u003e (transform: (Element) -\u003e (key: K, value: V)?) -\u003e [K: V]`\n**`cycle`**|`cycle (n: Int? = nil, block: (T) -\u003e ())`\n**`bSearch`**|`bSearch (block: (T) -\u003e (Bool)) -\u003e T?`\n**`bSearch`**|`bSearch (block: (T) -\u003e (Int)) -\u003e T?`\n**`sortUsing`**|`sortUsing\u003cU:Comparable\u003e(block: ((T) -\u003e U)) -\u003e [T]`\n**`transposition`**|`transposition (array: [[T]]) -\u003e [[T]]`\n**`permutation`**|`permutation (length: Int) -\u003e [[T]]`\n**`repeatedPermutation`**|`repeatedPermutation(length: Int) -\u003e [[T]]`\n**`combination`**|`combination (length: Int) -\u003e [[Element]]`\n**`repeatedCombination `**|`repeatedCombination (length: Int) -\u003e [[Element]]`\n\n#### Class Methods ####\n\nName | Signatures\n---- | ----------\n**`range`**|`range \u003cU: ForwardIndex\u003e (range: Range\u003cU\u003e) -\u003e Array\u003cU\u003e`\n\n#### Operators ####\nName | Signature | Function\n---- | --------- | --------\n`-`|`- \u003cT: Equatable\u003e (first: Array\u003cT\u003e, second: Array\u003cT\u003e) -\u003e Array\u003cT\u003e`|Difference\n`-`|`- \u003cT: Equatable\u003e (first: Array\u003cT\u003e, second: T) -\u003e Array\u003cT\u003e`|Element removal\n`\u0026`|`\u0026 \u003cT: Equatable\u003e (first: Array\u003cT\u003e, second: Array\u003cT\u003e) -\u003e Array\u003cT\u003e`|Intersection\n\u003ccode\u003e\u0026#124;\u003c/code\u003e|\u003ccode\u003e\u0026#124; \u003cT: Equatable\u003e (first: Array\u003cT\u003e, second: Array\u003cT\u003e) -\u003e Array\u003cT\u003e\u003c/code\u003e|Union\n`* Int`|`* \u003cItemType\u003e (array: ItemType[], n: Int) -\u003e [ItemType]`|Returns a new array built by concatenating int copies of self\n`* String`|`* (array: String[], separator: String) -\u003e String`|Equivalent to `array.implode(String)`\n`[rangeAsArray: x..y]`\u003cbr\u003e`[rangeAsArray: x...y]`|`subscript(#rangeAsArray: Range\u003cInt\u003e) -\u003e Array`|Returns the sub-array from index *x* to index *y*\n`[x, y, ...]`|`subscript(first: Int, second: Int, rest: Int...) -\u003e Array`|Returns the items at *x*, *y*\n\n## Int ##\n\nExamples in the [Wiki](https://github.com/pNre/ExSwift/wiki/Int)\n\n#### Properties ####\nName |\n---- |\n`NSTimeInterval`**`years`**|\n`NSTimeInterval`**`year`**|\n`NSTimeInterval`**`days`**|\n`NSTimeInterval`**`day`**|\n`NSTimeInterval`**`hours`**|\n`NSTimeInterval`**`hour`**|\n`NSTimeInterval`**`minutes`**|\n`NSTimeInterval`**`minute`**|\n`NSTimeInterval`**`seconds`**|\n`NSTimeInterval`**`second`**|\n\n#### Instance Methods ####\n\nName | Signatures\n---- | ----------\n**`times`**|`times \u003cT\u003e (call: (Int) -\u003e T)`\u003cbr\u003e`times \u003cT\u003e (call: () -\u003e T)`\u003cbr\u003e`times (call: () -\u003e ())`\n**`isEven`**|`isEven () -\u003e Bool`\n**`isOdd`**|`idOdd () -\u003e Bool`\n**`upTo`**|`upTo (limit: Int, call: (Int) -\u003e ())`\n**`downTo`**|`downTo (limit: Int, call: (Int) -\u003e ())`\n**`clamp`**|`clamp (range: Range\u003cInt\u003e) -\u003e Int`\u003cbr\u003e`clamp (min: Int, max: Int) -\u003e Int`\n**`isIn`**|`isIn (range: Range\u003cInt\u003e, strict: Bool = false) -\u003e Bool`\n**`digits`**|`digits () -\u003e Array\u003cInt\u003e`\n**`abs`**|`abs () -\u003e Int`\n**`gcd`**|`gcd (n: Int) -\u003e Int`\n**`lcm`**|`lcm (n: Int) -\u003e Int`\n\n#### Class Methods ####\n\nName | Signatures\n---- | ----------\n**`random`**|`random(min: Int = 0, max: Int) -\u003e Int`\n\n\n## Float ##\n\nExamples in the [Wiki](https://github.com/pNre/ExSwift/wiki/Float)\n\n#### Instance Methods ####\n\nName | Signature\n---- | ---------\n**`abs`**|`abs () -\u003e Float`\n**`sqrt`**|`sqrt () -\u003e Float`\n**`round`**|`round () -\u003e Float`\n**`ceil`**|`ceil () -\u003e Float`\n**`floor`**|`floor () -\u003e Float`\n**`clamp`**|`clamp (min: Float, _ max: Float) -\u003e Float`\n\n#### Class Methods ####\n\nName | Signatures\n---- | ----------\n**`random`**|`random(min: Float = 0, max: Float) -\u003e Float`\n\n## String ##\n\nExamples in the [Wiki](https://github.com/pNre/ExSwift/wiki/String)\n\n#### Properties ####\nName |\n---- |\n**`length`**|\n**`capitalized`**|\n\n#### Instance Methods ####\n\nName | Signature\n---- | ---------\n**`explode`**|`explode (separator: Character) -\u003e [String]`\n**`at`**|`at (indexes: Int...) -\u003e [String]`\n**`matches`**|`matches (pattern: String, ignoreCase: Bool = false) -\u003e [NSTextCheckingResult]?`\n**`insert`**|`insert (index: Int, _ string: String) -\u003e String`\n**`ltrimmed`**|`ltrimmed () -\u003e String`\n**`ltrimmed`**|`ltrimmed (set: NSCharacterSet) -\u003e String`\n**`rtrimmed`**|`rtrimmed () -\u003e String`\n**`rtrimmed`**|`rtrimmed (set: NSCharacterSet) -\u003e String`\n**`trimmed`**|`trimmed () -\u003e String`\n**`rtrimmed`**|`rtrimmed (set: NSCharacterSet) -\u003e String`\n**`toDouble`**|`toDouble() -\u003e Double?`\n**`toFloat`**|`toFloat() -\u003e Float?`\n**`toUInt`**|`toUInt() -\u003e UInt?`\n**`toBool`**|`toBool() -\u003e Bool?`\n**`toDate`**|`toDate(format : String? = \"yyyy-MM-dd\") -\u003e NSDate?`\n**`toDateTime`**|`toDateTime(format : String? = \"yyyy-MM-dd hh-mm-ss\") -\u003e NSDate?`\n\n\n#### Class Methods ####\n\nName | Signature\n---- | ---------\n**`random`**|`func random (var length len: Int = 0, charset: String = \"...\") -\u003e String`\n\n#### Operators ####\nName | Signature\n---- | ---------\n`[x]`|`subscript(index: Int) -\u003e String?`\n`[x..y]`\u003cbr\u003e`[x...y]`|`subscript(range: Range\u003cInt\u003e) -\u003e String`\n`[x, y, z]`|`subscript (indexes: Int...) -\u003e [String]`\n`S * n`|`* (first: String, second: Int) -\u003e String`\n`=~`|`=~ (string: String, pattern: String) -\u003e Bool`\u003cbr\u003e`=~ (string: String, options: (pattern: String, ignoreCase: Bool)) -\u003e Bool`\u003cbr\u003e`=~ (strings: [String], pattern: String) -\u003e Bool`\u003cbr\u003e`=~ (strings: [String], options: (pattern: String, ignoreCase: Bool)) -\u003e Bool`\n\u003ccode\u003e\u0026#124;~\u003c/code\u003e|\u003ccode\u003e\u0026#124;~ (string: String, pattern: String) -\u003e Bool\u003c/code\u003e\u003cbr\u003e\u003ccode\u003e\u0026#124;~ (string: String, options: (pattern: String, ignoreCase: Bool)) -\u003e Bool\u003c/code\u003e\n\n## Range ##\n\nExamples in the [Wiki](https://github.com/pNre/ExSwift/wiki/Range)\n\n#### Instance Methods ####\n\nName | Signatures\n---- | ----------\n**`times`**|`times (call: (T) -\u003e ())`\u003cbr\u003e`times (call: () -\u003e ())`\n**`each`**|`each (call: (T) -\u003e ())`\n**`toArray`**|`toArray () -\u003e [T]`\n\n#### Class Methods ####\n\nName | Signature\n---- | ---------\n**`random`**|`random (from: Int, to: Int) -\u003e Range\u003cInt\u003e`\n\n#### Operators ####\nName | Signature|Function\n---- | ---------|--------\n`=`|`== \u003cU: ForwardIndex\u003e (first: Range\u003cU\u003e, second: Range\u003cU\u003e) -\u003e Bool`|Compares 2 ranges\n\n## Dictionary ##\n\nExamples in the [Wiki](https://github.com/pNre/ExSwift/wiki/Dictionary)\n\n#### Instance Methods ####\n\nName | Signatures\n---- | ----------\n**`difference`**|`difference \u003cV: Equatable\u003e (dictionaries: [Key: V]...) -\u003e [Key: V]`\n**`union`**|`union (dictionaries: [Key: Value]...) -\u003e [Key: Value]`\n**`intersection`**|`intersection \u003cK, V where K: Equatable, V: Equatable\u003e (dictionaries: [K: V]...) -\u003e [K: V]`\n**`has`**|`has (key: Key) -\u003e Bool`\n**`map`**|`map \u003cK, V\u003e (mapFunction map: (Key, Value) -\u003e (K, V)) -\u003e [K: V]`\n**`mapFilter`**|`mapFilter \u003cK, V\u003e (mapFunction map: (Key, Value) -\u003e (K, V)?) -\u003e [K: V]`\n**`mapValues`**|`mapValues \u003cV\u003e (mapFunction map: (Key, Value) -\u003e (V)) -\u003e [Key: V]`\n**`mapFilterValues`**|`mapFilterValues \u003cV\u003e (mapFunction map: (Key, Value) -\u003e V?) -\u003e [Key: V]`\n**`each`**|`each(eachFunction each: (Key, Value) -\u003e ())`\n**`filter`**|`filter(testFunction test: (Key, Value) -\u003e Bool) -\u003e [Key: Value]`\n**`merge`**|`merge (dictionaries: [Key: Value]...) -\u003e [Key: Value]`\n**`shift`**|`shift () -\u003e (Key, Value)`\n**`groupBy`**|`groupBy \u003cT\u003e (groupingFunction group: (Key, Value) -\u003e (T)) -\u003e [T: Array\u003cValue\u003e]`\n**`countBy`**|`countBy \u003cT\u003e (groupingFunction group: (Key, Value) -\u003e (T)) -\u003e [T: Int]`\n**`countWhere`**|`countWhere (test: (Key, Value) -\u003e (Bool)) -\u003e Int`\n**`any`**|`any (test: (Key, Value) -\u003e (Bool)) -\u003e Bool`\n**`all`**|`all (test: (Key, Value) -\u003e (Bool)) -\u003e Bool`\n**`reduce`**|`reduce \u003cU\u003e (initial: U, combine: (U, Element) -\u003e U) -\u003e U`\n**`pick`, `at`**|`pick (keys: [Key]) -\u003e Dictionary`\u003cbr\u003e`pick (keys: Key...) -\u003e Dictionary`\u003cbr\u003e`at (keys: Key...) -\u003e Dictionary`\n**`toArray`**|`toArray \u003cV\u003e (mapFunction map: (Key, Value) -\u003e V) -\u003e [V]`\n\n#### Operators ####\nName | Signature | Function\n---- | --------- | --------\n`-`|`- \u003cK, V: Equatable\u003e (first: Dictionary\u003cK, V\u003e, second: Dictionary\u003cK, V\u003e) -\u003e Dictionary\u003cK, V\u003e`|Difference\n`\u0026`|`\u0026 \u003cK, V: Equatable\u003e (first: Dictionary\u003cK, V\u003e, second: Dictionary\u003cK, V\u003e) -\u003e Dictionary\u003cK, V\u003e`|Intersection\n\u003ccode\u003e\u0026#124;\u003c/code\u003e|\u003ccode\u003e\u0026#124; \u003cK, V: Equatable\u003e (first: Dictionary\u003cK, V\u003e, second: Dictionary\u003cK, V\u003e) -\u003e Dictionary\u003cK, V\u003e\u003c/code\u003e|Union\n\n## NSArray ##\n\nExamples in the [Wiki](https://github.com/pNre/ExSwift/wiki/NSArray)\n\n#### Instance Methods ####\n\nName | Signatures\n---- | ----------\n**`cast`**|`cast \u003cOutType\u003e () -\u003e [OutType]`\n**`flatten`**|`flatten \u003cOutType\u003e () -\u003e [OutType]`\n**`flattenAny`**|`flattenAny () -\u003e [AnyObject]`\n\n## SequenceOf ##\n\nThe 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.\n\nThe `Sequence` protocol cannot be extended, hence the following are extensions to `SequenceOf`. They can be used as follows:\n\n```\nvar source: Sequence = ...\nvar filteredSequence = SequenceOf(source).filter { ... }\n```\n\n#### Instance Methods ####\n\nName | Signatures\n---- | ----------\n**`first`**|`first () -\u003e T?`\n**`any`**|`any (call: (T) -\u003e Bool) -\u003e Bool`\n**`get`**|`get (index: Int) -\u003e T?`\n**`get`**|`get (range: Range\u003cInt\u003e) -\u003e SequenceOf\u003cT\u003e`\n**`indexOf`**|`indexOf \u003cU: Equatable\u003e (item: U) -\u003e Int?`\n**`filter`**|`filter(include: (T) -\u003e Bool) -\u003e SequenceOf\u003cT\u003e`\n**`reject`**|`reject (exclude: (T -\u003e Bool)) -\u003e SequenceOf\u003cT\u003e`\n**`skipWhile`**|`skipWhile(condition:(T) -\u003e Bool) -\u003e SequenceOf\u003cT\u003e`\n**`skip`**|`skip (n:Int) -\u003e SequenceOf\u003cT\u003e`\n**`contains`**|`contains\u003cT:Equatable\u003e (item: T) -\u003e Bool`\n**`take`**|`take (n:Int) -\u003e SequenceOf\u003cT\u003e`\n**`takeWhile`**|`takeWhile (condition:(T?) -\u003e Bool) -\u003e SequenceOf\u003cT\u003e`\n\n## Double ##\n\nExamples in the [Wiki](https://github.com/pNre/ExSwift/wiki/Double)\n\n#### Instance Methods ####\n\nName | Signature\n---- | ---------\n**`abs`**|`abs () -\u003e Double`\n**`sqrt`**|`sqrt () -\u003e Double`\n**`round`**|`round () -\u003e Double`\n**`ceil`**|`ceil () -\u003e Double`\n**`floor`**|`floor () -\u003e Double`\n**`clamp`**|`clamp (min: Double, _ max: Double) -\u003e Double`\n**`roundToNearest`**|`roundToNearest(increment: Double) -\u003e Double`\n\n#### Class Methods ####\n\nName | Signatures\n---- | ----------\n**`random`**|`random(min: Double = 0, max: Double) -\u003e Double`\n\n# NSDate #\n\n#### Properties ####\nName | Signatures\n---- | ----\n**`year`** |`Int`\n**`month`**|`Int`\n**`weekday`** |`Int`\n**`weekMonth`**|`Int`\n**`days`** |`Int`\n**`hours`**|`Int`\n**`minutes`** |`Int`\n**`seconds`**| `Int`\n\n#### Instance Methods ####\nName | Signatures\n---- | ----------\n**`add`**|`add(seconds:Int=0, minutes:Int = 0, hours:Int = 0, days:Int = 0, weeks:Int = 0, months:Int = 0, years:Int = 0) -\u003e NSDate`\n**`addSeconds`**|`addSeconds (seconds:Int) -\u003e NSDate `\n**`addMinutes`**|`addMinutes (minute:Int) -\u003e NSDate `\n**`addHours`**|`addHours(hours:Int) -\u003e NSDate `\n**`addDays`**|`addDays(days:Int) -\u003e NSDate `\n**`addWeeks`**|`addWeeks(weeks:Int) -\u003e NSDate`\n**`addMonths`**|`addMonths(months:Int) -\u003e NSDate`\n**`addYears`**|`addYears(years:Int) -\u003e NSDate `\n**`isAfter`**|`isAfter(date: NSDate) -\u003e Bool`\n**`isBefore`**|`isBefore(date: NSDate) -\u003e Bool`\n**`getComponent`**|`getComponent (component : NSCalendarUnit) -\u003e Int`\n\n#### Operators ####\n\nName | Signatures\n---- | ----------\n**`==`**|`==(lhs: NSDate, rhs: NSDate) -\u003e Bool`\n**`\u003c`**|`\u003c(lhs: NSDate, rhs: NSDate) -\u003e Bool`\n**`\u003e`**|`\u003e(lhs: NSDate, rhs: NSDate) -\u003e Bool`\n**`\u003c=`**|`\u003c=(lhs: NSDate, rhs: NSDate) -\u003e Bool`\n**`\u003e=`**|`\u003e=(lhs: NSDate, rhs: NSDate) -\u003e Bool`\n**`==`**|`==(lhs: NSDate, rhs: NSDate) -\u003e Bool`\n\n# Utilities #\n\nExamples in the [Wiki](https://github.com/pNre/ExSwift/wiki/ExSwift)\n\n#### Class Methods ####\n\nName | Signatures\n---- | ----------\n**`after`**|`after \u003cP, T\u003e (n: Int, function: P -\u003e T) -\u003e (P -\u003e T?)`\u003cbr\u003e`func after \u003cT\u003e (n: Int, function: () -\u003e T) -\u003e (() -\u003e T?)`\n**`once`**|`once \u003cP, T\u003e (function: P -\u003e T) -\u003e (P -\u003e T?)`\u003cbr\u003e`once \u003cT\u003e (call: Void -\u003e T) -\u003e (Void -\u003e T?)`\n**`partial`**|`partial \u003cP, T\u003e (function: (P...) -\u003e T, _ parameters: P...) -\u003e ((P...) -\u003e T?)`\n**`bind`**|`bind \u003cP, T\u003e (function: (P...) -\u003e T, _ parameters: P...) -\u003e (() -\u003e T)`\n**`cached`**|`cached \u003cP, R\u003e (function: P -\u003e R) -\u003e (P -\u003e R)`\u003cbr\u003e`cached \u003cP, R\u003e (function: (P...) -\u003e R) -\u003e ((P...) -\u003e R)`\u003cbr\u003e`cached \u003cP, R\u003e (function: (P...) -\u003e R, hash: ((P...) -\u003e P)) -\u003e ((P...) -\u003e R)`\n\n#### Operators ####\nName | Signatures\n---- | ----------\n**`\u003c=\u003e`**|`\u003c=\u003e \u003cT: Comparable\u003e(lhs: T, rhs: T) -\u003e Int`\n\n# To Do #\n* [X] Wiki\n* [X] Xcode project for both iOS \u0026 OS X\n* [X] Review code comments\n* [ ] Example project\n* [ ] Installation instructions\n* [ ] Benchmark\n","funding_links":[],"categories":["Extensions","Libs","Utilities","Swift","HarmonyOS"],"sub_categories":["Utility","Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FpNre%2FExSwift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FpNre%2FExSwift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FpNre%2FExSwift/lists"}