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

JXSegmentedListContainerViewListDelegate代理方法的回调时机 #38

Closed
sec7et opened this issue Aug 27, 2019 · 3 comments
Closed

JXSegmentedListContainerViewListDelegate代理方法的回调时机 #38

sec7et opened this issue Aug 27, 2019 · 3 comments
Labels
question Further information is requested

Comments

@sec7et
Copy link

sec7et commented Aug 27, 2019

你好,第一次集成这个库,确实很强大,可定制内容很多。但也碰到些问题,望解惑。

  1. func listDidAppear() 和 viewDidAppear() 是怎样一个调用顺序?具体表示是,第一次加载VC,会触发 viewDidAppear() 和 listDidAppear() 方法。之后push了一个子页面,从子页面再返回,就不会触发 viewDidAppear() ,只触发 listDidAppear() 。
  2. 项目中引入了 FDFullscreenPopGesture ,一个滑动返回手势库,在子页面上右划返回时,稍微划出一点距离立马就会出发 listDidAppear() 方法。本来是在viewDidAppear()里面做了一些操作的,现在把这些操作写在 listDidAppear() 中了,但是这也导致了操作被提前执行的情况,比如弹窗,就会在页面未出现就被显示出来了。
@pujiaxin33
Copy link
Owner

  1. 对列表已经抽象为遵从协议JXSegmentedListContainerViewListDelegate的类,所以,没有对列表做什么特殊处理。如果你的列表是VC,那么就不能信赖它的生命周期方法。因为列表只是使用了VC的view而已。如果要实现VC的全生命周期,需要配合beginAppearanceTransitionendAppearanceTransitionAPI。因为我对列表进行了抽象,所以就没有做这个操作。
  2. 因为列表的listDidAppear方法,在willMove(toWindow newWindow: UIWindow?)触发,所以时机有点不太恰当。

基于现在的版本解决你的问题,建议你把最外层的父VC的生命周期方法,通过自定义方法传递给子VC,而不要依赖于listDidAppear

@pujiaxin33 pujiaxin33 added the question Further information is requested label Aug 28, 2019
@sec7et
Copy link
Author

sec7et commented Aug 28, 2019

  1. 对列表已经抽象为遵从协议JXSegmentedListContainerViewListDelegate的类,所以,没有对列表做什么特殊处理。如果你的列表是VC,那么就不能信赖它的生命周期方法。因为列表只是使用了VC的view而已。如果要实现VC的全生命周期,需要配合beginAppearanceTransitionendAppearanceTransitionAPI。因为我对列表进行了抽象,所以就没有做这个操作。
  2. 因为列表的listDidAppear方法,在willMove(toWindow newWindow: UIWindow?)触发,所以时机有点不太恰当。

基于现在的版本解决你的问题,建议你把最外层的父VC的生命周期方法,通过自定义方法传递给子VC,而不要依赖于listDidAppear

收到,学习了,感谢提供解决思路。

@pujiaxin33
Copy link
Owner

后期我会再优化列表的生命周期方法的处理,目前就按照现在的方案就行。

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

No branches or pull requests

2 participants