diff --git a/Charts/Charts.xcodeproj/project.pbxproj b/Charts/Charts.xcodeproj/project.pbxproj index de73c217be..37e91a8ed9 100644 --- a/Charts/Charts.xcodeproj/project.pbxproj +++ b/Charts/Charts.xcodeproj/project.pbxproj @@ -1417,6 +1417,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.pierremarcairoldi.ChartsTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -1436,6 +1437,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.pierremarcairoldi.ChartsTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -1463,6 +1466,7 @@ 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", @@ -1509,6 +1513,7 @@ 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; @@ -1543,6 +1548,7 @@ PRODUCT_NAME = Charts; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -1563,6 +1569,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.dcg.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = Charts; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -1606,6 +1614,7 @@ PRODUCT_NAME = Charts; SDKROOT = macosx; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; @@ -1650,6 +1659,7 @@ PRODUCT_NAME = Charts; SDKROOT = appletvos; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; diff --git a/Charts/Classes/Charts/ChartViewBase.swift b/Charts/Classes/Charts/ChartViewBase.swift index 4a589b458e..537c3776e1 100755 --- a/Charts/Classes/Charts/ChartViewBase.swift +++ b/Charts/Classes/Charts/ChartViewBase.swift @@ -814,13 +814,13 @@ public class ChartViewBase: NSUIView, ChartDataProvider, ChartAnimatorDelegate if (opaque || !transparent) { // Background color may be partially transparent, we must fill with white if we want to output an opaque image - CGContextSetFillColorWithColor(context, NSUIColor.whiteColor().CGColor) - CGContextFillRect(context, rect) + CGContextSetFillColorWithColor(context!, NSUIColor.whiteColor().CGColor) + CGContextFillRect(context!, rect) if (self.backgroundColor !== nil) { - CGContextSetFillColorWithColor(context, self.backgroundColor?.CGColor) - CGContextFillRect(context, rect) + CGContextSetFillColorWithColor(context!, (self.backgroundColor?.CGColor)!) + CGContextFillRect(context!, rect) } } diff --git a/Charts/Classes/Renderers/ScatterChartRenderer.swift b/Charts/Classes/Renderers/ScatterChartRenderer.swift index ce975fce41..abaed75ef6 100644 --- a/Charts/Classes/Renderers/ScatterChartRenderer.swift +++ b/Charts/Classes/Renderers/ScatterChartRenderer.swift @@ -251,7 +251,7 @@ public class ScatterChartRenderer: LineScatterCandleRadarChartRenderer CGContextTranslateCTM(context, point.x, point.y) CGContextBeginPath(context) - CGContextAddPath(context, customShape) + CGContextAddPath(context, customShape!) CGContextFillPath(context) CGContextRestoreGState(context) @@ -410,4 +410,4 @@ public class ScatterChartRenderer: LineScatterCandleRadarChartRenderer CGContextRestoreGState(context) } -} \ No newline at end of file +} diff --git a/Charts/Classes/Utils/ChartFill.swift b/Charts/Classes/Utils/ChartFill.swift index 3814a2a27e..07a5aaee96 100644 --- a/Charts/Classes/Utils/ChartFill.swift +++ b/Charts/Classes/Utils/ChartFill.swift @@ -260,23 +260,23 @@ public class ChartFill: NSObject { case .Color: - CGContextSetFillColorWithColor(context, _color) + CGContextSetFillColorWithColor(context, _color!) CGContextFillPath(context) case .Image: CGContextClip(context) - CGContextDrawImage(context, rect, _image) + CGContextDrawImage(context, rect, _image!) case .TiledImage: CGContextClip(context) - CGContextDrawTiledImage(context, rect, _image) + CGContextDrawTiledImage(context, rect, _image!) case .Layer: CGContextClip(context) - CGContextDrawLayerInRect(context, rect, _layer) + CGContextDrawLayerInRect(context, rect, _layer!) case .LinearGradient: @@ -296,7 +296,7 @@ public class ChartFill: NSObject CGContextClip(context) CGContextDrawLinearGradient( context, - _gradient, + _gradient!, startPoint, endPoint, [.DrawsAfterEndLocation, .DrawsBeforeStartLocation] @@ -310,7 +310,7 @@ public class ChartFill: NSObject CGContextClip(context) CGContextDrawRadialGradient( context, - _gradient, + _gradient!, CGPointMake( centerPoint.x + rect.width * _gradientStartOffsetPercent.x, centerPoint.y + rect.height * _gradientStartOffsetPercent.y @@ -331,4 +331,4 @@ public class ChartFill: NSObject CGContextRestoreGState(context) } -} \ No newline at end of file +} diff --git a/Charts/Classes/Utils/ChartPlatform.swift b/Charts/Classes/Utils/ChartPlatform.swift index a5fc7c6de1..956d24b46c 100644 --- a/Charts/Classes/Utils/ChartPlatform.swift +++ b/Charts/Classes/Utils/ChartPlatform.swift @@ -108,7 +108,7 @@ types are aliased to either their UI* implementation (on iOS) or their NS* imple self.nsuiTouchesEnded(touches, withEvent: event) } - public final override func touchesCancelled(touches: Set?, withEvent event: NSUIEvent?) + public final override func touchesCancelled(touches: Set, withEvent event: NSUIEvent?) { self.nsuiTouchesCancelled(touches, withEvent: event) } @@ -130,7 +130,7 @@ types are aliased to either their UI* implementation (on iOS) or their NS* imple public func nsuiTouchesCancelled(touches: Set?, withEvent event: NSUIEvent?) { - super.touchesCancelled(touches, withEvent: event!) + super.touchesCancelled(touches!, withEvent: event!) } var nsuiLayer: CALayer?