I am trying to learn ReactiveCocoa and have a hard time getting started. I keep hitting minor bumps as API and tutorials seems to be outdated quickly. Maybe I have the wrong impression.
Just trying to follow this I do not seem to have NoError
.
It should be imported correctly, since I have access to Signal
, rac_textSignal
etc. but I don't know why NoError is not available.
Their documentation mentions NoError
as well but that leads to a 404.
This transition to RAC4 mentions NoError
as well. Why is NoError
undeclared? I am using ReactiveCocoa 4.0.1.
Edit: I just added public enum NoError : ErrorType {}
to the top of the file and it works now. I am not sure if this is a proper solution to the problem though. It is not mentioned in guides and tutorials that I should extend ErrorType
myself.
The reactive cocoa native
NoError
was removed in 4.0.1 in favour of antitypicals implementation inResult
(addsNoError
toResult
, see this). See e.g. issue #2704We can see this explicitly used in the source files, e.g.
import enum Result.NoError
in Property.swift.Hence, you probably need to include (antitypicals)
Result
whenever you intend to useNoError
. One suggested fix in the issue thread isIf you add "import Results" to the top of the page above your class, NoError will no longer be an undeclared type!