Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setPage change pagecontrol drawer from worm to colorblend #16

Open
NikhilGangurde opened this issue Dec 23, 2022 · 0 comments
Open

setPage change pagecontrol drawer from worm to colorblend #16

NikhilGangurde opened this issue Dec 23, 2022 · 0 comments

Comments

@NikhilGangurde
Copy link

I have setup pagecontrol in tableviewcell

@IBOutlet weak var pageControl: AdvancedPageControlView! {
        didSet {
            if pageControl != nil {
                pageControl.drawer =  : 0, height: 10, width: 10, space: 10, raduis: 5, currentItem: 0, indicatorColor: indicatorColor, dotsColor: .white, isBordered: true, borderColor: indicatorBorderColor, borderWidth: 2, indicatorBorderColor: indicatorBorderColor, indicatorBorderWidth: 2)
                NotificationCenter.default.addObserver(self, selector: #selector(themeChanged(notification:)), name: .themeChanged, object: nil)
            }
        }
    }

Here is scrollViewDidScroll of my pagecontrol

if let cell = table_view.cellForRow(at: IndexPath(row: 0, section: 1)) as? TopBannersCell, cell.collection_view == scrollView {
            let offSet = scrollView.contentOffset.x
            let width = (SceneDelegate.shared?.window?.bounds.width ?? 0)*0.3
            
            let visibleRect = CGRect(origin: cell.collection_view.contentOffset, size: cell.collection_view.bounds.size)
            let visiblePoint = CGPoint(x: visibleRect.midX, y: visibleRect.midY)
            let visibleIndexPath = cell.collection_view.indexPathForItem(at: visiblePoint)
            print("\n**** ",visibleIndexPath," ****\n")
           cell.pageControl.setPage(visibleIndexPath?.item ?? 0)
}

but after first scroll it changes from work to color blend what am i doing wrong here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant