Skip to content

Instantly share code, notes, and snippets.

@qtxie
Forked from neilinglis/gist:4260598
Created August 30, 2016 07:58
Show Gist options
  • Save qtxie/6d86e8d198d836dd0260eea37564a743 to your computer and use it in GitHub Desktop.
Save qtxie/6d86e8d198d836dd0260eea37564a743 to your computer and use it in GitHub Desktop.
NSTextAlignment Naming Differences
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