You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, Kukushi.
Beautiful control, Congrats!
Sometimes pan gesture recognizer is a little too "choosy" in detecting a valid gesture. After a few tests I discovered that it would be useful to add a property in SideMenuController class in order to parametrise the constant value (.25) you're using in isValidateHorizontalMovement. For example on a real iPhone XS you get much better user experience with a value of .45 to guess "horizontality" of the gesture. I'll investigate further because I think it depends on screen dimension/density.
openclassSideMenuController:UIViewController{...privatevar_horizontalPanSensitivity:CGFloat=0.25 // .45 was much better on large screens
openvarhorizontalPanSensitivity:CGFloat{set{
_horizontalPanSensitivity = newValue
}get{return _horizontalPanSensitivity
}}...}
in extensionSideMenuController:
private func isValidateHorizontalMovement(for velocity:CGPoint)->Bool{if isMenuRevealed {returntrue}letdirection= preferences.basic.direction
varfactor:CGFloat= direction ==.left ?1:-1
factor *= shouldReverseDirection ?-1:1guard velocity.x * factor >0else{returnfalse}
// Changed: using new sensitivity parameter
returnabs(velocity.y / velocity.x)< horizontalPanSensitivity
}
The text was updated successfully, but these errors were encountered:
Hi, Kukushi.
Beautiful control, Congrats!
Sometimes pan gesture recognizer is a little too "choosy" in detecting a valid gesture. After a few tests I discovered that it would be useful to add a property in SideMenuController class in order to parametrise the constant value (.25) you're using in isValidateHorizontalMovement. For example on a real iPhone XS you get much better user experience with a value of .45 to guess "horizontality" of the gesture. I'll investigate further because I think it depends on screen dimension/density.
The text was updated successfully, but these errors were encountered: