How to solve the problem of sideslip gesture return in ios development
Editor to share with you how to solve the problem of sideslip gesture return in ios development, I believe most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's learn about it!
Sideslip gesture back
IOS's side-slip return gesture has a good operation experience, and applications that do not support side-slip return are definitely not good applications. However, in the process of development, when the return button is customized, or on some pages such as webView,tableView, the sideslip return gesture fails, so we need to set it. You can negotiate the following code in the base class:
If ([self.navigationController respondsToSelector:@selector (interactivePopGestureRecognizer)]) {/ / agents who need to follow the gesture self.navigationController.interactivePopGestureRecognizer.delegate = self; self.navigationController.interactivePopGestureRecognizer.enabled = YES;}
Problem: when returning the top-most Controller of navigationController. Side slide again, at this time you are clicking on the operation of a push page, you will find that Kana, it will take a long time to react.
This is because the Controller gesture is still valid at the top level, but after sliding, the returned page cannot be found. Cause software stutter, fake death, so make this gesture invalid in rootViewController. Set the following to NO
Self.navigationController.interactivePopGestureRecognizer.enabled = YES
Of course, you can also use a third-party library, which is well written. He extends the sideslip return gesture of the system, not from the edge, but to the right. Most importantly, he only needs to join the project and does not need a single line of code to achieve it.
These are all the contents of this article entitled "how to solve the problem of sideslip gesture return in ios development". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!