-
-
Save qtxie/6d86e8d198d836dd0260eea37564a743 to your computer and use it in GitHub Desktop.
NSTextAlignment Naming Differences
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
Am I out of order being annoyed at things like this? The naming has changed subtly, the direction is at the end in UIKit but at the start on AppKit. If I'm writing cross platform code then I need to either use the int values directly, which is bad practice, or use a define. | |
UIKit: | |
enum { | |
NSTextAlignmentLeft = 0, | |
NSTextAlignmentCenter = 1, | |
NSTextAlignmentRight = 2, | |
NSTextAlignmentJustified = 3, | |
NSTextAlignmentNatural = 4, | |
}; | |
typedef NSInteger NSTextAlignment; | |
AppKit: | |
typedef enum _NSTextAlignment { | |
NSLeftTextAlignment = 0, | |
NSRightTextAlignment = 1, | |
NSCenterTextAlignment = 2, | |
NSJustifiedTextAlignment = 3, | |
NSNaturalTextAlignment = 4 | |
} NSTextAlignment; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment