Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何正确扩展RxCocoa.Driver?_Ios_Swift_Xcode_Reactive - Fatal编程技术网

Ios 如何正确扩展RxCocoa.Driver?

Ios 如何正确扩展RxCocoa.Driver?,ios,swift,xcode,reactive,Ios,Swift,Xcode,Reactive,我想像这样扩展驱动程序: extension Driver where E == Array<String>? { var dashedLabel: UILabel { let label = UILabel() map({ $0?.joined(separator: "-") }).drive(label.rx.text) // yes, the above is never disposed // what

我想像这样扩展驱动程序:

extension Driver where E == Array<String>? {

    var dashedLabel: UILabel {
        let label = UILabel()
        map({ $0?.joined(separator: "-") }).drive(label.rx.text)
        // yes, the above is never disposed
        // what I am interested about is this error:
        // Referencing instance method 'drive' on
        // 'SharedSequenceConvertibleType'
        // requires the types
        // 'SharedSequence<S, Optional<Array<String>>>.SharingStrategy'
        // (aka 'S') and 'DriverSharingStrategy' be equivalent
        return label
    }

}
公共结构SharedSequence:SharedSequenceConvertibleType
public typealias Driver<E> = SharedSequence<DriverSharingStrategy, E>
public struct SharedSequence<S: SharingStrategyProtocol, Element> : SharedSequenceConvertibleType