2016-11-02 7 views

답변

11

3보다 오래된 RxSwift 버전에서 subscribeNext(_: Value ->())subscribe(_: Event<Value> ->())의 특수 버전이었습니다.

subscribe(_:)은 모든 이벤트 사례 (예 : .next(Value), .error(Error).completed)에 대해 트리거됩니다.

subscribeNext.next(Value)에 대해서만 트리거하고 Value의 압축을 푸십시오. RxSwift 버전 3으로

subscribeNext 지금

func subscribe(
    onNext: ((Value) ->())? = nil, 
    onError: ((Error) ->())? = nil, 
    onCompleted: (() ->())? = nil, 
    onDisposed:() ->() = nil 
) 

단지 그들에 대해 관심이있는 콜백 subscribe를 호출하는 사용자를 가능하게 전무 기본값입니다.