通用Objective-C类的扩展无法在运行时在Swift 4.2和Xcode 10.2.1中访问类的通用参数

时间:2019-07-04 07:55:29

标签: ios reactive-cocoa swift4.2 xcode10.2 reactive-swift

我面临以下问题:

  

错误:“通用Objective-C类的扩展无法访问   Swift 4.2和Xcode 10.2.1中运行时类的通用参数”

我正在使用以下版本的反应性库:

  • 活性可可(10.0.0)

  • ReactiveObjC(3.1.1)

  • ReactiveSwift(6.0.0)

  • 结果(4.1.0)

Xcode:10.2.1

快速版本:4.2

代码段:

import Foundation
import ReactiveObjC
import ReactiveSwift

extension RACSignal {
    /// Create a `SignalProducer` which will subscribe to the receiver once for
    /// each invocation of `start()`.
    ///
    /// - parameters:
    ///   - file: Current file name.
    ///   - line: Current line in file.
    ///
    /// - returns: Signal producer created from `self`.
    public func toSignalProducer(file: String = #file, line: Int = #line) -> SignalProducer<AnyObject?, NSError> {
        return SignalProducer { observer, disposable in
            let next: (Any?) -> Void = { obj in
                observer.send(value: obj as AnyObject?)
            }

            let failed: (Error?) -> Void = { nsError in
                observer.send(error: nsError as NSError? ?? NSError(domain: "Nil RACSignal error", code: -1, userInfo: [:]))
            }

            let completed = {
                observer.sendCompleted()
            }

            disposable += self.subscribeNext(next, error: failed, completed: completed)
        }
    }
}

由于这个问题,我们被封锁了。

有人遇到相同的问题并找到解决方法吗?

0 个答案:

没有答案