Open matildemarcelletti opened 2 years ago
func animateSideMenu(targetPosition: CGFloat, completion: @escaping (Bool) -> ()) { UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1.0, initialSpringVelocity: 0, options: .layoutSubviews, animations: { if self.revealSideMenuOnTop { self.sideMenuTrailingConstraint.constant = -targetPosition self.view.layoutIfNeeded() } else { self.view.subviews[1].frame.origin.x = targetPosition } }, completion: completion) }
` if self.revealSideMenuOnTop {
// self.sideMenuTrailingConstraint = self.sideMenuViewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: -self.sideMenuRevealWidth - self.paddingForRotation) //use it for left navigation mneu self.sideMenuTrailingConstraint = self.sideMenuViewController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: self.sideMenuRevealWidth + self.paddingForRotation)
self.sideMenuTrailingConstraint.isActive = true
}`
Has anyone modified this for the pan gesture as well? the same drag as it comes from left. If anyone has mapped just update here.
Moving the button at the top right how can I bring up the side menu from the right?