lemanhtien / MTSlideToOpen

A simple SlideToUnlock iOS UI component
MIT License
145 stars 51 forks source link

RTL implementation issue #22

Open AhmadShaheer28 opened 3 years ago

AhmadShaheer28 commented 3 years ago

Hi, I have used this library but I'm unable to move thumbnailImageView from right to left if I slide finger from left to right the thumbnailImageView moves from right to left when layoutDirection is rightToLeft

himanimehta1 commented 1 year ago

try this: in // MTSlideToOpenControl.swift file you need to add

for dragview slide:

func isOnRightToLeftLanguage() -> Bool { if UserDefaults.standard.bool(forKey: "Is_rtl") { return UIApplication.shared.userInterfaceLayoutDirection == .leftToRight // for rtl }else{ return UIApplication.shared.userInterfaceLayoutDirection == .rightToLeft
} }

for sliderText flipped text :

func mt_flipView() { if UserDefaults.standard.bool(forKey: "Is_rtl") { self.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) }else{ self.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) } }