Permalink
Browse files

replaced typedef for DTColor/DTImage with @compatibility_alias

  • Loading branch information...
odrobnik committed Mar 21, 2012
1 parent 75502c9 commit a2940f1228a5ba9161aa1ff6b5486cecdb50c21d
@@ -6,9 +6,8 @@
// Copyright 2011 Drobnik.com. All rights reserved.
//
+#import "DTCoreText.h"
#import "DTAttributedTextCell.h"
-#import "DTAttributedTextContentView.h"
-#import "DTColor+HTML.h"
@implementation DTAttributedTextCell
{
@@ -6,18 +6,8 @@
// Copyright 2011 Drobnik.com. All rights reserved.
//
-#import "DTCoreTextConstants.h"
-
#import "DTAttributedTextContentView.h"
-#import "DTAttributedTextView.h"
-#import "DTCoreTextLayoutFrame.h"
-
-#import "DTTextAttachment.h"
-#import "NSString+HTML.h"
-#import "DTColor+HTML.h"
-
-#import "DTLinkButton.h"
-
+#import "DTCoreText.h"
#import <QuartzCore/QuartzCore.h>
#if !__has_feature(objc_arc)
@@ -7,9 +7,7 @@
//
#import "DTAttributedTextView.h"
-#import "DTAttributedTextContentView.h"
-
-#import "DTColor+HTML.h"
+#import "DTCoreText.h"
@interface DTAttributedTextView ()
@@ -13,8 +13,6 @@
*/
@interface UIColor (HTML)
-typedef UIColor DTColor;
-
/**
Takes a CSS color string ('333', 'F9FFF9'), determines the RGB values used, and returns a UIColor object of that color.
For each part of the RGB color those numbers for that color are converted to a number using a category on NSString. Then that number is divided by the maximum value, 15 for 3 character strings and 255 for 6 character strings, making the color a percentage and within the range 0.0 and 1.0 that UIColor uses.
@@ -49,8 +47,6 @@ typedef UIColor DTColor;
#else
-typedef NSColor DTColor;
-
/**
Methods used to work with HTML representations of colors.
*/
View
@@ -6,9 +6,21 @@
#import "DTCoreTextConstants.h"
// DTColor is UIColor on iOS, NSColor on Mac
+#if TARGET_OS_IPHONE
+@compatibility_alias DTColor UIColor;
+#else
+@compatibility_alias DTColor NSColor;
+#endif
+
#import "DTColor+HTML.h"
// DTImage is UIImage on iOS, NSImage on Mac
+#if TARGET_OS_IPHONE
+@compatibility_alias DTImage UIImage;
+#else
+@compatibility_alias DTImage NSImage;
+#endif
+
#import "DTImage+HTML.h"
// DTEdgeInsets is UIEdgeInsets on iOS, NSEdgeInsets on Mac
View
@@ -1,9 +1,13 @@
-
+//
+// DTImage+HTML.h
+// CoreTextExtensions
+//
+// Created by Oliver Drobnik on 1/9/11.
+// Copyright 2011 Drobnik.com. All rights reserved.
+//
#if TARGET_OS_IPHONE
-typedef UIImage DTImage;
-
/**
Category used to have the same method available for unit testing on Mac on iOS.
*/
@@ -20,8 +24,6 @@ typedef UIImage DTImage;
#else
-typedef NSImage DTImage;
-
/**
Category used to have the same method available for unit testing on Mac on iOS.
*/
@@ -7,12 +7,8 @@
//
#import "DTTextAttachment.h"
-#import "DTHTMLElement.h"
-#import "CGUtils.h"
-#import "NSAttributedString+HTML.h"
+#import "DTCoreText.h"
#import "NSData+DTBase64.h"
-#import "DTImage+HTML.h"
-#import "DTCoreTextConstants.h"
@implementation DTTextAttachment
{

0 comments on commit a2940f1

Please sign in to comment.