I am designing a right to left application.I've made everything rtl by using this line of code:
UIView.appearance().semanticContentAttribute = .forceRightToLeft
and that works correct for everything expect the interactive pop gesture of my navigation controller. the direction of the segue is correct:
but when I want to use the pop gesture (swipe from left edge to right edge) the view become visible from opposite side.
How should I change it?
I've tried changing the edges to .right but that disabled the gesture recognizer :
let gesture = interactivePopGestureRecognizer as! UIScreenEdgePanGestureRecognizer
gesture.edges = .right
You should change the both view
and navigationBar
semantic attribute
use this extension:
extension UIViewController {
open override func awakeFromNib() {
super.awakeFromNib()
navigationController?.view.semanticContentAttribute = .forceRightToLeft
navigationController?.navigationBar.semanticContentAttribute = .forceRightToLeft
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With