AnyObserver
public struct AnyObserver<Element> : ObserverType
                A type-erased ObserverType.
Forwards operations to an arbitrary underlying observer with the same Element type, hiding the specifics of the underlying observer type.
- 
                  
                  
The type of elements in sequence that observer can observe.
Declaration
Swift
public typealias E = Element - 
                  
                  
Anonymous event handler type.
Declaration
Swift
public typealias EventHandler = (Event<Element>) -> Void - 
                  
                  
Construct an instance whose
on(event)callseventHandler(event)Declaration
Swift
public init(eventHandler: @escaping EventHandler)Parameters
eventHandlerEvent handler that observes sequences events.
 - 
                  
                  
Construct an instance whose
on(event)callsobserver.on(event)Declaration
Swift
public init<O>(_ observer: O) where Element == O.E, O : ObserverTypeParameters
observerObserver that receives sequence events.
 - 
                  
                  
Send
eventto this observer.Declaration
Swift
public func on(_ event: Event<Element>)Parameters
eventEvent instance.
 - 
                  
                  
Erases type of observer and returns canonical observer.
Declaration
Swift
public func asObserver() -> AnyObserver<E>Return Value
type erased observer.
 
        AnyObserver Structure Reference