PagingKit icon indicating copy to clipboard operation
PagingKit copied to clipboard

Switch page programmatically

Open huy-lv opened this issue 4 years ago • 1 comments

Hi, how to switch to another page programmatically, i think the code should look like:

page.selectedIndex = 2

huy-lv avatar Mar 17 '21 09:03 huy-lv

@huy-lv You can use the following methods.

pagingMenuViewController.scroll(index: 2)
pagingContentViewController.scroll(to: 2, animated: true)

https://github.com/kazuhiro4949/PagingKit/blob/master/Sources/PagingMenuViewController.swift#L165 https://github.com/kazuhiro4949/PagingKit/blob/master/Sources/PagingContentViewController.swift#L204

kazuhiro4949 avatar Mar 21 '21 22:03 kazuhiro4949