Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

61 lines (52 sloc) 1.644 kb
//
// DTCompatibility.h
// DTCoreText
//
// Created by Oliver Letterer on 09.04.12.
// Copyright (c) 2012 Drobnik.com. All rights reserved.
//
// DTColor is UIColor on iOS, NSColor on Mac
#if TARGET_OS_IPHONE
@compatibility_alias DTColor UIColor;
#else
@compatibility_alias DTColor NSColor;
#endif
// DTImage is UIImage on iOS, NSImage on Mac
#if TARGET_OS_IPHONE
@compatibility_alias DTImage UIImage;
#else
@compatibility_alias DTImage NSImage;
#endif
// DTFont is UIFont on iOS, NSFont on Mac
#if TARGET_OS_IPHONE
@compatibility_alias DTFont UIFont;
#else
@compatibility_alias DTFont NSFont;
#endif
// DTEdgeInsets is UIEdgeInsets on iOS, NSEdgeInsets on Mac
#if TARGET_OS_IPHONE
#define DTEdgeInsets UIEdgeInsets
#define DTEdgeInsetsMake(a, b, c, d) UIEdgeInsetsMake(a, b, c, d)
#else
#define DTEdgeInsets NSEdgeInsets
#define DTEdgeInsetsMake(a, b, c, d) NSEdgeInsetsMake(a, b, c, d)
// These may be out of place here. Feel free to move them!
// Sourced from https://github.com/andrep/RMModelObject
static inline NSString* NSStringFromCGRect(const CGRect rect)
{
return NSStringFromRect(NSRectFromCGRect(rect));
}
static inline NSString* NSStringFromCGSize(const CGSize size)
{
return NSStringFromSize(NSSizeFromCGSize(size));
}
static inline NSString* NSStringFromCGPoint(const CGPoint point)
{
return NSStringFromPoint(NSPointFromCGPoint(point));
}
#define NSTextAlignmentLeft NSLeftTextAlignment
#define NSTextAlignmentRight NSRightTextAlignment
#define NSTextAlignmentCenter NSCenterTextAlignment
#define NSTextAlignmentJustified NSJustifiedTextAlignment
#define NSTextAlignmentNatural NSNaturalTextAlignment
#endif
Jump to Line
Something went wrong with that request. Please try again.