Skip to content

Commit 0f5441d

Browse files
author
Guido Marucci Blas
committed
Fixes compilation issues caused by updating ReactiveCocoa.
1 parent 9582d38 commit 0f5441d

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

ReactiveArray/ReactiveArray.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ public final class ReactiveArray<T>: CollectionType, MutableCollectionType, Cust
8080
_mutableCount = MutableProperty(elements.count)
8181
observableCount = PropertyOf(_mutableCount)
8282

83-
_signal.observe { [unowned self](operation) in
84-
self.updateArray(operation)
83+
_signal.observe { [unowned self](event) in
84+
if case .Next(let operation) = event {
85+
self.updateArray(operation)
86+
}
8587
}
86-
88+
8789
}
8890

8991
public convenience init(producer: OperationProducer) {

ReactiveArrayTests/ReactiveArraySpec.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ private func waitForOperation<T>(fromProducer producer: SignalProducer<Operation
1818
onDelete: Int -> () = { fail("Invalid operation type: .Delete(\($0))") }) {
1919

2020
waitUntil { done in
21-
producer.start(next: { operation in
21+
producer.startWithNext { operation in
2222
switch operation {
2323
case .Append(let value):
2424
onAppend(value)
@@ -28,7 +28,7 @@ private func waitForOperation<T>(fromProducer producer: SignalProducer<Operation
2828
onDelete(index)
2929
}
3030
done()
31-
})
31+
}
3232
when()
3333
}
3434

@@ -262,12 +262,12 @@ class ReactiveArraySpec: QuickSpec {
262262
array.producer
263263
.take(array.count)
264264
.collect()
265-
.start(next: { operations in
265+
.startWithNext { operations in
266266
let expectedOperations: [Operation<Int>] = array.map { Operation.Append(value: $0) }
267267
let result = operations == expectedOperations
268268
expect(result).to(beTrue())
269269
done()
270-
})
270+
}
271271
}
272272
}
273273

@@ -390,30 +390,30 @@ class ReactiveArraySpec: QuickSpec {
390390

391391
beforeEach {
392392
countBeforeOperation = array.count
393-
producer = array.observableCount.producer.skip(1)
393+
producer = array.observableCount.producer
394394
}
395395

396396
it("returns the initial amount of elements in the array") {
397-
producer.start(next: { count in
397+
producer.startWithNext { count in
398398
expect(count).to(equal(countBeforeOperation))
399-
})
399+
}
400400
}
401401

402402
context("when an insert operation is executed") {
403403

404404
beforeEach {
405-
producer = producer |> skip(1)
405+
producer = producer.skip(1)
406406
}
407407

408408
it("does not update the count") {
409409
waitUntil { done in
410410
producer
411411
.take(1)
412412
.collect()
413-
.start(next: { counts in
413+
.startWithNext { counts in
414414
expect(counts).to(equal([countBeforeOperation + 1]))
415415
done()
416-
})
416+
}
417417

418418
array.insert(657, atIndex: 1)
419419
array.append(656)
@@ -426,15 +426,15 @@ class ReactiveArraySpec: QuickSpec {
426426
context("when an append operation is executed") {
427427

428428
beforeEach {
429-
producer = producer |> skip(1)
429+
producer = producer.skip(1)
430430
}
431431

432432
it("updates the count") {
433433
waitUntil { done in
434-
producer.start(next: { count in
434+
producer.startWithNext { count in
435435
expect(count).to(equal(countBeforeOperation + 1))
436436
done()
437-
})
437+
}
438438

439439
array.append(656)
440440
}
@@ -445,15 +445,15 @@ class ReactiveArraySpec: QuickSpec {
445445
context("when a delete operation is executed") {
446446

447447
beforeEach {
448-
producer = producer |> skip(1)
448+
producer = producer.skip(1)
449449
}
450450

451451
it("updates the count") {
452452
waitUntil { done in
453-
producer.start(next: { count in
453+
producer.startWithNext { count in
454454
expect(count).to(equal(countBeforeOperation - 1))
455455
done()
456-
})
456+
}
457457

458458
array.removeAtIndex(1)
459459
}

0 commit comments

Comments
 (0)