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

Option to disable preloading the next viewController? #95

Closed
hithakshi opened this issue Aug 9, 2019 · 3 comments
Closed

Option to disable preloading the next viewController? #95

hithakshi opened this issue Aug 9, 2019 · 3 comments

Comments

@hithakshi
Copy link

I have 3 viewControllers for paging. Everything is perfect except one.
viewDidAppear() of second viewController called when first viewController is loaded.
Problem is we are presenting a viewController (basically a coach mark) when second view controller is loaded. Hence when first view controller appears, second viewController's presenting viewController (i.e coach mark) is shown.

I have checked internal code of PagingKit. It has something called "isEnabledPreloadContent" property and 'preloadContentIfNeeded' method which is not used anywhere. I believe if isEnabledPreloadContent is set to false, it should not load viewControllers which are yet to present/load.

As a workaround, I am using "menuViewController(viewController: PagingMenuViewController, didSelect page: Int, previousPage: Int) " method to decide whether to present viewController or not. But this is not satisfying!!

@kazuhiro4949
Copy link
Owner

@hithakshi
You can use the delegate to catch the event.

func contentViewController(viewController: PagingContentViewController, didFinishPagingAt index: Int, animated: Bool)

https://github.com/kazuhiro4949/PagingKit/blob/master/PagingKit/PagingContentViewController.swift#L75

PagingContentViewController calls it when the paging is finished.

In addition, I'll add the feature to the next version. Please wait a while.

@hithakshi
Copy link
Author

Yeah. I am currently using that.
Thank you :)

@kazuhiro4949
Copy link
Owner

I'm glad that you could handle that problem :)

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

2 participants