FSpagerView cellForItem我的推送功能不起作用吗?

时间:2019-07-19 19:42:37

标签: swift xcode rx-swift

我使用MVVM(rxswift)。进入我的MainPageView中,我将func cellForItemAt称为pagerView。在那里我添加了tapGestureRecognizer ...

进入cellForItemAt我调用下一个代码:

 let webUrl = images[index]
    let tapGestureRecognizer = MyTapGesture(target: self, action: #selector(imageTapped(sender:)))
    tapGestureRecognizer.webUrl = webUrl
    cell.imageView?.addGestureRecognizer(tapGestureRecognizer)

在我调用了Objective-c函数

之后
@objc func imageTapped(sender: MyTapGesture){
    guard let model = sender.webUrl else { return }
    print(model)
    sender.openDetailPartner(with: model)

}

和手势类别:

class MyTapGesture: UITapGestureRecognizer,Stepper {
    var webUrl: PartnersItem? = nil

    (// this func doesn't call func openPartnersInfoController , but this code works in another viewController)

    func openDetailPartner(with model: PartnersItem) {
        step.accept(AppStep.openPartnersInfoController(partners: model, showType: .push))
    }
}

我的屏幕截图: enter image description here

0 个答案:

没有答案