Created
December 9, 2023 08:44
-
-
Save usagimaru/9b8e93f0f239195a8cb46fee28cda7e7 to your computer and use it in GitHub Desktop.
Right-align items in NSStackView
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
// If the current layout is LTR, right justified. [3, 2, 1, 0] | |
// If RTL, left justified. [0, 1, 2, 3] | |
if self.userInterfaceLayoutDirection == .leftToRight { | |
stackView.userInterfaceLayoutDirection = .rightToLeft | |
} | |
else { | |
stackView.userInterfaceLayoutDirection = .leftToRight | |
} | |
// https://developer.apple.com/documentation/appkit/nsview/1483254-userinterfacelayoutdirection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment