Git Product home page Git Product logo

Comments (6)

pujiaxin33 avatar pujiaxin33 commented on May 23, 2024

请参考demo里面的如下代码:

extension VCListViewController: JXPagingViewListViewDelegate {
    func listView() -> UIView {
        return self.view
    }

    func listScrollView() -> UIScrollView {
        return contentView.tableView
    }

    func listViewDidScrollCallback(callback: @escaping (UIScrollView) -> ()) {
        contentView.listViewDidScrollCallback = callback
    }
}

from jxpagingview.

chen7788 avatar chen7788 commented on May 23, 2024

因为不知道哪里设置代理,我意思这个控制器无法遵守这个协议
func preferredListViewsArray() -> [JXPagingViewListViewDelegate] {
return [SubscriptionController(),SubscriptionController(),SubscriptionController()]
}
这里就报错的

from jxpagingview.

pujiaxin33 avatar pujiaxin33 commented on May 23, 2024

只要遵守这个协议即可,无需设置代理。
如果是oc,在SubscriptionController.h遵从JXPagingViewListViewDelegate代理。
如果是swift,就按照我上面发的做。

from jxpagingview.

chen7788 avatar chen7788 commented on May 23, 2024

你好,func preferredPagingView() -> JXPagingView {
return JXPagingView(delegate: self)
}
Thread 1: Fatal error: NSArray element failed to match the Swift Array Element type
创建JXPagingView(delegate: self)时报错

from jxpagingview.

pujiaxin33 avatar pujiaxin33 commented on May 23, 2024

建议你按照demo操作,跟库无关的问题,请百度研究

from jxpagingview.

pujiaxin33 avatar pujiaxin33 commented on May 23, 2024

建议你将你的代码:

func preferredListViewsArray() -> [JXPagingViewListViewDelegate] {
return [SubscriptionController(),SubscriptionController(),SubscriptionController()]
}

修改为:

func listViews(in pagingView: JXPagingView) -> [ JXPagingViewListViewDelegate] {
        var listViewArray:[JXPagingViewListViewDelegate] = [yourInstance1, yourInstance2]
        return listViewArray
    }

参考这篇文章:fatal error: NSArray element failed to match the Swift Array Element type

from jxpagingview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.