Last active
June 29, 2021 00:25
-
-
Save novinfard/f696e67fd74f027f7969ebf6b08bfc2d to your computer and use it in GitHub Desktop.
[Detect RTL in UIKit views]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func viewDidLoad() { | |
super.viewDidLoad() | |
let image = UIImage(systemName: "pencil.circle.fill") | |
if self.view.effectiveUserInterfaceLayoutDirection == .rightToLeft { | |
imageView.image = image?.imageFlippedForRightToLeftLayoutDirection() | |
} else { | |
imageView.image = image | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment