Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Collected fixes and improvements #247

Merged
merged 9 commits into from

4 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 19, 2012
  1. @alunsford3

    Modified the Readme.markdown to have more clear submodule instruction…

    alunsford3 authored
    …s, removing unnecessary steps.
  2. @alunsford3
  3. @alunsford3

    Readme updates

    alunsford3 authored
Commits on Nov 20, 2012
  1. @giladno

    HR background color fix

    giladno authored
Commits on Nov 28, 2012
  1. Fixing building for 10.7 SDK.

    Jan Weiß authored
  2. Cleaning up comments.

    Jan Weiß authored
Commits on Nov 29, 2012
  1. Fixing unit test on iOS 5.1.

    Jan Weiß authored
This page is out of date. Refresh to see the latest.
2  Core/Externals/DTFoundation
@@ -1 +1 @@
-Subproject commit 4e9653113f96b5d91e527b33787a889c05f59676
+Subproject commit 8cafff85d2845c3c2560fe0eec4f6726d9add227
View
12 Core/Source/DTColor+HTML.h
@@ -78,8 +78,8 @@
*/
- (NSString *)htmlHexString;
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8
-/**
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_7
+/**
Converts a CGColorRef into an NSColor by placing each component into an NSColor and pending on the component count to return a grayscale or rgb color. If there are not 2 (grayscale) or 4 (rgba) components the color is from an unsupported color space and nil is returned.
@param cgColor The CGColorRef to convert
@returns An NSColor of this CGColorRef
@@ -87,10 +87,10 @@
+ (NSColor *)colorWithCGColor:(CGColorRef)cgColor;
/**
- Pass through method. This is used for unit testing
- @returns This color. Returns self.
- */
-- (NSColor *)CGColor;
+ Converts an NSColor into a CGColorRef.
+ @returns A CGColorRef of this NSColor
+*/
+- (CGColorRef)CGColor;
#endif
@end
View
19 Core/Source/DTColor+HTML.m
@@ -490,7 +490,7 @@ - (NSString *)htmlHexString
(NSUInteger)(green * (CGFloat)255), (NSUInteger)(blue * (CGFloat)255)];
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_7
+ (NSColor *)colorWithCGColor:(CGColorRef)cgColor
{
size_t count = CGColorGetNumberOfComponents(cgColor);
@@ -512,10 +512,21 @@ + (NSColor *)colorWithCGColor:(CGColorRef)cgColor
return nil;
}
-// pass through
-- (NSColor *)CGColor
+// From https://gist.github.com/1593255
+- (CGColorRef)CGColor
{
- return self;
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+
+ NSColor *selfCopy = [self colorUsingColorSpaceName:NSDeviceRGBColorSpace];
+
+ CGFloat colorValues[4];
+ [selfCopy getRed:&colorValues[0] green:&colorValues[1] blue:&colorValues[2] alpha:&colorValues[3]];
+
+ CGColorRef color = CGColorCreate(colorSpace, colorValues);
+
+ CGColorSpaceRelease(colorSpace);
+
+ return color;
}
#endif
View
17 Core/Source/DTCompatibility.h
@@ -27,4 +27,21 @@
#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));
+}
#endif
View
12 Core/Source/DTHTMLAttributedStringBuilder.m
@@ -130,7 +130,7 @@ - (BOOL)_buildString
[_globalStyleSheet mergeStylesheet:defaultStylesheet];
}
- // for performance we will return this mutable string
+ // for performance reasons we will return this mutable string
tmpString = [[NSMutableAttributedString alloc] init];
needsListItemStart = NO;
@@ -160,7 +160,7 @@ - (BOOL)_buildString
defaultLinkColor = [DTColor colorWithHTMLName:(NSString *)defaultLinkColor];
}
- // get hex code for t he passed color
+ // get hex code for the passed color
NSString *colorHex = [defaultLinkColor htmlHexString];
// overwrite the style
@@ -465,7 +465,7 @@ - (void)_registerTagStartHandlers
#if TARGET_OS_IPHONE
if (needsListItemStart)
{
- // we have an opening but not have flushed text since
+ // we have an opening tag, but haven’t flushed the text since
needsNewLineBefore = YES;
currentTag.paragraphStyle.paragraphSpacing = 0;
@@ -531,7 +531,7 @@ - (void)_registerTagStartHandlers
currentTag.paragraphStyle.textLists = textLists;
- // next text needs a NL before it
+ // next text needs a NL inserted before it
needsNewLineBefore = YES;
};
@@ -560,7 +560,7 @@ - (void)_registerTagStartHandlers
if (currentTag.backgroundColor)
{
- [styleDict setObject:currentTag.backgroundColor forKey:@"BackgroundColor"];
+ [styleDict setObject:currentTag.backgroundColor forKey:DTBackgroundColorAttribute];
}
[currentTag addAdditionalAttribute:styleDict forKey:DTHorizontalRuleStyleAttribute];
@@ -803,7 +803,7 @@ - (void)_handleTagContent:(NSString *)string
- (void)_flushListPrefix
{
- // if we start a list, then we wait until we have actual text
+ // if we start a list, we need to wait until we have the actual text
if (needsListItemStart)
{
DTCSSListStyle *effectiveList = [currentTag.paragraphStyle.textLists lastObject];
View
8 Core/Test/Source/MacUnitTest.m
@@ -80,7 +80,13 @@ + (void)initialize
[test internalTestCaseWithURL:URL withTempPath:tempPath];
};
- IMP myIMP = imp_implementationWithBlock((__bridge id)((__bridge void *)impBlock));
+ // See http://stackoverflow.com/questions/6357663/casting-a-block-to-a-void-for-dynamic-class-method-resolution
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_7
+ void *impBlockForIMP = (void *)objc_unretainedPointer(impBlock);
+#else
+ id impBlockForIMP = (__bridge id)objc_unretainedPointer(impBlock);
+#endif
+ IMP myIMP = imp_implementationWithBlock(impBlockForIMP);
SEL selector = NSSelectorFromString(selectorName);
View
104 DTCoreText.xcodeproj/project.pbxproj
@@ -29,6 +29,9 @@
36F8CECC1593AA3C00E9599C /* DTHTMLAttributedStringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A7949A4514CAF58C00A8CCDE /* DTHTMLAttributedStringBuilder.h */; settings = {ATTRIBUTES = (Public, ); }; };
36F8CECE1593AA3D00E9599C /* DTHTMLAttributedStringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A7949A4514CAF58C00A8CCDE /* DTHTMLAttributedStringBuilder.h */; settings = {ATTRIBUTES = (Public, ); }; };
36F8CECF1593AA4200E9599C /* DTHTMLAttributedStringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A7949A4514CAF58C00A8CCDE /* DTHTMLAttributedStringBuilder.h */; };
+ 3D710A1716662DF8008EFC73 /* libDTHTMLParser.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A7E383D4160DFF2600CF72D6 /* libDTHTMLParser.a */; };
+ 3D710A1816662DFD008EFC73 /* libDTFoundation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A7E383B9160DFEA800CF72D6 /* libDTFoundation.a */; };
+ 3D7CE54D166613F90028D339 /* libDTHTMLParser.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D7CE54A166613E10028D339 /* libDTHTMLParser.a */; };
A704C93A13901FDB0045CFC6 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A704C93913901FDB0045CFC6 /* ImageIO.framework */; };
A7081EA415036460002987F1 /* DTTextBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = A7081EA11503645F002987F1 /* DTTextBlock.h */; settings = {ATTRIBUTES = (Public, ); }; };
A7081EA515036460002987F1 /* DTTextBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = A7081EA215036460002987F1 /* DTTextBlock.m */; };
@@ -55,7 +58,6 @@
A760F54114F56E9000AD1B0E /* DTImage+HTML.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C5D01314D7E3BB00AF1D75 /* DTImage+HTML.h */; settings = {ATTRIBUTES = (Public, ); }; };
A76994F714DBB3DD0047CC8D /* NavTag.html in Resources */ = {isa = PBXBuildFile; fileRef = A76994F614DBB3DD0047CC8D /* NavTag.html */; };
A76E5B4912DD9AF500711782 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A76E5B4812DD9AF500711782 /* QuartzCore.framework */; };
- A780D1031626A19B00D61229 /* libDTHTMLParser.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A7E383D4160DFF2600CF72D6 /* libDTHTMLParser.a */; };
A780D1071626A24F00D61229 /* libDTFoundation_Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A7E383BD160DFEA800CF72D6 /* libDTFoundation_Mac.a */; };
A788C95814863E8700E1AFD9 /* CGUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = A788C90E14863E8700E1AFD9 /* CGUtils.h */; settings = {ATTRIBUTES = (Public, ); }; };
A788C95914863E8700E1AFD9 /* CGUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = A788C90E14863E8700E1AFD9 /* CGUtils.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -512,20 +514,48 @@
/* End PBXBuildRule section */
/* Begin PBXContainerItemProxy section */
- A7335CC91616DA8300482C19 /* PBXContainerItemProxy */ = {
+ 3D7CE549166613E10028D339 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A7E383AB160DFEA700CF72D6 /* DTFoundation.xcodeproj */;
proxyType = 2;
- remoteGlobalIDString = FAE5B92D1610A38200CA0D99;
- remoteInfo = PDFDemo;
+ remoteGlobalIDString = 3D7CE547166613B60028D339;
+ remoteInfo = "DTHTMLParser (Mac)";
+ };
+ 3D7CE54B166613E70028D339 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = A7E383AB160DFEA700CF72D6 /* DTFoundation.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = 3D7CE53D166613B60028D339;
+ remoteInfo = "DTHTMLParser (Mac)";
+ };
+ 3D7CE562166620C70028D339 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = A7E383AB160DFEA700CF72D6 /* DTFoundation.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = A7787A0D16441B1800AF5830;
+ remoteInfo = DTBonjour;
+ };
+ 3D7CE5A91666253A0028D339 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = A7E383AB160DFEA700CF72D6 /* DTFoundation.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = A70B4CE61486637E00873A4A;
+ remoteInfo = "Static Library";
};
- A780D1001626A18A00D61229 /* PBXContainerItemProxy */ = {
+ 3D7CE5AB166625420028D339 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A7E383AB160DFEA700CF72D6 /* DTFoundation.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = A7E383C1160DFEDB00CF72D6;
remoteInfo = DTHTMLParser;
};
+ A7335CC91616DA8300482C19 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = A7E383AB160DFEA700CF72D6 /* DTFoundation.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = FAE5B92D1610A38200CA0D99;
+ remoteInfo = PDFDemo;
+ };
A780D1051626A24A00D61229 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A7E383AB160DFEA700CF72D6 /* DTFoundation.xcodeproj */;
@@ -823,6 +853,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 3D710A1816662DFD008EFC73 /* libDTFoundation.a in Frameworks */,
+ 3D710A1716662DF8008EFC73 /* libDTHTMLParser.a in Frameworks */,
A788CA7C148645A600E1AFD9 /* SenTestingKit.framework in Frameworks */,
A788CA6B1486456100E1AFD9 /* UIKit.framework in Frameworks */,
A788CA6C1486456100E1AFD9 /* Foundation.framework in Frameworks */,
@@ -839,8 +871,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 3D7CE54D166613F90028D339 /* libDTHTMLParser.a in Frameworks */,
A780D1071626A24F00D61229 /* libDTFoundation_Mac.a in Frameworks */,
- A780D1031626A19B00D61229 /* libDTHTMLParser.a in Frameworks */,
A7F5671D14D8469000D1F167 /* Cocoa.framework in Frameworks */,
A7C1CC0F14D6CFD5008D6468 /* AppKit.framework in Frameworks */,
A7949A5914CC456000A8CCDE /* SenTestingKit.framework in Frameworks */,
@@ -1195,9 +1227,11 @@
A7E383BB160DFEA800CF72D6 /* UnitTests.octest */,
A7E383BD160DFEA800CF72D6 /* libDTFoundation_Mac.a */,
A7E383D4160DFF2600CF72D6 /* libDTHTMLParser.a */,
+ 3D7CE54A166613E10028D339 /* libDTHTMLParser.a */,
A7E383EB160DFFDE00CF72D6 /* libDTZipArchive.a */,
A7E38402160E007A00CF72D6 /* libDTDownloadCache.a */,
A7335CCA1616DA8300482C19 /* PDFDemo.app */,
+ 3D7CE563166620C70028D339 /* libDTBonjour.a */,
);
name = Products;
sourceTree = "<group>";
@@ -1451,6 +1485,8 @@
A758FC9D14DBD76E007DF8B2 /* PBXBuildRule */,
);
dependencies = (
+ 3D7CE5AC166625420028D339 /* PBXTargetDependency */,
+ 3D7CE5AA1666253A0028D339 /* PBXTargetDependency */,
);
name = UnitTest;
productName = UnitTests;
@@ -1470,8 +1506,8 @@
A758FC9F14DBD77D007DF8B2 /* PBXBuildRule */,
);
dependencies = (
+ 3D7CE54C166613E70028D339 /* PBXTargetDependency */,
A780D1061626A24A00D61229 /* PBXTargetDependency */,
- A780D1011626A18A00D61229 /* PBXTargetDependency */,
);
name = MacUnitTest;
productName = MacUnitTest;
@@ -1560,6 +1596,20 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
+ 3D7CE54A166613E10028D339 /* libDTHTMLParser.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libDTHTMLParser.a;
+ remoteRef = 3D7CE549166613E10028D339 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 3D7CE563166620C70028D339 /* libDTBonjour.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libDTBonjour.a;
+ remoteRef = 3D7CE562166620C70028D339 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
A7335CCA1616DA8300482C19 /* PDFDemo.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
@@ -2027,10 +2077,20 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
- A780D1011626A18A00D61229 /* PBXTargetDependency */ = {
+ 3D7CE54C166613E70028D339 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "DTHTMLParser (Mac)";
+ targetProxy = 3D7CE54B166613E70028D339 /* PBXContainerItemProxy */;
+ };
+ 3D7CE5AA1666253A0028D339 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "Static Library";
+ targetProxy = 3D7CE5A91666253A0028D339 /* PBXContainerItemProxy */;
+ };
+ 3D7CE5AC166625420028D339 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = DTHTMLParser;
- targetProxy = A780D1001626A18A00D61229 /* PBXContainerItemProxy */;
+ targetProxy = 3D7CE5AB166625420028D339 /* PBXContainerItemProxy */;
};
A780D1061626A24A00D61229 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
@@ -2195,7 +2255,7 @@
PRODUCT_NAME = DTCoreText;
PUBLIC_HEADERS_FOLDER_PATH = ../../DTCoreText;
SKIP_INSTALL = YES;
- USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Core/Source\" Core/Externals/**";
+ USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Core/Source\" \"$(SRCROOT)/Core/Externals\"/**";
};
name = Debug;
};
@@ -2217,7 +2277,7 @@
PRODUCT_NAME = DTCoreText;
PUBLIC_HEADERS_FOLDER_PATH = ../../DTCoreText;
SKIP_INSTALL = YES;
- USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Core/Source\" Core/Externals/**";
+ USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Core/Source\" \"$(SRCROOT)/Core/Externals\"/**";
VALIDATE_PRODUCT = YES;
};
name = Release;
@@ -2259,6 +2319,10 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ HEADER_SEARCH_PATHS = (
+ /usr/include/libxml2,
+ "\"$(SRCROOT)/Core/Externals\"/**",
+ );
INFOPLIST_FILE = "Core/Test/UnitTest-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_AFTER_BUILD = YES;
@@ -2280,6 +2344,10 @@
GCC_PREFIX_HEADER = "Core/Test/UnitTest-Prefix.pch";
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ HEADER_SEARCH_PATHS = (
+ /usr/include/libxml2,
+ "\"$(SRCROOT)/Core/Externals\"/**",
+ );
INFOPLIST_FILE = "Core/Test/UnitTest-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_AFTER_BUILD = YES;
@@ -2320,7 +2388,7 @@
"-ObjC",
);
PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = macosx;
+ SDKROOT = macosx10.7;
USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Core/Externals\"/** \"$(SRCROOT)/Core/Source\"";
WRAPPER_EXTENSION = octest;
};
@@ -2351,7 +2419,7 @@
"-ObjC",
);
PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = macosx;
+ SDKROOT = macosx10.7;
USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Core/Externals\"/** \"$(SRCROOT)/Core/Source\"";
WRAPPER_EXTENSION = octest;
};
@@ -2410,7 +2478,6 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
@@ -2420,6 +2487,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = /usr/include/libxml2;
IPHONEOS_DEPLOYMENT_TARGET = 4.2;
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
SDKROOT = iphoneos;
USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Core/Source\"";
};
@@ -2428,7 +2496,6 @@
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
@@ -2438,6 +2505,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = /usr/include/libxml2;
IPHONEOS_DEPLOYMENT_TARGET = 4.2;
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Core/Source\"";
@@ -2476,10 +2544,9 @@
"\"$(SRCROOT)/Core/Externals\"/**",
);
INFOPLIST_FILE = "Core/DTCoreText-Info.plist";
- MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = DTCoreText;
- SDKROOT = macosx;
+ SDKROOT = macosx10.7;
USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Core/Source\" \"$(SRCROOT)/Core/Externals\"/**";
WRAPPER_EXTENSION = framework;
};
@@ -2511,9 +2578,8 @@
"\"$(SRCROOT)/Core/Externals\"/**",
);
INFOPLIST_FILE = "Core/DTCoreText-Info.plist";
- MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_NAME = DTCoreText;
- SDKROOT = macosx;
+ SDKROOT = macosx10.7;
USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Core/Source\" \"$(SRCROOT)/Core/Externals\"/**";
WRAPPER_EXTENSION = framework;
};
View
45 Readme.markdown
@@ -51,44 +51,41 @@ Setup
The best way to use DTCoreText is to add it in Xcode as a subproject of your project with the following steps.
-1. Clone DTCoreText into a subfolder of your project folder or make it a git submodule
+1. Make DTCoreText a git submodule of your project
- git clone https://github.com/Cocoanetics/DTCoreText.git Externals/DTCoreText
+ `git submodule add https://github.com/Cocoanetics/DTCoreText.git Externals/DTCoreText`
-2. DTCoreText uses DTHTMLParser and DTVersion from DTFoundation which is set up as a git submodule too in Core/Externals/DTFoundation, so you need to get these files as well
+2. DTCoreText uses DTHTMLParser and DTVersion from DTFoundation which is set up as a git submodule in Core/Externals/DTFoundation, so you need to get these files as well
- git submodule update --init --recursive
+ `git submodule update --init --recursive`
-3. Open the destination project and drag `DTCoreText.xcodeproj` as a subordinate item in the Project Navigator
-4. In your prefix.pch file add:
-
- #import "DTCoreText.h"
+3. Open the destination project and create an "Externals" group.
+
+4. Add files… or drag `DTCoreText.xcodeproj` to the Externals group
-5. In your application target's Build Phases add the "Static Library" from the DTCoreText sub-project as a dependency.
+5. In your application target's Build Phases: Target Dependencies add the `Static Library` from the DTCoreText sub project
-6. In your application target's Build Phases add all of the below to the Link Binary With Libraries phase (you can also do this from the Target's Summary view in the Linked Frameworks and Libraries):
+6. In your application target's Build Phases: Link Binary With Libraries phase add the following:
- The "Static Library" target from the DTCoreText sub-project
+ libDTCoreText.a (target from the DTCoreText sub-project)
+ libxml2.dylib
ImageIO.framework
QuartzCore.framework
- libxml2.dylib
- CoreText.framework (DOH!)
+ CoreText.framework
+ MobileCoreServices.framework
7. Go to File: Project Settings… and change the derived data location to project-relative.
-8. Add the DerivedData folder to your git ignore.
-9. In your application's target Build Settings:
- - Set the "User Header Search Paths" to the directory containing your project with recrusive set to YES.
- - Set the Header Search Paths to /usr/include/libxml2.
- - Set "Always Search User Paths" to YES.
- - Set the "Other Linker Flags" below
-If you do not want to deal with Git submodules simply add DTCoreText to your project's git ignore file and pull updates to DTCoreText as its own independent Git repository. Otherwise you are free to add DTCoreText as a submodule.
+8. Add the DerivedData folder to your git ignore.
-LINKER SETTINGS:
+9. In your application's target Build Settings:
+ - Add `$(PROJECT_DIR)` to `User Header Search Paths`, set to `recursive`
+ - Set `Always Search User Paths` to `Yes`.
+ - Add the `-ObjC` flag to your app target's `Other Linker Flags`
- - add the -ObjC to your app target's "Other Linker Flags". This is needed whenever you link in any static library that contains Objective-C classes and categories.
- - if you find that your app crashes with an unrecognized selector from one of this library's categories, you might also need the -all_load linker flag. Alternatively you can use -force-load with the full path to the static library. This causes the linker to load all categories from the static library.
- - If your app does not use ARC yet (but DTCoreText does) then you also need the -fobjc-arc linker flag.
+OPTIONAL LINKER SETTINGS:
+ - If you find that your app crashes with an unrecognized selector from one of this library's categories, you might also need the `-all_load linker` flag. Alternatively you can use `-force-load` with the full path to the static library. This causes the linker to load all categories from the static library.
+ - If your app does not use ARC yet (but DTCoreText does) then you also need the `-fobjc-arc` linker flag.
Known Issues
------------
Something went wrong with that request. Please try again.