SelectorViewController

SelectorViewController

如果我正在使用支持swift 4的最新Eureka吊舱,我会得到答案。
https://github.com/xmartlabs/Eureka/issues/1355#issuecomment-353334726

但是我在分支迅速3.2

当我使用上面链接中给出的解决方案时

class MyPushViewController: SelectorViewController<SelectorRow<PushSelectorCell<String>>> {

    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .lightContent
    }
}


我收到错误消息“专用于类型参数太少的通用类型'SelectorRow'(得到1,但预期为2)”

最佳答案

您收到的错误与SelectRow泛型类型有关。它需要2个类型参数:

<SelectRow<PushSeletorCell<String>, second type here>


尤里卡的例子:

public final class CustomPushRow<T: Equatable>: SelectorRow<PushSelectorCell<T>, SelectorViewController<T>>, RowType {
    public required init(tag: String?) {
        super.init(tag: tag)
        presentationMode = .show(controllerProvider: ControllerProvider.callback {
            return SelectorViewController<T>(){ _ in }
        }, onDismiss: { vc in
            _ = vc.navigationController?.popViewController(animated: true)
        })
    }
}


如您所见,SelectRow需要2种类型的参数:PushSelectorCell<T>SelectorViewController<T>

09-25 20:54