In the func for CustomStringConvertible, I am getting an error with the following line of code:
print(label, event.element ?? event.error ?? event)
I get the following error:
Playground execution failed:
error: RxSwiftPlayground.playground:79:32: error: value of optional type 'Any?' must be unwrapped to a value of type 'Any'
print(label, event.element ?? event.error ?? event)
^
RxSwiftPlayground.playground:79:32: note: coalesce using '??' to provide a default when the optional value contains 'nil'
print(label, event.element ?? event.error ?? event)
^
( ) ?? <#default value#>
RxSwiftPlayground.playground:79:32: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
print(label, event.element ?? event.error ?? event)
^
( )!
I tried using code from the finished example but I get the same error. I am using using Xcode 10.1. I’m not sure if something has changed since Xcode 9, or if there is a better way to handle the Event type.