FSPagerView icon indicating copy to clipboard operation
FSPagerView copied to clipboard

Change access modifier numberOfItems

Open hung7996 opened this issue 2 years ago • 3 comments

hung7996 avatar Sep 07 '21 08:09 hung7996

What is the purpose of opening this? The numberOfItems are asked by the dataSource, which is implemented by the client side. So the client side already knows better about the number.

WenchaoD avatar Sep 27 '21 09:09 WenchaoD

Hi After pager.reloadData() I call: pager.scrollToItem(at: index, animated: true) (index I get from datasource) The app crash because the pager doesn't have the item at index

Vào Th 2, 27 thg 9, 2021 vào lúc 16:23 Wenchao Ding < @.***> đã viết:

What is the purpose of opening this? The numberOfItems are asked by the dataSource, which is implemented by the client side. So the client side already knows better about the number.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WenchaoD/FSPagerView/pull/325#issuecomment-927687154, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOT3SQCPKABYPKKX5OM5SLUEAZZPANCNFSM5DR4IKJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

hung7996 avatar Nov 12 '21 08:11 hung7996

confirm.

pager.reloadData() {
//has to call it immediately:
self.numberOfItems = dataSource.numberOfItems(in: self)
}

whitetown avatar Nov 26 '21 13:11 whitetown