Skip to content

Commit

Permalink
Merge pull request #90 from czechboy0/hd/xcode7_beta3_fixes
Browse files Browse the repository at this point in the history
Fixed generic array parameter name changed in Xcode 7 beta 3
  • Loading branch information
Honza Dvorsky committed Jul 15, 2015
2 parents a540380 + e579ea4 commit a8a5a49
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Buildasaur/CommonExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ func firstNonNil<T>(objects: [T?]) -> T? {

extension Set {

func filterSet(includeElement: (T) -> Bool) -> Set<T> {
func filterSet(includeElement: (Element) -> Bool) -> Set<Element> {
return Set(self.filter(includeElement))
}
}

extension Array {

func indexOfFirstObjectPassingTest(test: (T) -> Bool) -> Array<T>.Index? {
func indexOfFirstObjectPassingTest(test: (Element) -> Bool) -> Array<Element>.Index? {

for (idx, obj) in self.enumerate() {
if test(obj) {
Expand All @@ -39,13 +39,13 @@ extension Array {

extension Array {

func mapVoidAsync(transformAsync: (item: T, itemCompletion: () -> ()) -> (), completion: () -> ()) {
func mapVoidAsync(transformAsync: (item: Element, itemCompletion: () -> ()) -> (), completion: () -> ()) {
self.mapAsync(transformAsync, completion: { (_) -> () in
completion()
})
}

func mapAsync<U>(transformAsync: (item: T, itemCompletion: (U) -> ()) -> (), completion: ([U]) -> ()) {
func mapAsync<U>(transformAsync: (item: Element, itemCompletion: (U) -> ()) -> (), completion: ([U]) -> ()) {

let group = dispatch_group_create()
var returnedValueMap = [Int: U]()
Expand Down Expand Up @@ -74,9 +74,9 @@ extension Array {
extension Array {

//dictionarify an array for fast lookup by a specific key
func toDictionary(key: (T) -> String) -> [String: T] {
func toDictionary(key: (Element) -> String) -> [String: Element] {

var dict = [String: T]()
var dict = [String: Element]()
for i in self {
dict[key(i)] = i
}
Expand Down

0 comments on commit a8a5a49

Please sign in to comment.