Created
December 11, 2012 17:50
-
-
Save neilinglis/4260598 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
I think they differ in UIKit so that the new NSTextAlignment values were the same as their deprecated UITextAlignment counterparts.