Skip to content

k06a/Linqwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linqwift

CI Status Version License Platform

Just imagine the power of LINQ on iOS and OS X platforms.

Main objective is to implement all of these methods: http://msdn.microsoft.com/en-us/library/system.linq.enumerable_methods.aspx

##Implemented Features

####Main Methods

func Where(predicate: (T)->Bool) -> AnySequence<T>
func Where(predicate: (T,Int)->Bool) -> AnySequence<T>
func Select<U>(transform: (T)->U) -> AnySequence<U>
func Select<U>(transform: (T,Int)->U) -> AnySequence<U>
func Distinct<U where U: Hashable>(transform: (T)->U) -> AnySequence<T>
func Skip(count: Int) -> AnySequence<T>
func SkipWhile(predicate: (T)->Bool) -> AnySequence<T>
func Take(count: Int) -> AnySequence<T>
func TakeWhile(predicate: (T)->Bool) -> AnySequence<T>

####Aggregators

func Aggregate<U>(block: (U,T)->U, startValue: U) -> U
func Elect(electLeft: (T,T)->Bool) -> (value: T?, index: Int?)
func First(predicate: (T)->Bool) -> (value: T?, index: Int?)
func Last(predicate: (T)->Bool) -> (value: T?, index: Int?)
func Min<U: Comparable>(transform: (T)->U) -> (transformed: U?, value: T?, index: Int?)
func Max<U: Comparable>(transform: (T)->U) -> (transformed: U?, value: T?, index: Int?)

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

Linqwift is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Linqwift'

Author

Anton Bukov, k06aaa@gmail.com

License

Linqwift is available under the MIT License.

About

Swift language LINQ extension

Resources

License

Stars

Watchers

Forks

Packages

No packages published