Getting “use of undeclared type 'NoError'” with ReactiveCocoa

后端 未结 3 806
情深已故
情深已故 2021-02-05 16:12

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 imp

3条回答
  •  心在旅途
    2021-02-05 16:50

    The reactive cocoa native NoError was removed in 4.0.1 in favour of antitypicals implementation in Result (adds NoError to Result, see this). See e.g. issue #2704

    • https://github.com/ReactiveCocoa/ReactiveCocoa/issues/2704

    We 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 use NoError. One suggested fix in the issue thread is

    public typealias NoError = Result.NoError
    

提交回复
热议问题