diff --git a/ACEDrawingView/ACEDrawingToolState.m b/ACEDrawingView/ACEDrawingToolState.m index 10396d8..32c50d3 100644 --- a/ACEDrawingView/ACEDrawingToolState.m +++ b/ACEDrawingView/ACEDrawingToolState.m @@ -37,8 +37,7 @@ + (instancetype)stateForTool:(id)tool return [ACEDrawingToolState stateForTool:tool capturePosition:NO]; } -+ (instancetype)stateForTool:(id)tool capturePosition:(BOOL)capture -{ ++ (instancetype)stateForTool:(id)tool capturePosition:(BOOL)capture { ACEDrawingToolState *state = [ACEDrawingToolState new]; state.tool = tool; diff --git a/ACEDrawingView/ACEDrawingTools.h b/ACEDrawingView/ACEDrawingTools.h index de46420..d707fdd 100644 --- a/ACEDrawingView/ACEDrawingTools.h +++ b/ACEDrawingView/ACEDrawingTools.h @@ -43,7 +43,7 @@ #endif -@protocol ACEDrawingTool +@protocol ACEDrawingTool @property (nonatomic, strong) UIColor *lineColor; @property (nonatomic, assign) CGFloat lineAlpha; @@ -71,6 +71,7 @@ } - (CGRect)addPathPreviousPreviousPoint:(CGPoint)p2Point withPreviousPoint:(CGPoint)p1Point withCurrentPoint:(CGPoint)cpoint; +- (NSData *)savePenToolData; @end diff --git a/ACEDrawingView/ACEDrawingTools.m b/ACEDrawingView/ACEDrawingTools.m index a43faad..0e563a3 100644 --- a/ACEDrawingView/ACEDrawingTools.m +++ b/ACEDrawingView/ACEDrawingTools.m @@ -47,7 +47,7 @@ @implementation ACEDrawingPenTool - (id)init { self = [super init]; - if (self != nil) { + if (self) { self.lineCapStyle = kCGLineCapRound; path = CGPathCreateMutable(); } @@ -570,7 +570,6 @@ - (void)draw if (self.fill) { CGContextSetFillColorWithColor(context, self.lineColor.CGColor); CGContextFillEllipseInRect(UIGraphicsGetCurrentContext(), rectToFill); - } else { CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor); CGContextSetLineWidth(context, self.lineWidth); diff --git a/ACEDrawingView/ACEDrawingView.m b/ACEDrawingView/ACEDrawingView.m index adfe66c..f39bef5 100644 --- a/ACEDrawingView/ACEDrawingView.m +++ b/ACEDrawingView/ACEDrawingView.m @@ -205,7 +205,8 @@ - (void)setCustomDrawTool:(id)customDrawTool switch (self.drawTool) { case ACEDrawingToolTypePen: { - return ACE_AUTORELEASE([ACEDrawingPenTool new]); + ACEDrawingPenTool *tool = ACE_AUTORELEASE([ACEDrawingPenTool new]); + return tool; } case ACEDrawingToolTypeLine: diff --git a/ACEDrawingViewDemo.xcodeproj/project.pbxproj b/ACEDrawingViewDemo.xcodeproj/project.pbxproj index a672c9b..f5b7729 100644 --- a/ACEDrawingViewDemo.xcodeproj/project.pbxproj +++ b/ACEDrawingViewDemo.xcodeproj/project.pbxproj @@ -218,7 +218,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = ACE; - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0810; ORGANIZATIONNAME = "Stefano Acerbetti"; TargetAttributes = { 50F58C4B1D7F0F4B0050A4A0 = { @@ -482,22 +482,34 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + 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_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -511,14 +523,26 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; + 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; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/ACEDrawingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/Sebastiaan.xcuserdatad/UserInterfaceState.xcuserstate b/ACEDrawingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/Sebastiaan.xcuserdatad/UserInterfaceState.xcuserstate index 5e65ff9..ec608ce 100644 Binary files a/ACEDrawingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/Sebastiaan.xcuserdatad/UserInterfaceState.xcuserstate and b/ACEDrawingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/Sebastiaan.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ACEDrawingViewDemo.xcodeproj/xcshareddata/xcschemes/ACEDrawingViewDemo.xcscheme b/ACEDrawingViewDemo.xcodeproj/xcshareddata/xcschemes/ACEDrawingViewDemo.xcscheme index 7b5e527..5c4bf98 100644 --- a/ACEDrawingViewDemo.xcodeproj/xcshareddata/xcschemes/ACEDrawingViewDemo.xcscheme +++ b/ACEDrawingViewDemo.xcodeproj/xcshareddata/xcschemes/ACEDrawingViewDemo.xcscheme @@ -1,6 +1,6 @@