Я хотел бы испустить два разных сигнала для двух разных источников, но получаю cra sh Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
в RxSwift/Event.swift
в строке 29: return "next(\(value))"
это мой упрощенный код:
let scheduler = TestScheduler(initialClock: 0)
locationsFactory = TestableLocationsFactory()
locationsFactory.didReceiveRegion = scheduler.createColdObservable([
.next(100, regionEvents[0]),
.next(200, regionEvents[1])
]).asObservable()
locationsFactory.location = scheduler.createColdObservable([
.next(120, locations[0]),
.next(220, locations[1])
]).asObservable()
let result = scheduler.createObserver(LocationChange.self)
let dispatcher = BestAccuracyLocationsDispatcher(persistenceService: persistenceService, apiClient: api, locationManager: locationsFactory)
subscription = dispatcher.dispatcher.subscribe(result)
scheduler.start()
let events = result.events
XCTAssertEqual(events, [
.next(120, LocationChange(location: locations[0], trigger: .updateLocations)),
.next(220, LocationChange(location: locations[1], trigger: .updateLocations)),
])
Когда я удаляю locationsFactory.didReceiveRegion
или locationsFactory.location
, это работает.
Могу ли я создать два разных наблюдаемых планировщика?