Skip to content

Commit

Permalink
Merge branch 'halseth-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
arielelkin committed Nov 5, 2015
2 parents f69e180 + 77f278d commit 1c45b8b
Show file tree
Hide file tree
Showing 6 changed files with 444 additions and 8 deletions.
13 changes: 9 additions & 4 deletions PocketSVG.m
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,13 @@ + (NSString *)svgStringAtURL:(NSURL *)svgFileURL
Returns the content of the SVG's d attribute as an NSString
*/
+ (NSString *)parseSVGNamed:(NSString *)nameOfSVG{
#if !TARGET_INTERFACE_BUILDER
NSBundle *bundle = [NSBundle mainBundle];
#else
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
#endif

NSString *pathOfSVGFile = [[NSBundle bundleForClass:[self class]] pathForResource:nameOfSVG ofType:@"svg"]; // Use 'bundleForClass' instead of 'mainBundle' for Interface Builder Designable compatibility.
NSString *pathOfSVGFile = [bundle pathForResource:nameOfSVG ofType:@"svg"]; // Use 'bundleForClass' instead of 'mainBundle' for Interface Builder Designable compatibility.

if(pathOfSVGFile == nil){
NSLog(@"*** PocketSVG Error: No SVG file named \"%@\".", nameOfSVG);
Expand Down Expand Up @@ -551,9 +556,9 @@ - (void)appendSVGQCommand:(Token *)token
CGFloat scalar = 2/3;
CGPoint startPoint = lastPoint;
lastPoint = CGPointMake(x, y);
[bezier addCurveToPoint:NSPointFromCGPoint(lastPoint)
controlPoint1:NSPointFromCGPoint(CGPointMake(startPoint.x + scalar*(lastControlPoint.x - startPoint.x), startPoint.y + scalar*(lastControlPoint.y - startPoint.y)))
controlPoint2:NSPointFromCGPoint(CGPointMake(startPoint.x + scalar*(lastControlPoint.x - lastPoint.x), startPoint.y + scalar*(lastControlPoint.y - lastPoint.y)))];
[bezier curveToPoint:NSPointFromCGPoint(lastPoint)
controlPoint1:NSPointFromCGPoint(CGPointMake(startPoint.x + scalar*(lastControlPoint.x - startPoint.x), startPoint.y + scalar*(lastControlPoint.y - startPoint.y)))
controlPoint2:NSPointFromCGPoint(CGPointMake(startPoint.x + scalar*(lastControlPoint.x - lastPoint.x), startPoint.y + scalar*(lastControlPoint.y - lastPoint.y)))];
#endif
}
}
Expand Down
291 changes: 291 additions & 0 deletions PocketSVGFramework.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
04ECF1811BDB8D6500B524FA /* PocketSVGFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 04ECF1801BDB8D6500B524FA /* PocketSVGFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
04ECF1991BDB8D9600B524FA /* PocketSVG.h in Headers */ = {isa = PBXBuildFile; fileRef = 04ECF1971BDB8D9600B524FA /* PocketSVG.h */; settings = {ATTRIBUTES = (Public, ); }; };
04ECF19A1BDB8D9600B524FA /* PocketSVG.m in Sources */ = {isa = PBXBuildFile; fileRef = 04ECF1981BDB8D9600B524FA /* PocketSVG.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
04ECF17D1BDB8D6500B524FA /* PocketSVGFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PocketSVGFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
04ECF1801BDB8D6500B524FA /* PocketSVGFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PocketSVGFramework.h; sourceTree = "<group>"; };
04ECF1821BDB8D6500B524FA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
04ECF1971BDB8D9600B524FA /* PocketSVG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PocketSVG.h; sourceTree = "<group>"; };
04ECF1981BDB8D9600B524FA /* PocketSVG.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PocketSVG.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
04ECF1791BDB8D6500B524FA /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
04ECF1731BDB8D6500B524FA = {
isa = PBXGroup;
children = (
04ECF1971BDB8D9600B524FA /* PocketSVG.h */,
04ECF1981BDB8D9600B524FA /* PocketSVG.m */,
04ECF17F1BDB8D6500B524FA /* PocketSVGFramework */,
04ECF17E1BDB8D6500B524FA /* Products */,
);
sourceTree = "<group>";
};
04ECF17E1BDB8D6500B524FA /* Products */ = {
isa = PBXGroup;
children = (
04ECF17D1BDB8D6500B524FA /* PocketSVGFramework.framework */,
);
name = Products;
sourceTree = "<group>";
};
04ECF17F1BDB8D6500B524FA /* PocketSVGFramework */ = {
isa = PBXGroup;
children = (
04ECF1801BDB8D6500B524FA /* PocketSVGFramework.h */,
04ECF1821BDB8D6500B524FA /* Info.plist */,
);
path = PocketSVGFramework;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
04ECF17A1BDB8D6500B524FA /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
04ECF1811BDB8D6500B524FA /* PocketSVGFramework.h in Headers */,
04ECF1991BDB8D9600B524FA /* PocketSVG.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
04ECF17C1BDB8D6500B524FA /* PocketSVGFramework */ = {
isa = PBXNativeTarget;
buildConfigurationList = 04ECF1911BDB8D6600B524FA /* Build configuration list for PBXNativeTarget "PocketSVGFramework" */;
buildPhases = (
04ECF1781BDB8D6500B524FA /* Sources */,
04ECF1791BDB8D6500B524FA /* Frameworks */,
04ECF17A1BDB8D6500B524FA /* Headers */,
04ECF17B1BDB8D6500B524FA /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = PocketSVGFramework;
productName = PocketSVGFramework;
productReference = 04ECF17D1BDB8D6500B524FA /* PocketSVGFramework.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
04ECF1741BDB8D6500B524FA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0710;
ORGANIZATIONNAME = "Johan Torås Halseth";
TargetAttributes = {
04ECF17C1BDB8D6500B524FA = {
CreatedOnToolsVersion = 7.1;
};
};
};
buildConfigurationList = 04ECF1771BDB8D6500B524FA /* Build configuration list for PBXProject "PocketSVGFramework" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 04ECF1731BDB8D6500B524FA;
productRefGroup = 04ECF17E1BDB8D6500B524FA /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
04ECF17C1BDB8D6500B524FA /* PocketSVGFramework */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
04ECF17B1BDB8D6500B524FA /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
04ECF1781BDB8D6500B524FA /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
04ECF19A1BDB8D9600B524FA /* PocketSVG.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
04ECF18F1BDB8D6600B524FA /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.1;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
04ECF1901BDB8D6600B524FA /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.1;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
04ECF1921BDB8D6600B524FA /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = PocketSVGFramework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = arielito.PocketSVGFramework;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
04ECF1931BDB8D6600B524FA /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = PocketSVGFramework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = arielito.PocketSVGFramework;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
04ECF1771BDB8D6500B524FA /* Build configuration list for PBXProject "PocketSVGFramework" */ = {
isa = XCConfigurationList;
buildConfigurations = (
04ECF18F1BDB8D6600B524FA /* Debug */,
04ECF1901BDB8D6600B524FA /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
04ECF1911BDB8D6600B524FA /* Build configuration list for PBXNativeTarget "PocketSVGFramework" */ = {
isa = XCConfigurationList;
buildConfigurations = (
04ECF1921BDB8D6600B524FA /* Debug */,
04ECF1931BDB8D6600B524FA /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 04ECF1741BDB8D6500B524FA /* Project object */;
}
Loading

0 comments on commit 1c45b8b

Please sign in to comment.