diff --git a/.travis.yml b/.travis.yml index 455a6ef7e..1df945ce3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,25 @@ language: objective-c -osx_image: xcode7 +osx_image: xcode11 -env: +ios_env: SDK:iphonesimulator SDK:iphoneos +tvos_env: + TVSDK:appletvsimulator + TVSDK:appletvos + # Framework builds -script: xcodebuild -project framework/CorePlot.xcodeproj -target CorePlot -configuration Release -script: xcodebuild -project framework/CorePlot-CocoaTouch.xcodeproj -target CorePlot-CocoaTouch -sdk ${SDK} -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "CorePlot Mac" -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "CorePlot iOS" -sdk ${SDK} -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "CorePlot tvOS" -sdk ${TVSDK} -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "CorePlot-CocoaTouch" -sdk ${SDK} -configuration Release # Unit tests -script: xcodebuild -project framework/CorePlot.xcodeproj -target UnitTests -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "UnitTests Mac" -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "UnitTests iOS" -sdk ${SDK} -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "UnitTests tvOS" -sdk ${TVSDK} -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "CorePlot-CocoaTouchTests" -sdk ${SDK} -configuration Release # Mac examples script: xcodebuild -project examples/CorePlotGallery/Plot_Gallery.xcodeproj -target "Plot Gallery-Mac" -configuration Release @@ -28,5 +37,8 @@ script: xcodebuild -project examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodepr script: xcodebuild -project examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone.xcodeproj -CPTTestApp-iPhone AAPLot -sdk ${SDK} -configuration Release script: xcodebuild -project examples/StockPlot/StockPlot.xcodeproj -target StockPlot -sdk ${SDK} -configuration Release +# tvOS examples +script: xcodebuild -project examples/CorePlotGallery/Plot_Gallery.xcodeproj -target "Plot Gallery-tvOS" -sdk ${TVSDK} -configuration Release + # Quartz Composer plugin script: xcodebuild -project QCPlugin/CorePlotQCPlugin.xcodeproj -target CorePlotQCPlugin -configuration Release diff --git a/CorePlot-latest.podspec b/CorePlot-latest.podspec index 827707f25..3b958f7e4 100644 --- a/CorePlot-latest.podspec +++ b/CorePlot-latest.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.name = 'CorePlot' s.version = '99.99.99' s.license = 'BSD' - s.summary = 'Cocoa plotting framework for Mac OS X and iOS.' + s.summary = 'Cocoa plotting framework for macOS, iOS, and tvOS.' s.homepage = 'https://github.com/core-plot' s.social_media_url = 'https://twitter.com/CorePlot' s.documentation_url = 'http://core-plot.github.io' @@ -14,28 +14,32 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/core-plot/core-plot.git' } - s.description = 'Core Plot is a plotting framework for OS X and iOS. It provides 2D visualization ' \ + s.description = 'Core Plot is a plotting framework for macOS, iOS, and tvOS. It provides 2D visualization ' \ 'of data, and is tightly integrated with Apple technologies like Core Animation, ' \ 'Core Data, and Cocoa Bindings.' - s.ios.deployment_target = '6.0' - s.osx.deployment_target = '10.7' + s.ios.deployment_target = '8.0' + s.osx.deployment_target = '10.8' + s.tvos.deployment_target = '9.0' s.ios.header_dir = 'ios' s.osx.header_dir = 'osx' + s.tvos.header_dir = 'tvos' - s.source_files = 'framework/Source/*.{h,m}', 'framework/CocoaPods/*.h', 'framework/TestResources/CorePlotProbes.d' + s.source_files = 'framework/Source/*.{h,m}', 'framework/CocoaPods/*.h' s.exclude_files = '**/*{TestCase,Tests}.{h,m}', '**/mainpage.h' s.ios.source_files = 'framework/CorePlot-CocoaTouch.h', 'framework/iPhoneOnly/*.{h,m}' + s.tvos.source_files = 'framework/iPhoneOnly/*.{h,m}' s.osx.source_files = 'framework/MacOnly/*.{h,m}' - s.private_header_files = '**/_*.h', '**/CorePlotProbes.h' + s.private_header_files = '**/_*.h' - s.requires_arc = true - s.xcconfig = { 'ALWAYS_SEARCH_USER_PATHS' => 'YES' } - s.ios.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/ios"' } - s.osx.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/osx"' } + s.requires_arc = true + s.ios.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/ios"' } + s.osx.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/osx"' } + s.tvos.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/tvos"' } - s.frameworks = 'QuartzCore', 'Accelerate' + s.frameworks = 'QuartzCore' s.ios.frameworks = 'UIKit', 'Foundation' + s.tvos.frameworks = 'UIKit', 'Foundation' s.osx.frameworks = 'Cocoa' end \ No newline at end of file diff --git a/CorePlot.podspec b/CorePlot.podspec index 31062b9ce..d6906a089 100644 --- a/CorePlot.podspec +++ b/CorePlot.podspec @@ -1,8 +1,8 @@ Pod::Spec.new do |s| s.name = 'CorePlot' - s.version = '2.0' + s.version = '2.3' s.license = 'BSD' - s.summary = 'Cocoa plotting framework for Mac OS X and iOS.' + s.summary = 'Cocoa plotting framework for macOS, iOS, and tvOS.' s.homepage = 'https://github.com/core-plot' s.social_media_url = 'https://twitter.com/CorePlot' s.documentation_url = 'http://core-plot.github.io' @@ -12,30 +12,34 @@ Pod::Spec.new do |s| 'Eric Skroch' => 'eskroch@mac.com', 'Barry Wark' => 'barrywark@gmail.com' } - s.source = { :git => 'https://github.com/core-plot/core-plot.git', :tag => 'release_2.0'} + s.source = { :git => 'https://github.com/core-plot/core-plot.git', :tag => 'release_2.3'} - s.description = 'Core Plot is a plotting framework for OS X and iOS. It provides 2D visualization ' \ + s.description = 'Core Plot is a plotting framework for macOS, iOS, and tvOS. It provides 2D visualization ' \ 'of data, and is tightly integrated with Apple technologies like Core Animation, ' \ 'Core Data, and Cocoa Bindings.' - s.ios.deployment_target = '6.0' - s.osx.deployment_target = '10.7' + s.ios.deployment_target = '8.0' + s.osx.deployment_target = '10.8' + s.tvos.deployment_target = '9.0' s.ios.header_dir = 'ios' s.osx.header_dir = 'osx' + s.tvos.header_dir = 'tvos' - s.source_files = 'framework/Source/*.{h,m}', 'framework/CocoaPods/*.h', 'framework/TestResources/CorePlotProbes.d' + s.source_files = 'framework/Source/*.{h,m}', 'framework/CocoaPods/*.h' s.exclude_files = '**/*{TestCase,Tests}.{h,m}', '**/mainpage.h' s.ios.source_files = 'framework/CorePlot-CocoaTouch.h', 'framework/iPhoneOnly/*.{h,m}' + s.tvos.source_files = 'framework/iPhoneOnly/*.{h,m}' s.osx.source_files = 'framework/MacOnly/*.{h,m}' - s.private_header_files = '**/_*.h', '**/CorePlotProbes.h' + s.private_header_files = '**/_*.h' - s.requires_arc = true - s.xcconfig = { 'ALWAYS_SEARCH_USER_PATHS' => 'YES' } - s.ios.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/ios"' } - s.osx.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/osx"' } + s.requires_arc = true + s.ios.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/ios"' } + s.osx.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/osx"' } + s.tvos.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/tvos"' } - s.frameworks = 'QuartzCore', 'Accelerate' + s.frameworks = 'QuartzCore' s.ios.frameworks = 'UIKit', 'Foundation' + s.tvos.frameworks = 'UIKit', 'Foundation' s.osx.frameworks = 'Cocoa' end \ No newline at end of file diff --git a/License.txt b/License.txt index 53ba4f2a8..fbd7853fe 100644 --- a/License.txt +++ b/License.txt @@ -1,9 +1,13 @@ -Copyright (c) 2015, Drew McCormack, Brad Larson, Eric Skroch, Barry Wark, Dirkjan Krijnders, Rick Maddy, Vijay Kalusani, Caleb Cannon, Jeff Buck, Thomas Elstner, Jeroen Leenarts, Craig Hockenberry, Hartwig Wiesmann, Koen van der Drift, Nino Ag, Mike Lischke, Trevor Harmon, Travis Fischer, Graham Mueller, Rafał Wójcik, Mike Rossetti, Michael Merickel, Lane Roathe, Ingmar Stein, Sean Holbert, Victor Martin Garcia, Jérôme Morissard, and Demitri Muna. +Copyright (c) 2020, Drew McCormack, Brad Larson, Eric Skroch, Barry Wark, Dirkjan Krijnders, Rick Maddy, Vijay Kalusani, Caleb Cannon, Jeff Buck, Thomas Elstner, Jeroen Leenarts, Craig Hockenberry, Hartwig Wiesmann, Koen van der Drift, Nino Ag, Mike Lischke, Trevor Harmon, Travis Fischer, Graham Mueller, Rafał Wójcik, Mike Rossetti, Michael Merickel, Lane Roathe, Ingmar Stein, Sean Holbert, Victor Martin Garcia, Jérôme Morissard, Demitri Muna, Tim Monzures, Kirill Yakimovich, Tom Izaks, Pascal Freiburghaus, Fred Potter, and Aurélien Hugelé. + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + Neither the name of the Core Plot Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/QCPlugin/Info.plist b/QCPlugin/Base.lproj/Info.plist similarity index 100% rename from QCPlugin/Info.plist rename to QCPlugin/Base.lproj/Info.plist diff --git a/QCPlugin/English.lproj/Settings.xib b/QCPlugin/Base.lproj/Settings.xib similarity index 100% rename from QCPlugin/English.lproj/Settings.xib rename to QCPlugin/Base.lproj/Settings.xib diff --git a/QCPlugin/CPTBarPlotPlugin.h b/QCPlugin/CPTBarPlotPlugin.h index e8ecf371d..e5fbb2bce 100644 --- a/QCPlugin/CPTBarPlotPlugin.h +++ b/QCPlugin/CPTBarPlotPlugin.h @@ -1,4 +1,4 @@ -#import "CorePlotQCPlugIn.h" +#import "CorePlotQCPlugin.h" #import @interface CPTBarPlotPlugIn : CorePlotQCPlugIn diff --git a/QCPlugin/CPTBarPlotPlugin.m b/QCPlugin/CPTBarPlotPlugin.m index 557a0ba7b..77d6fc9fc 100644 --- a/QCPlugin/CPTBarPlotPlugin.m +++ b/QCPlugin/CPTBarPlotPlugin.m @@ -1,4 +1,4 @@ -#import "CPTBarPlotPlugIn.h" +#import "CPTBarPlotPlugin.h" @implementation CPTBarPlotPlugIn @@ -30,69 +30,69 @@ @implementation CPTBarPlotPlugIn +(nonnull NSDictionary *)attributes { return @{ - QCPlugInAttributeNameKey: @"Core Plot Bar Chart", - QCPlugInAttributeDescriptionKey: @"Bar chart" + QCPlugInAttributeNameKey: @"Core Plot Bar Chart", + QCPlugInAttributeDescriptionKey: @"Bar chart" }; } -+(nonnull CPTDictionary)attributesForPropertyPortWithKey:(nonnull NSString *)key ++(nullable CPTDictionary *)attributesForPropertyPortWithKey:(nullable NSString *)key { // A few additional ports for the bar plot chart type ... if ( [key isEqualToString:@"inputBarWidth"] ) { return @{ - QCPortAttributeNameKey: @"Bar Width", - QCPortAttributeDefaultValueKey: @1.0, - QCPortAttributeMinimumValueKey: @0.0 + QCPortAttributeNameKey: @"Bar Width", + QCPortAttributeDefaultValueKey: @1.0, + QCPortAttributeMinimumValueKey: @0.0 }; } if ( [key isEqualToString:@"inputBarOffset"] ) { return @{ - QCPortAttributeNameKey: @"Bar Offset", - QCPortAttributeDefaultValueKey: @0.5 + QCPortAttributeNameKey: @"Bar Offset", + QCPortAttributeDefaultValueKey: @0.5 }; } if ( [key isEqualToString:@"inputBaseValue"] ) { return @{ - QCPortAttributeNameKey: @"Base Value", - QCPortAttributeDefaultValueKey: @0.0 + QCPortAttributeNameKey: @"Base Value", + QCPortAttributeDefaultValueKey: @0.0 }; } if ( [key isEqualToString:@"inputHorizontalBars"] ) { return @{ - QCPortAttributeNameKey: @"Horizontal Bars", - QCPortAttributeDefaultValueKey: @NO + QCPortAttributeNameKey: @"Horizontal Bars", + QCPortAttributeDefaultValueKey: @NO }; } if ( [key isEqualToString:@"inputXMin"] ) { return @{ - QCPortAttributeNameKey: @"X Range Min", - QCPortAttributeDefaultValueKey: @0.0 + QCPortAttributeNameKey: @"X Range Min", + QCPortAttributeDefaultValueKey: @0.0 }; } if ( [key isEqualToString:@"inputXMax"] ) { return @{ - QCPortAttributeNameKey: @"X Range Max", - QCPortAttributeDefaultValueKey: @5.0 + QCPortAttributeNameKey: @"X Range Max", + QCPortAttributeDefaultValueKey: @5.0 }; } if ( [key isEqualToString:@"inputYMin"] ) { return @{ - QCPortAttributeNameKey: @"Y Range Min", - QCPortAttributeDefaultValueKey: @0.0 + QCPortAttributeNameKey: @"Y Range Min", + QCPortAttributeDefaultValueKey: @0.0 }; } if ( [key isEqualToString:@"inputYMax"] ) { return @{ - QCPortAttributeNameKey: @"Y Range Max", - QCPortAttributeDefaultValueKey: @5.0 + QCPortAttributeNameKey: @"Y Range Max", + QCPortAttributeDefaultValueKey: @5.0 }; } @@ -114,7 +114,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotDataLineColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Plot Line Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(lineColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(lineColor) } ]; CGColorRef fillColor = [self newDefaultColorForPlot:index alpha:0.25]; @@ -122,7 +122,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotFillColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Plot Fill Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(fillColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(fillColor) } ]; [self addInputPortWithType:QCPortTypeNumber @@ -177,7 +177,10 @@ -(BOOL)configurePlots plot.barWidth = @(barWidth); plot.barOffset = @(self.inputBarOffset); plot.barsAreHorizontal = self.inputHorizontalBars; - plot.fill = [CPTFill fillWithColor:[CPTColor colorWithCGColor:[self areaFillColor:index]]]; + CGColorRef fillColor = [self areaFillColor:index]; + if ( fillColor ) { + plot.fill = [CPTFill fillWithColor:[CPTColor colorWithCGColor:fillColor]]; + } [plot reloadData]; } @@ -196,19 +199,19 @@ -(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot return [[self valueForInputKey:key] count]; } --(nullable NSArray *)numbersForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange +-(nullable NSArray *)numbersForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange __unused)indexRange { NSUInteger plotIndex = [[self.graph allPlots] indexOfObject:plot]; NSString *key = [NSString stringWithFormat:@"plotNumbers%lu", (unsigned long)plotIndex]; - CPTDictionary dict = [self valueForInputKey:key]; + CPTDictionary *dict = [self valueForInputKey:key]; if ( !dict ) { return nil; } - NSUInteger keyCount = dict.allKeys.count; - CPTMutableNumberArray array = [NSMutableArray array]; + NSUInteger keyCount = dict.allKeys.count; + CPTMutableNumberArray *array = [NSMutableArray array]; if ( fieldEnum == CPTBarPlotFieldBarLocation ) { // Calculate horizontal position of bar - nth bar index + barWidth*plotIndex + 0.5 diff --git a/QCPlugin/CPTPieChartPlugin.h b/QCPlugin/CPTPieChartPlugin.h index 4700d9951..844715ba9 100644 --- a/QCPlugin/CPTPieChartPlugin.h +++ b/QCPlugin/CPTPieChartPlugin.h @@ -1,4 +1,4 @@ -#import "CorePlotQCPlugIn.h" +#import "CorePlotQCPlugin.h" #import @interface CPTPieChartPlugIn : CorePlotQCPlugIn diff --git a/QCPlugin/CPTPieChartPlugin.m b/QCPlugin/CPTPieChartPlugin.m index 5bc619278..99aeb2ede 100644 --- a/QCPlugin/CPTPieChartPlugin.m +++ b/QCPlugin/CPTPieChartPlugin.m @@ -28,8 +28,8 @@ @implementation CPTPieChartPlugIn +(nonnull NSDictionary *)attributes { return @{ - QCPlugInAttributeNameKey: @"Core Plot Pie Chart", - QCPlugInAttributeDescriptionKey: @"Pie chart" + QCPlugInAttributeNameKey: @"Core Plot Pie Chart", + QCPlugInAttributeDescriptionKey: @"Pie chart" }; } @@ -60,63 +60,63 @@ -(nullable QCPlugInViewController *)createViewController return nil; } -+(nonnull CPTStringArray)sortedPropertyPortKeys ++(nonnull CPTStringArray *)sortedPropertyPortKeys { - CPTStringArray pieChartPropertyPortKeys = @[@"inputPieRadius", @"inputSliceLabelOffset", @"inputStartAngle", @"inputSliceDirection", @"inputBorderColor", @"inputBorderWidth"]; + CPTStringArray *pieChartPropertyPortKeys = @[@"inputPieRadius", @"inputSliceLabelOffset", @"inputStartAngle", @"inputSliceDirection", @"inputBorderColor", @"inputBorderWidth"]; return [[super sortedPropertyPortKeys] arrayByAddingObjectsFromArray:pieChartPropertyPortKeys]; } -+(nonnull CPTDictionary)attributesForPropertyPortWithKey:(nonnull NSString *)key ++(nullable CPTDictionary *)attributesForPropertyPortWithKey:(nullable NSString *)key { // A few additional ports for the pie chart type ... if ( [key isEqualToString:@"inputPieRadius"] ) { return @{ - QCPortAttributeNameKey: @"Pie Radius", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @0.75 + QCPortAttributeNameKey: @"Pie Radius", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @0.75 }; } else if ( [key isEqualToString:@"inputSliceLabelOffset"] ) { return @{ - QCPortAttributeNameKey: @"Label Offset", - QCPortAttributeDefaultValueKey: @20.0 + QCPortAttributeNameKey: @"Label Offset", + QCPortAttributeDefaultValueKey: @20.0 }; } else if ( [key isEqualToString:@"inputStartAngle"] ) { return @{ - QCPortAttributeNameKey: @"Start Angle", - QCPortAttributeDefaultValueKey: @0.0 + QCPortAttributeNameKey: @"Start Angle", + QCPortAttributeDefaultValueKey: @0.0 }; } else if ( [key isEqualToString:@"inputSliceDirection"] ) { return @{ - QCPortAttributeNameKey: @"Slice Direction", - QCPortAttributeMaximumValueKey: @1, - QCPortAttributeMenuItemsKey: @[@"Clockwise", @"Counter-Clockwise"], - QCPortAttributeDefaultValueKey: @0 + QCPortAttributeNameKey: @"Slice Direction", + QCPortAttributeMaximumValueKey: @1, + QCPortAttributeMenuItemsKey: @[@"Clockwise", @"Counter-Clockwise"], + QCPortAttributeDefaultValueKey: @0 }; } else if ( [key isEqualToString:@"inputBorderWidth"] ) { return @{ - QCPortAttributeNameKey: @"Border Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"Border Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @1.0 }; } else if ( [key isEqualToString:@"inputBorderColor"] ) { - CGColorRef grayColor = CGColorCreateGenericGray(0.0, 1.0); - CPTDictionary result = @{ - QCPortAttributeNameKey: @"Border Color", - QCPortAttributeDefaultValueKey: CFBridgingRelease(grayColor) + CGColorRef grayColor = CGColorCreateGenericGray(0.0, 1.0); + CPTDictionary *result = @{ + QCPortAttributeNameKey: @"Border Color", + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(grayColor) }; return result; } else if ( [key isEqualToString:@"inputLabelColor"] ) { - CGColorRef grayColor = CGColorCreateGenericGray(1.0, 1.0); - CPTDictionary result = @{ - QCPortAttributeNameKey: @"Label Color", - QCPortAttributeDefaultValueKey: CFBridgingRelease(grayColor) + CGColorRef grayColor = CGColorCreateGenericGray(1.0, 1.0); + CPTDictionary *result = @{ + QCPortAttributeNameKey: @"Label Color", + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(grayColor) }; return result; } @@ -147,7 +147,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotFillColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Primary Fill Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(grayColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(grayColor) } ]; // Add the new plot to the graph @@ -224,12 +224,12 @@ -(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot return [[self valueForInputKey:key] count]; } --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger __unused)fieldEnum recordIndex:(NSUInteger)index { NSUInteger plotIndex = [[self.graph allPlots] indexOfObject:plot]; NSString *key = [NSString stringWithFormat:@"plotNumbers%lu", (unsigned long)plotIndex]; - CPTDictionary dict = [self valueForInputKey:key]; + CPTDictionary *dict = [self valueForInputKey:key]; if ( dict ) { return [NSDecimalNumber decimalNumberWithString:[dict[[NSString stringWithFormat:@"%lu", (unsigned long)index]] stringValue]]; @@ -239,7 +239,7 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum } } --(nullable CPTFill *)sliceFillForPieChart:(nonnull CPTPieChart *)pieChart recordIndex:(NSUInteger)index +-(nullable CPTFill *)sliceFillForPieChart:(nonnull CPTPieChart *__unused)pieChart recordIndex:(NSUInteger)index { CGColorRef plotFillColor = [CPTPieChart defaultPieSliceColorForIndex:index].cgColor; CGColorRef inputFillColor = (CGColorRef)[self areaFillColor:0]; @@ -264,7 +264,7 @@ -(nullable CPTTextLayer *)sliceLabelForPieChart:(nonnull CPTPieChart *)pieChart NSUInteger plotIndex = [[self.graph allPlots] indexOfObject:pieChart]; NSString *key = [NSString stringWithFormat:@"plotLabels%lu", (unsigned long)plotIndex]; - CPTDictionary dict = [self valueForInputKey:key]; + CPTDictionary *dict = [self valueForInputKey:key]; if ( !dict ) { return nil; diff --git a/QCPlugin/CPTScatterPlotPlugin.h b/QCPlugin/CPTScatterPlotPlugin.h index 0ea178c1d..aaad42138 100644 --- a/QCPlugin/CPTScatterPlotPlugin.h +++ b/QCPlugin/CPTScatterPlotPlugin.h @@ -1,4 +1,4 @@ -#import "CorePlotQCPlugIn.h" +#import "CorePlotQCPlugin.h" #import @interface CPTScatterPlotPlugIn : CorePlotQCPlugIn diff --git a/QCPlugin/CPTScatterPlotPlugin.m b/QCPlugin/CPTScatterPlotPlugin.m index 41ed47bef..023a890db 100644 --- a/QCPlugin/CPTScatterPlotPlugin.m +++ b/QCPlugin/CPTScatterPlotPlugin.m @@ -1,4 +1,4 @@ -#import "CPTScatterPlotPlugIn.h" +#import "CPTScatterPlotPlugin.h" @implementation CPTScatterPlotPlugIn @@ -25,8 +25,8 @@ @implementation CPTScatterPlotPlugIn +(nonnull NSDictionary *)attributes { return @{ - QCPlugInAttributeNameKey: @"Core Plot Scatter Plot", - QCPlugInAttributeDescriptionKey: @"Scatter plot" + QCPlugInAttributeNameKey: @"Core Plot Scatter Plot", + QCPlugInAttributeDescriptionKey: @"Scatter plot" }; } @@ -51,7 +51,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotDataLineColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Plot Line Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(lineColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(lineColor) } ]; CGColorRef fillColor = [self newDefaultColorForPlot:index alpha:0.25]; @@ -59,7 +59,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotFillColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Plot Fill Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(fillColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(fillColor) } ]; [self addInputPortWithType:QCPortTypeNumber @@ -85,7 +85,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotDataSymbolColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Data Symbol Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(symbolColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(symbolColor) } ]; // Add the new plot to the graph @@ -193,8 +193,11 @@ -(BOOL)configurePlots plot.plotSymbol.lineStyle = lineStyle; plot.plotSymbol.fill = [CPTFill fillWithColor:[CPTColor colorWithCGColor:[self dataSymbolColor:index]]]; plot.plotSymbol.size = CGSizeMake(10.0, 10.0); - plot.areaFill = [CPTFill fillWithColor:[CPTColor colorWithCGColor:[self areaFillColor:index]]]; - plot.areaBaseValue = @( MAX( self.inputYMin, MIN(self.inputYMax, 0.0) ) ); + CGColorRef fillColor = [self areaFillColor:index]; + if ( fillColor ) { + plot.areaFill = [CPTFill fillWithColor:[CPTColor colorWithCGColor:fillColor]]; + } + plot.areaBaseValue = @(MAX(self.inputYMin, MIN(self.inputYMax, 0.0))); [plot reloadData]; } @@ -210,8 +213,8 @@ -(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot NSString *xKey = [NSString stringWithFormat:@"plotXNumbers%lu", (unsigned long)plotIndex]; NSString *yKey = [NSString stringWithFormat:@"plotYNumbers%lu", (unsigned long)plotIndex]; - CPTDictionary xVals = [self valueForInputKey:xKey]; - CPTDictionary yVals = [self valueForInputKey:yKey]; + CPTDictionary *xVals = [self valueForInputKey:xKey]; + CPTDictionary *yVals = [self valueForInputKey:yKey]; if ( !xVals || !yVals ) { return 0; @@ -229,8 +232,8 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum NSString *xKey = [NSString stringWithFormat:@"plotXNumbers%lu", (unsigned long)plotIndex]; NSString *yKey = [NSString stringWithFormat:@"plotYNumbers%lu", (unsigned long)plotIndex]; - CPTDictionary xVals = [self valueForInputKey:xKey]; - CPTDictionary yVals = [self valueForInputKey:yKey]; + CPTDictionary *xVals = [self valueForInputKey:xKey]; + CPTDictionary *yVals = [self valueForInputKey:yKey]; if ( !xVals || !yVals ) { return nil; @@ -239,7 +242,7 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum return nil; } - CPTDictionary dict = (fieldEnum == CPTScatterPlotFieldX) ? xVals : yVals; + CPTDictionary *dict = (fieldEnum == CPTScatterPlotFieldX) ? xVals : yVals; NSString *dictionaryKey = [NSString stringWithFormat:@"%lu", (unsigned long)index]; diff --git a/QCPlugin/CorePlotQCPlugin.h b/QCPlugin/CorePlotQCPlugin.h index 1a24245b4..99354c2d5 100644 --- a/QCPlugin/CorePlotQCPlugin.h +++ b/QCPlugin/CorePlotQCPlugin.h @@ -5,7 +5,7 @@ @property (readwrite, strong, nullable) CPTGraph *graph; -@property (readwrite, assign, nonnull) id outputImage; +@property (readwrite, strong, nonnull) id outputImage; @property (readwrite, assign) NSUInteger numberOfPlots; @@ -48,7 +48,7 @@ -(nonnull CGColorRef)dataLineColor:(NSUInteger)index; -(CGFloat)dataLineWidth:(NSUInteger)index; --(nonnull CGColorRef)areaFillColor:(NSUInteger)index; --(nonnull CGImageRef)newAreaFillImage:(NSUInteger)index; +-(nullable CGColorRef)areaFillColor:(NSUInteger)index; +-(nullable CGImageRef)newAreaFillImage:(NSUInteger)index; @end diff --git a/QCPlugin/CorePlotQCPlugin.m b/QCPlugin/CorePlotQCPlugin.m index bfc81275b..3aa3ef332 100644 --- a/QCPlugin/CorePlotQCPlugin.m +++ b/QCPlugin/CorePlotQCPlugin.m @@ -1,4 +1,4 @@ -#import "CorePlotQCPlugIn.h" +#import "CorePlotQCPlugin.h" #import #define kQCPlugIn_Name @"CorePlotQCPlugIn" @@ -10,7 +10,7 @@ @interface CorePlotQCPlugIn() @property (nonatomic, readwrite, strong, nullable) NSMutableData *imageData; @property (nonatomic, readwrite, assign, nullable) CGContextRef bitmapContext; -@property (nonatomic, readwrite, strong, nonnull) id imageProvider; +@property (nonatomic, readwrite, strong, nullable) id imageProvider; void drawErrorText(CGContextRef __nonnull context, CGRect rect); @@ -90,8 +90,8 @@ @implementation CorePlotQCPlugIn */ return @{ - QCPlugInAttributeNameKey: kQCPlugIn_Name, - QCPlugInAttributeDescriptionKey: kQCPlugIn_Description + QCPlugInAttributeNameKey: kQCPlugIn_Name, + QCPlugInAttributeDescriptionKey: kQCPlugIn_Description }; } @@ -115,7 +115,7 @@ +(QCPlugInTimeMode)timeMode -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { /* * Allocate any permanent resource required by the plug-in. */ @@ -162,7 +162,7 @@ -(nullable QCPlugInViewController *)createViewController #pragma mark - #pragma mark Input and output port configuration -+(nonnull CPTStringArray)sortedPropertyPortKeys ++(nonnull CPTStringArray *)sortedPropertyPortKeys { return @[@"inputPixelsWide", @"inputPixelsHigh", @@ -186,7 +186,7 @@ +(nonnull CPTStringArray)sortedPropertyPortKeys @"inputAxisMinorTickWidth"]; } -+(nonnull CPTDictionary)attributesForPropertyPortWithKey:(nonnull NSString *)key ++(nullable CPTDictionary *)attributesForPropertyPortWithKey:(nullable NSString *)key { /* * Specify the optional attributes for property based ports (QCPortAttributeNameKey, QCPortAttributeDefaultValueKey...). @@ -194,157 +194,157 @@ +(nonnull CPTDictionary)attributesForPropertyPortWithKey:(nonnull NSString *)key if ( [key isEqualToString:@"inputXMin"] ) { return @{ - QCPortAttributeNameKey: @"X Range Min", - QCPortAttributeDefaultValueKey: @(-1.0) + QCPortAttributeNameKey: @"X Range Min", + QCPortAttributeDefaultValueKey: @(-1.0) }; } if ( [key isEqualToString:@"inputXMax"] ) { return @{ - QCPortAttributeNameKey: @"X Range Max", - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"X Range Max", + QCPortAttributeDefaultValueKey: @1.0 }; } if ( [key isEqualToString:@"inputYMin"] ) { return @{ - QCPortAttributeNameKey: @"Y Range Min", - QCPortAttributeDefaultValueKey: @(-1.0) + QCPortAttributeNameKey: @"Y Range Min", + QCPortAttributeDefaultValueKey: @(-1.0) }; } if ( [key isEqualToString:@"inputYMax"] ) { return @{ - QCPortAttributeNameKey: @"Y Range Max", - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"Y Range Max", + QCPortAttributeDefaultValueKey: @1.0 }; } if ( [key isEqualToString:@"inputXMajorIntervals"] ) { return @{ - QCPortAttributeNameKey: @"X Major Intervals", - QCPortAttributeDefaultValueKey: @4.0, - QCPortAttributeMinimumValueKey: @0.0 + QCPortAttributeNameKey: @"X Major Intervals", + QCPortAttributeDefaultValueKey: @4.0, + QCPortAttributeMinimumValueKey: @0.0 }; } if ( [key isEqualToString:@"inputYMajorIntervals"] ) { return @{ - QCPortAttributeNameKey: @"Y Major Intervals", - QCPortAttributeDefaultValueKey: @4.0, - QCPortAttributeMinimumValueKey: @0.0 + QCPortAttributeNameKey: @"Y Major Intervals", + QCPortAttributeDefaultValueKey: @4.0, + QCPortAttributeMinimumValueKey: @0.0 }; } if ( [key isEqualToString:@"inputXMinorIntervals"] ) { return @{ - QCPortAttributeNameKey: @"X Minor Intervals", - QCPortAttributeDefaultValueKey: @1, - QCPortAttributeMinimumValueKey: @0 + QCPortAttributeNameKey: @"X Minor Intervals", + QCPortAttributeDefaultValueKey: @1, + QCPortAttributeMinimumValueKey: @0 }; } if ( [key isEqualToString:@"inputYMinorIntervals"] ) { return @{ - QCPortAttributeNameKey: @"Y Minor Intervals", - QCPortAttributeDefaultValueKey: @1, - QCPortAttributeMinimumValueKey: @0 + QCPortAttributeNameKey: @"Y Minor Intervals", + QCPortAttributeDefaultValueKey: @1, + QCPortAttributeMinimumValueKey: @0 }; } if ( [key isEqualToString:@"inputAxisColor"] ) { - CGColorRef axisColor = CGColorCreateGenericRGB(1.0, 1.0, 1.0, 1.0); - CPTDictionary result = @{ - QCPortAttributeNameKey: @"Axis Color", - QCPortAttributeDefaultValueKey: CFBridgingRelease(axisColor) + CGColorRef axisColor = CGColorCreateGenericRGB(1.0, 1.0, 1.0, 1.0); + CPTDictionary *result = @{ + QCPortAttributeNameKey: @"Axis Color", + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(axisColor) }; return result; } if ( [key isEqualToString:@"inputAxisLineWidth"] ) { return @{ - QCPortAttributeNameKey: @"Axis Line Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"Axis Line Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @1.0 }; } if ( [key isEqualToString:@"inputAxisMajorTickWidth"] ) { return @{ - QCPortAttributeNameKey: @"Major Tick Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @2.0 + QCPortAttributeNameKey: @"Major Tick Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @2.0 }; } if ( [key isEqualToString:@"inputAxisMinorTickWidth"] ) { return @{ - QCPortAttributeNameKey: @"Minor Tick Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"Minor Tick Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @1.0 }; } if ( [key isEqualToString:@"inputAxisMajorTickLength"] ) { return @{ - QCPortAttributeNameKey: @"Major Tick Length", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @10.0 + QCPortAttributeNameKey: @"Major Tick Length", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @10.0 }; } if ( [key isEqualToString:@"inputAxisMinorTickLength"] ) { return @{ - QCPortAttributeNameKey: @"Minor Tick Length", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @3.0 + QCPortAttributeNameKey: @"Minor Tick Length", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @3.0 }; } if ( [key isEqualToString:@"inputMajorGridLineWidth"] ) { return @{ - QCPortAttributeNameKey: @"Major Grid Line Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"Major Grid Line Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @1.0 }; } if ( [key isEqualToString:@"inputMinorGridLineWidth"] ) { return @{ - QCPortAttributeNameKey: @"Minor Grid Line Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @0.0 + QCPortAttributeNameKey: @"Minor Grid Line Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @0.0 }; } if ( [key isEqualToString:@"inputPlotAreaColor"] ) { CGColorRef plotAreaColor = CGColorCreateGenericRGB(0.0, 0.0, 0.0, 0.4); - CPTDictionary result = @{ - QCPortAttributeNameKey: @"Plot Area Color", - QCPortAttributeDefaultValueKey: CFBridgingRelease(plotAreaColor) + CPTDictionary *result = @{ + QCPortAttributeNameKey: @"Plot Area Color", + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(plotAreaColor) }; return result; } if ( [key isEqualToString:@"inputPixelsWide"] ) { return @{ - QCPortAttributeNameKey: @"Pixels Wide", - QCPortAttributeMinimumValueKey: @1, - QCPortAttributeDefaultValueKey: @512 + QCPortAttributeNameKey: @"Pixels Wide", + QCPortAttributeMinimumValueKey: @1, + QCPortAttributeDefaultValueKey: @512 }; } if ( [key isEqualToString:@"inputPixelsHigh"] ) { return @{ - QCPortAttributeNameKey: @"Pixels High", - QCPortAttributeMinimumValueKey: @1, - QCPortAttributeDefaultValueKey: @512 + QCPortAttributeNameKey: @"Pixels High", + QCPortAttributeMinimumValueKey: @1, + QCPortAttributeDefaultValueKey: @512 }; } if ( [key isEqualToString:@"outputImage"] ) { return @{ - QCPortAttributeNameKey: @"Image" + QCPortAttributeNameKey: @"Image" }; } @@ -451,11 +451,11 @@ -(BOOL)configureAxis set.xAxis.labelTextStyle = textStyle; double xrange = self.inputXMax - self.inputXMin; - set.xAxis.majorIntervalLength = @( xrange / (self.inputXMajorIntervals) ); + set.xAxis.majorIntervalLength = @(xrange / (self.inputXMajorIntervals)); set.xAxis.minorTicksPerInterval = self.inputXMinorIntervals; double yrange = self.inputYMax - self.inputYMin; - set.yAxis.majorIntervalLength = @( yrange / (self.inputYMajorIntervals) ); + set.yAxis.majorIntervalLength = @(yrange / (self.inputYMajorIntervals)); set.yAxis.minorTicksPerInterval = self.inputYMinorIntervals; set.xAxis.minorTickLength = self.inputAxisMinorTickLength; @@ -513,18 +513,19 @@ -(CGFloat)dataLineWidth:(NSUInteger)index return inputValue.doubleValue; } --(nonnull CGColorRef)areaFillColor:(NSUInteger)index +-(nullable CGColorRef)areaFillColor:(NSUInteger)index { NSString *key = [NSString stringWithFormat:@"plotFillColor%lu", (unsigned long)index]; return (__bridge CGColorRef)([self valueForInputKey:key]); } --(nonnull CGImageRef)newAreaFillImage:(NSUInteger)index +-(nullable CGImageRef)newAreaFillImage:(NSUInteger)index { NSString *key = [NSString stringWithFormat:@"plotFillImage%lu", (unsigned long)index]; id img = [self valueForInputKey:key]; + if ( !img ) { return nil; } @@ -546,6 +547,9 @@ -(nonnull CGImageRef)newAreaFillImage:(NSUInteger)index NSUInteger bytesPerRow = [img bufferBytesPerRow]; CGColorSpaceRef colorSpace = [img bufferColorSpace]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" + CGContextRef imgContext = CGBitmapContextCreate(baseAddress, pixelsWide, pixelsHigh, @@ -554,6 +558,8 @@ -(nonnull CGImageRef)newAreaFillImage:(NSUInteger)index colorSpace, (CGBitmapInfo)kCGImageAlphaNoneSkipLast); +#pragma clang diagnostic pop + CGImageRef imageRef = CGBitmapContextCreateImage(imgContext); [img unlockBufferRepresentation]; @@ -563,7 +569,7 @@ -(nonnull CGImageRef)newAreaFillImage:(NSUInteger)index return imageRef; } -static void _BufferReleaseCallback(const void *__nonnull address, void *__nonnull context) +static void _BufferReleaseCallback(const void *__nonnull __unused address, void *__nonnull __unused context) { // Don't do anything. We release the buffer manually when it's recreated or during dealloc } @@ -576,7 +582,7 @@ -(void)createImageResourcesWithContext:(nonnull id)context size_t rowBytes = (size_t)boundsSize.width * 4; if ( rowBytes % 16 ) { - rowBytes = ( (rowBytes / 16) + 1 ) * 16; + rowBytes = ((rowBytes / 16) + 1) * 16; } if ( !self.imageData ) { @@ -609,7 +615,7 @@ -(void)createImageResourcesWithContext:(nonnull id)context CGContextRelease(newContext); if ( rowBytes % 16 ) { - rowBytes = ( (rowBytes / 16) + 1 ) * 16; + rowBytes = ((rowBytes / 16) + 1) * 16; } // Note: I don't have a PPC to test on so this may or may not cause some color issues @@ -639,12 +645,12 @@ -(void)createImageResourcesWithContext:(nonnull id)context #pragma mark - #pragma mark Data source methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return 0; } --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger __unused)fieldEnum recordIndex:(NSUInteger __unused)index { return @0; } @@ -671,7 +677,7 @@ -(void)setNumberOfPlots:(NSUInteger)number numberOfPlots = number; } -+(nonnull CPTStringArray)plugInKeys ++(nonnull CPTStringArray *)plugInKeys { return @[@"numberOfPlots"]; } @@ -720,14 +726,14 @@ -(void)setBitmapContext:(nullable CGContextRef)newContext #pragma mark - #pragma mark Subclass methods --(void)addPlotWithIndex:(NSUInteger)index +-(void)addPlotWithIndex:(NSUInteger __unused)index { /* * Subclasses should override this method to create their own ports, plots, and add the plots to the graph */ } --(void)removePlots:(NSUInteger)count +-(void)removePlots:(NSUInteger __unused)count { /* * Subclasses should override this method to remove plots and their ports @@ -750,7 +756,7 @@ -(BOOL)configureGraph */ // Configure the graph area - CGRect frame = CPTRectMake( 0.0, 0.0, MAX(1, self.inputPixelsWide), MAX(1, self.inputPixelsHigh) ); + CGRect frame = CPTRectMake(0.0, 0.0, MAX(1, self.inputPixelsWide), MAX(1, self.inputPixelsHigh)); self.graph.bounds = frame; @@ -760,7 +766,7 @@ -(BOOL)configureGraph self.graph.paddingBottom = 0.0; // Perform some sanity checks. If there is a configuration error set the error flag so that a message is displayed - if ( (self.inputXMax <= self.inputXMin) || (self.inputYMax <= self.inputYMin) ) { + if ((self.inputXMax <= self.inputXMin) || (self.inputYMax <= self.inputYMin)) { return NO; } @@ -795,7 +801,7 @@ -(BOOL)configureGraph @implementation CorePlotQCPlugIn(Execution) --(BOOL)execute:(nonnull id)context atTime:(NSTimeInterval)time withArguments:(nullable CPTDictionary)arguments +-(BOOL)execute:(nonnull id)context atTime:(NSTimeInterval __unused)time withArguments:(nullable CPTDictionary *__unused)arguments { // Configure the plot for drawing BOOL configurationCheck = [self configureGraph]; @@ -811,9 +817,9 @@ -(BOOL)execute:(nonnull id)context atTime:(NSTimeInterval)time // Draw the plot ... CGSize boundsSize = self.graph.bounds.size; CGContextRef bmContext = self.bitmapContext; - CGContextClearRect( bmContext, CPTRectMake(0.0, 0.0, boundsSize.width, boundsSize.height) ); + CGContextClearRect(bmContext, CPTRectMake(0.0, 0.0, boundsSize.width, boundsSize.height)); CGContextSetRGBFillColor(bmContext, 0.0, 0.0, 0.0, 0.0); - CGContextFillRect( bmContext, CPTRectMake(0, 0, boundsSize.width, boundsSize.height) ); + CGContextFillRect(bmContext, CPTRectMake(0, 0, boundsSize.width, boundsSize.height)); CGContextSetAllowsAntialiasing(bmContext, true); if ( configurationCheck ) { @@ -821,16 +827,21 @@ -(BOOL)execute:(nonnull id)context atTime:(NSTimeInterval)time [self.graph recursivelyRenderInContext:bmContext]; } else { - drawErrorText( bmContext, CPTRectMake(0, 0, self.inputPixelsWide, self.inputPixelsHigh) ); + drawErrorText(bmContext, CPTRectMake(0, 0, self.inputPixelsWide, self.inputPixelsHigh)); } // CGContextSetAllowsAntialiasing(bitmapContext, false); CGContextFlush(bmContext); // ... and put it on the output port - self.outputImage = self.imageProvider; - - return YES; + id provider = self.imageProvider; + if ( provider ) { + self.outputImage = provider; + return YES; + } + else { + return NO; + } } @end diff --git a/QCPlugin/CorePlotQCPlugin.xcodeproj/project.pbxproj b/QCPlugin/CorePlotQCPlugin.xcodeproj/project.pbxproj index 4f7d5cf2e..e07788d06 100644 --- a/QCPlugin/CorePlotQCPlugin.xcodeproj/project.pbxproj +++ b/QCPlugin/CorePlotQCPlugin.xcodeproj/project.pbxproj @@ -62,6 +62,20 @@ remoteGlobalIDString = 8DC2EF4F0486A6940098B216; remoteInfo = CorePlot; }; + C31D02421D10F531008C1EF2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A89BAB3B1027EFBD004B2FE1 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C31D02441D10F531008C1EF2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A89BAB3B1027EFBD004B2FE1 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; C3B925EA1ADF1CBE00C67086 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A89BAB3B1027EFBD004B2FE1 /* CorePlot.xcodeproj */; @@ -111,9 +125,7 @@ 16BA95400A7EB2EB001E4983 /* CorePlotQCPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CorePlotQCPlugin.h; sourceTree = ""; }; 16BA95410A7EB2EB001E4983 /* CorePlotQCPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CorePlotQCPlugin.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 16BA96300A7EB9AC001E4983 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = /System/Library/Frameworks/Quartz.framework; sourceTree = ""; }; - 7238D5510DB6988600E9A42D /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Settings.xib; sourceTree = ""; }; 8D5B49B6048680CD000E48DA /* CorePlotQCPlugin.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CorePlotQCPlugin.plugin; sourceTree = BUILT_PRODUCTS_DIR; }; - 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A819AA0311FD3F23006D1C2D /* CPTPieChartPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPieChartPlugin.h; sourceTree = ""; }; A819AA0411FD3F23006D1C2D /* CPTPieChartPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPieChartPlugin.m; sourceTree = ""; }; A89BAB3B1027EFBD004B2FE1 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../framework/CorePlot.xcodeproj; sourceTree = SOURCE_ROOT; }; @@ -121,7 +133,9 @@ A8FC1815102CBADE00CF2266 /* CPTScatterPlotPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTScatterPlotPlugin.m; sourceTree = ""; }; A8FC1817102CBAEA00CF2266 /* CPTBarPlotPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTBarPlotPlugin.h; sourceTree = ""; }; A8FC1818102CBAEA00CF2266 /* CPTBarPlotPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTBarPlotPlugin.m; sourceTree = ""; }; + C37A410E20E0326C00C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; C3C8CFF619E9504C007E0BCB /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3DA083820E00C7700F73704 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Settings.xib; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -167,7 +181,7 @@ isa = PBXGroup; children = ( 7238D5500DB6988600E9A42D /* Settings.xib */, - 8D5B49B7048680CD000E48DA /* Info.plist */, + C37A410F20E0326C00C4FF48 /* Info.plist */, ); name = Resources; sourceTree = ""; @@ -213,6 +227,8 @@ C3B925ED1ADF1CBE00C67086 /* UnitTests iOS.xctest */, C3B925EF1ADF1CBE00C67086 /* libCorePlot-CocoaTouch.a */, C3B925F11ADF1CBE00C67086 /* CorePlot-CocoaTouchTests.xctest */, + C31D02431D10F531008C1EF2 /* CorePlot.framework */, + C31D02451D10F531008C1EF2 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -246,17 +262,18 @@ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0930; }; buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "CorePlotQCPlugin" */; compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + en, + ja, + fr, + de, ); mainGroup = 089C166AFE841209C02AAC07 /* Quartz Composer Plug In */; projectDirPath = ""; @@ -289,6 +306,20 @@ remoteRef = BC21A97E1035BEAF00FED2A4 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C31D02431D10F531008C1EF2 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C31D02421D10F531008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C31D02451D10F531008C1EF2 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C31D02441D10F531008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; C3B925EB1ADF1CBE00C67086 /* CorePlot.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -377,11 +408,19 @@ 7238D5500DB6988600E9A42D /* Settings.xib */ = { isa = PBXVariantGroup; children = ( - 7238D5510DB6988600E9A42D /* English */, + C3DA083820E00C7700F73704 /* Base */, ); name = Settings.xib; sourceTree = ""; }; + C37A410F20E0326C00C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A410E20E0326C00C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -395,10 +434,9 @@ COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CorePlotQCPlugin_Prefix.pch; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Library/Graphics/Quartz Composer Plug-Ins"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; OTHER_LDFLAGS = ""; @@ -421,7 +459,7 @@ GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CorePlotQCPlugin_Prefix.pch; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Library/Graphics/Quartz Composer Plug-Ins"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; OTHER_LDFLAGS = ""; @@ -435,10 +473,15 @@ }; 1DEB913F08733D840010E9CD /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C8CFF619E9504C007E0BCB /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SYMROOT = "$(PROJECT_DIR)/../build"; @@ -447,9 +490,14 @@ }; 1DEB914008733D840010E9CD /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C8CFF619E9504C007E0BCB /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; + GCC_WARN_ABOUT_RETURN_TYPE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_LDFLAGS = ""; SYMROOT = "$(PROJECT_DIR)/../build"; @@ -459,6 +507,7 @@ 233E2D8A0A83C7AC005A62DF /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; PRODUCT_NAME = "Build & Install"; }; @@ -467,6 +516,7 @@ 233E2D8B0A83C7AC005A62DF /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; PRODUCT_NAME = "Build & Install"; }; diff --git a/QCPlugin/CorePlotQCPlugin.xcodeproj/xcshareddata/xcschemes/Build & Copy.xcscheme b/QCPlugin/CorePlotQCPlugin.xcodeproj/xcshareddata/xcschemes/Build & Copy.xcscheme index 4b733b333..7afa5ea4a 100644 --- a/QCPlugin/CorePlotQCPlugin.xcodeproj/xcshareddata/xcschemes/Build & Copy.xcscheme +++ b/QCPlugin/CorePlotQCPlugin.xcodeproj/xcshareddata/xcschemes/Build & Copy.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "YES"> - - - - + buildForAnalyzing = "YES"> - - - - + # Core Plot -*Cocoa plotting framework for Mac OS X and iOS.* +*Cocoa plotting framework for macOS, iOS, and tvOS.* -[![Build Status](https://secure.travis-ci.org/core-plot/core-plot.svg)](http://travis-ci.org/core-plot/core-plot) [![Version Status](https://img.shields.io/cocoapods/v/CorePlot.svg)](https://cocoapods.org/pods/CorePlot) [![license MIT](https://img.shields.io/cocoapods/l/CorePlot.svg)](http://opensource.org/licenses/BSD-3-Clause) [![Platform](https://img.shields.io/cocoapods/p/CorePlot.svg)](http://core-plot.github.io) +[![Cocoapods platforms](https://img.shields.io/cocoapods/p/CorePlot?color=bright-green)](https://core-plot.github.io) [![core-plot CI](https://github.com/core-plot/core-plot/actions/workflows/ci.yml/badge.svg)](https://github.com/core-plot/core-plot/actions/workflows/ci.yml) +[![Cocoapods](https://img.shields.io/cocoapods/v/CorePlot?color=bright-green)](https://cocoapods.org/pods/CorePlot) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen?style=flat)](https://github.com/Carthage/Carthage) [![Swift Package Manager compatible](https://img.shields.io/badge/SPM-compatible-brightgreen)](https://github.com/apple/swift-package-manager) +[![GitHub license](https://img.shields.io/github/license/core-plot/core-plot?color=bright-green)](https://opensource.org/licenses/BSD-3-Clause) # Introduction -Core Plot is a 2D plotting framework for Mac OS X and iOS. It is highly customizable and capable of drawing many types of plots. See the [Example Graphs](https://github.com/core-plot/core-plot/wiki/Example-Graphs) wiki page and the [example applications](https://github.com/core-plot/core-plot/tree/master/examples) for examples of some of its capabilities. +Core Plot is a 2D plotting framework for macOS, iOS, and tvOS. It is highly customizable and capable of drawing many types of plots. See the [Example Graphs](https://github.com/core-plot/core-plot/wiki/Example-Graphs) wiki page and the [example applications](https://github.com/core-plot/core-plot/tree/master/examples) for examples of some of its capabilities. # Getting Started @@ -17,9 +21,9 @@ See the [High Level Design Overview](https://github.com/core-plot/core-plot/wiki Documentation of the Core Plot API and high-level architecture can be found in the following places: * [Change log](https://github.com/core-plot/core-plot/blob/master/documentation/changelog.markdown) - * [API documentation](http://core-plot.github.io/MacOS/index.html) for Mac - * [API documentation](http://core-plot.github.io/iOS/index.html) for iOS - * API documentation built with [Doxygen](http://www.doxygen.org/) and installed locally in Xcode (see the [instructions](https://github.com/core-plot/core-plot/blob/master/READMEs/README%20for%20Docs%20Install.md) in the **READMEs** folder for details) + * [API documentation](https://core-plot.github.io/MacOS/index.html) for Mac + * [API documentation](https://core-plot.github.io/iOS/index.html) for iOS and tvOS + * API documentation built with [Doxygen](https://www.doxygen.nl/) and installed locally in Xcode (see the [instructions](https://github.com/core-plot/core-plot/blob/master/READMEs/README%20for%20Docs%20Install.md) in the **READMEs** folder for details) * [Project Wiki](https://github.com/core-plot/core-plot/wiki) on GitHub * [Documentation](https://github.com/core-plot/core-plot/tree/master/documentation) folder in the code repository @@ -27,13 +31,12 @@ Documentation of the Core Plot API and high-level architecture can be found in t ## Q&A Sites - * [Core Plot](http://groups.google.com/group/coreplot-discuss) Google Group - * Stackoverflow.com [core-plot tag](http://stackoverflow.com/questions/tagged/core-plot) + * [Core Plot](https://groups.google.com/group/coreplot-discuss) Google Group + * Stackoverflow.com [core-plot tag](https://stackoverflow.com/questions/tagged/core-plot) ## Social Networks * [Twitter](https://twitter.com/CorePlot) - * [App.net](https://alpha.app.net/coreplot); Subscribe to the [Announcements](https://app.net/c/2rw2) broadcast. # Contributing to Core Plot @@ -41,16 +44,12 @@ Core Plot is an open source project hosted on [GitHub](https://github.com/core-p * [core-plot](https://github.com/core-plot/core-plot): This is main code repository with the framework and all examples. This is where you will find the release packages, wiki pages, and issue tracker. - * [core-plot.github.io](https://github.com/core-plot/core-plot.github.io): This is the HTML API documentation. You can view the pages online at [http://core-plot.github.io](http://core-plot.github.io). + * [core-plot.github.io](https://github.com/core-plot/core-plot.github.io): This is the HTML API documentation. You can view the pages online at [https://core-plot.github.io](https://core-plot.github.io). ## Coding Standards -Everyone has a their own preferred coding style, and no one way can be considered right. Nonetheless, in a project like Core Plot, with many developers contributing, it is worthwhile defining a set of basic coding standards to prevent a mishmash of different styles which can become frustrating when navigating the code base. See the file [Coding Style.markdown](https://github.com/core-plot/core-plot/blob/master/documentation/Coding%20Style.markdown) found in the [documentation](https://github.com/core-plot/core-plot/tree/master/documentation) directory of the project source for specific guidelines. +Everyone has a their own preferred coding style, and no one way can be considered right. Nonetheless, in a project like Core Plot, with many developers contributing, it is worthwhile defining a set of basic coding standards to prevent a mishmash of different styles which can become frustrating when navigating the code base. See the file [CONTRIBUTING.md](https://github.com/core-plot/core-plot/blob/master/.github/CONTRIBUTING.md) found in the [.github](https://github.com/core-plot/core-plot/tree/master/.github) directory of the project source for specific guidelines. -Core Plot includes a [script](https://github.com/core-plot/core-plot/blob/master/scripts/format_core_plot.sh) to run [Uncrustify](http://uncrustify.sourceforge.net) on the source code to standardize the formatting. All source code will be formatted with this tool before being committed to the Core Plot repository. +Core Plot includes a [script](https://github.com/core-plot/core-plot/blob/master/scripts/format_core_plot.sh) to run [Uncrustify](https://github.com/uncrustify/uncrustify) on the source code to standardize the formatting. All source code will be formatted with this tool before being committed to the Core Plot repository. ## Testing -Because Core Plot is intended to be used in scientific, financial, and other domains where correctness is paramount, unit testing is integrated into the framework. Good test coverage protects developers from introducing accidental regressions and frees them to experiment and refactor without fear of breaking things. See the [unit testing](https://github.com/core-plot/core-plot/wiki/Unit-Testing) wiki page for instructions on how to build unit tests for any new code you add to the project. - -# Support Core Plot - -Flattr this +Core Plot is intended to be applied in scientific, financial, and other domains where correctness is paramount. In order to assure the quality of the framework, unit testing is integrated. Good test coverage protects developers from introducing accidental regressions, and helps them to experiment and refactor without breaking existing code. See the [unit testing](https://github.com/core-plot/core-plot/wiki/Unit-Testing) wiki page for instructions on how to build unit tests for any new code you add to the project. diff --git a/READMEs/README for Docs Install.md b/READMEs/README for Docs Install.md index 01cf04a82..57c19c0bd 100644 --- a/READMEs/README for Docs Install.md +++ b/READMEs/README for Docs Install.md @@ -8,10 +8,10 @@ # To Build the Documentation From Source -1. Install [Doxygen]([http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc) in **/Applications**. Core Plot requires Doxygen 1.8.6 or later. +1. Install [Doxygen]([http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc) in **/Applications**. Core Plot requires Doxygen 1.8.11 or later. -2. Install [Graphviz](http://www.graphviz.org/Download_macos.php). Core Plot requires Graphviz 2.34.0 or later. +2. Install [Graphviz](http://www.graphviz.org/Download_macos.php). Core Plot requires Graphviz 2.36.0 or later. -3. Open the **CorePlot** or **CorePlot-CocoaTouch** project in Xcode. +3. Open the **CorePlot** project in Xcode. -4. Build the "Documentation" target. \ No newline at end of file +4. Build the "Documentation-Mac" and/or "Documentation-iOS" targets. \ No newline at end of file diff --git a/READMEs/README for Static Library Install.md b/READMEs/README for Static Library Install.md index 286d1e38a..ece0cccd7 100644 --- a/READMEs/README for Static Library Install.md +++ b/READMEs/README for Static Library Install.md @@ -5,8 +5,8 @@ 2. Copy **libCorePlotCocoaTouch.a** to your Xcode project 3. Add the following flags to "Other Linker Flags" in your target build settings: - `-ObjC -all_load` + `-ObjC` -4. Add the **QuartzCore** framework to the project. +4. Add the **QuartzCore** and **Accelerate** frameworks to the project. 5. Add a `CPTGraph` to your application. See the example apps in Source Code to see how, or read the documentation. \ No newline at end of file diff --git a/documentation/changelog.markdown b/documentation/changelog.markdown index 48b9f5b5f..ed231ffeb 100644 --- a/documentation/changelog.markdown +++ b/documentation/changelog.markdown @@ -1,3 +1,68 @@ +# Release 2.3 (January 10, 2020) + +## Release Notes + +This release updates Core Plot to be compatible with Xcode 11 and Swift 5. It adds support for platform-native fonts and colors, including dynamic system colors. + +The Mac deployment target remains OS X 10.8. The iOS deployment target remains iOS 8.0 for both the framework and the static library. The tvOS deployment target remains tvOS 9.0. + +## Details +- **New**: Added support for platform native fonts (`NSFont` and `UIFont`). +- **New**: Added support for platform native colors (`NSColor` and `UIColor`), including dynamic system colors. +- **New**: Added support for variable bar widths in bar, range, and trading range plots. +- **Changed**: Updated the Core Plot project to prefer the new Xcode build system introduced with Xcode 9. +- **Changed**: Updated all framework and example code to be compatible with Xcode 11 and the latest SDKs on all platforms. +- **Changed**: Updated all Swift example apps to Swift 5. +- **Changed**: Added arm64e as a valid build architecture on iOS. +- **Changed**: Miscellaneous bug fixes and cleanup. +- **Removed**: Removed DTrace probing to support Xcode's New Build System. +- **Removed**: Removed docset generation. Docsets are no longer supported under Xcode 9.3. +- **Removed**: Removed the AAPLot and StockPlot example apps because the Yahoo finance API that both relied for data is no longer available. + + + +# Release 2.2 (September 18, 2016) + +## Release Notes + +This release updates Core Plot to be compatible with Xcode 8 and Swift 3. + +The Mac deployment target remains OS X 10.8. The iOS deployment target has changed to iOS 8.0 for both the framework and the static library. The tvOS deployment target remains tvOS 9.0. Core Plot no longer requires the Accelerate framework. + +## Details +- **New**: Increased the iOS deployment target to iOS 8. +- **Changed**: Added Swift name mappings for all string constants. +- **Changed**: Updated all Swift example apps to Swift 3. +- **Changed**: Miscellaneous bug fixes and cleanup. +- **Removed**: Removed the dependency on the Accelerate framework. + + + +# Release 2.1 (April 16, 2016) + +## Release Notes + +This release adds a tvOS framework and removes the deprecated `CorePlot-CocoaTouch.xcodeproj` project file. All Core Plot build targets for Mac, iOS, tvOS, and the documentation are in the `CorePlot.xcodeproj` project file. Annotated type definitions (e.g., `CPTNumberArray`) were changed to exclude the pointer star ("*") so they can be used interchangeably with class names. + +Curved scatter plots received several improvements. This release adds options to use Catmull-Rom and Hermite cubic splines to draw curved scatter plot lines. When a Hermite spline is used to draw a monotonic data series, the curved line will be monotonic as well. Plot spaces have new methods to scale the plot space to fit entire plots. + +The Mac deployment target has increased to OS X 10.8. The iOS deployment target remains iOS 6.0 for the static library and iOS 8.0 for the framework. The tvOS deployment target is tvOS 9.0. + +## Details +- **New**: Increased the Mac deployment target to OS X 10.8. +- **New**: Added a tvOS framework. +- **New**: Added an option to anchor alternating band fills to a specific starting value. +- **New**: Added support for animating `NSNumber` properties with `CPTAnimation`. +- **New**: Added support for `NSSecureCoding`. +- **New**: Added an option to draw legend swatches to the left or right side of the title. +- **New**: Added options to use Catmull-Rom and Hermite cubic splines to draw curved scatter plot lines. +- **New**: Added a method to automatically scale the plot space to fit the entire plot. +- **Changed**: Changed the annotated type definitions to exclude the pointer star ("*"). +- **Changed**: Miscellaneous bug fixes and cleanup. +- **Removed**: Removed the deprecated `CorePlot-CocoaTouch.xcodeproj` project file. + + + # Release 2.0 (October 4, 2015) ## Release Notes diff --git a/documentation/doxygen/doxygen touch.config b/documentation/doxygen/doxygen touch.config index 6d9380cec..01d4c0b2d 100644 --- a/documentation/doxygen/doxygen touch.config +++ b/documentation/doxygen/doxygen touch.config @@ -1,4 +1,4 @@ -# Doxyfile 1.8.10 +# Doxyfile 1.8.14 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -20,8 +20,8 @@ # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "Core Plot (iOS)" +PROJECT_NAME = "Core Plot (iOS and tvOS)" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -44,7 +44,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "Cocoa plotting framework for Mac OS X and iOS" +PROJECT_BRIEF = "Cocoa plotting framework for macOS, iOS, and tvOS" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 @@ -226,7 +226,8 @@ TAB_SIZE = 4 # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. ALIASES = "YES=@ref YES" \ "NO=@ref NO" \ @@ -312,6 +313,15 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = NO +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or @@ -337,7 +347,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -708,7 +718,7 @@ LAYOUT_FILE = "$(SOURCE_ROOT)/../documentation/doxygen/DoxygenLayout. # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -758,6 +768,12 @@ WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = YES +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated @@ -791,7 +807,7 @@ INPUT = "$(SOURCE_ROOT)/CorePlot-CocoaTouch.h" \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of # possible encodings. # The default value is: UTF-8. @@ -808,8 +824,8 @@ INPUT_ENCODING = UTF-8 # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, -# *.vhdl, *.ucf, *.qsf, *.as and *.js. +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. FILE_PATTERNS = @@ -899,6 +915,10 @@ IMAGE_PATH = "$(SOURCE_ROOT)/../documentation/" # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -908,6 +928,10 @@ INPUT_FILTER = # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = @@ -992,7 +1016,7 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: @@ -1025,7 +1049,7 @@ VERBATIM_HEADERS = YES # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was -# compiled with the --with-libclang option. +# generated with the -Duse-libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO @@ -1038,6 +1062,17 @@ CLANG_ASSISTED_PARSING = NO CLANG_OPTIONS = +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files +# were built. This is equivalent to specifying the "-p" option to a clang tool, +# such as clang-check. These options will then be passed to the parser. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: 0. + +CLANG_COMPILATION_DATABASE_PATH = 0 + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1157,7 +1192,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1193,6 +1228,17 @@ HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = NO +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via Javascript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have Javascript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1216,12 +1262,12 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# environment (see: https://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1337,7 +1383,7 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1345,8 +1391,7 @@ QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1354,23 +1399,21 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = @@ -1463,7 +1506,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1475,7 +1518,7 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1502,8 +1545,8 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://www.mathjax.org/mathjax @@ -1564,7 +1607,7 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1577,7 +1620,7 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1764,12 +1807,20 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_BIB_STYLE = plain +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1939,9 +1990,9 @@ DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -2042,11 +2093,17 @@ INCLUDE_FILE_PATTERNS = # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. PREDEFINED = TARGET_OS_IPHONE, \ - TARGET_IPHONE_SIMULATOR, \ - "NS_DESIGNATED_INITIALIZER:=''", \ - "NS_RETURNS_INNER_POINTER:=''", \ - "NS_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type", \ - "NS_OPTIONS(_type,_name):=enum _name : _type _name; enum _name : _type" + TARGET_OS_TV, \ + TARGET_OS_SIMULATOR, \ + "NS_DESIGNATED_INITIALIZER:= " \ + "NS_RETURNS_INNER_POINTER:= " \ + "NS_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_CLOSED_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_OPTIONS(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_SWIFT_NAME(_name):= " \ + "cpt_deprecated:= " \ + "cpt_swift_enum:= " \ + "cpt_swift_struct:= " # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2368,6 +2425,11 @@ DIAFILE_DIRS = PLANTUML_JAR_PATH = +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. diff --git a/documentation/doxygen/doxygen-cocoa-tags.xml b/documentation/doxygen/doxygen-cocoa-tags.xml index e34cb8fe6..1578dd526 100644 --- a/documentation/doxygen/doxygen-cocoa-tags.xml +++ b/documentation/doxygen/doxygen-cocoa-tags.xml @@ -529,6 +529,15 @@ NSFastEnumeration-p NSMutableCopying-p + + NSSecureCoding + https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSSecureCoding_Protocol_Ref/ + + BOOL + supportsSecureCoding: + //apple_ref/occ/intfcm/NSSecureCoding/supportsSecureCoding + + NSString https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html @@ -749,6 +758,21 @@ + + CAAnimationDelegate + https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CAAnimationDelegate_protocol/Introduction/Introduction.html/ + NSObject-p + + void + animationDidStart: + //apple_ref/occ/intfcm/CAAnimationDelegate/animationDidStart + + + void + animationDidStop:finished: + //apple_ref/occ/intfcm/CAAnimationDelegate/animationDidStopfinished + + CALayer https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html @@ -851,6 +875,36 @@ //apple_ref/occ/instm/CALayer/setNeedsLayout + + CALayerDelegate + https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CALayerDelegate_protocol/Introduction/Introduction.html/ + NSObject-p + + id + actionForLayer:forKey: + //apple_ref/occ/intfcm/CALayerDelegate/actionForLayerforKey + + + void + displayLayer: + //apple_ref/occ/intfcm/CALayerDelegate/displayLayer + + + void + drawLayer:inContext: + //apple_ref/occ/intfcm/CALayerDelegate/drawLayerinContext + + + void + layerWillDraw: + //apple_ref/occ/intfcm/CALayerDelegate/layerWillDraw + + + void + layoutSublayersOfLayer: + //apple_ref/occ/intfcm/CALayerDelegate/layoutSublayersOfLayer + + CAMediaTiming https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CAMediaTiming_protocol/Introduction/Introduction.html diff --git a/documentation/doxygen/doxygen-cocoa-touch-tags.xml b/documentation/doxygen/doxygen-cocoa-touch-tags.xml index 46faf7b7d..1de3c13d3 100644 --- a/documentation/doxygen/doxygen-cocoa-touch-tags.xml +++ b/documentation/doxygen/doxygen-cocoa-touch-tags.xml @@ -463,6 +463,15 @@ https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIResponder_Class/Reference/Reference.html#//apple_ref/occ/cl/UIResponder NSObject + + NSSecureCoding + https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSSecureCoding_Protocol_Ref/ + + BOOL + supportsSecureCoding: + //apple_ref/occ/intfcm/NSSecureCoding/supportsSecureCoding + + NSString https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html @@ -678,6 +687,21 @@ + + CAAnimationDelegate + https://developer.apple.com/library/ios/documentation/Foundation/Reference/CAAnimationDelegate_Protocol_Ref/ + NSObject-p + + void + animationDidStart: + //apple_ref/occ/intfcm/CAAnimationDelegate/animationDidStart + + + void + animationDidStop:finished: + //apple_ref/occ/intfcm/CAAnimationDelegate/animationDidStopfinished + + CALayer https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html @@ -779,6 +803,36 @@ //apple_ref/occ/instm/CALayer/setNeedsLayout + + CALayerDelegate + https://developer.apple.com/library/ios/documentation/Foundation/Reference/CALayerDelegate_Protocol_Ref/ + NSObject-p + + id + actionForLayer:forKey: + //apple_ref/occ/intfcm/CALayerDelegate/actionForLayerforKey + + + void + displayLayer: + //apple_ref/occ/intfcm/CALayerDelegate/displayLayer + + + void + drawLayer:inContext: + //apple_ref/occ/intfcm/CALayerDelegate/drawLayerinContext + + + void + layerWillDraw: + //apple_ref/occ/intfcm/CALayerDelegate/layerWillDraw + + + void + layoutSublayersOfLayer: + //apple_ref/occ/intfcm/CALayerDelegate/layoutSublayersOfLayer + + CAMediaTiming https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CAMediaTiming_protocol/Introduction/Introduction.html @@ -945,4 +999,4 @@ //apple_ref/c/tdef/NSZone - \ No newline at end of file + diff --git a/documentation/doxygen/doxygen.config b/documentation/doxygen/doxygen.config index 8c04b83b9..46ed09de4 100644 --- a/documentation/doxygen/doxygen.config +++ b/documentation/doxygen/doxygen.config @@ -1,4 +1,4 @@ -# Doxyfile 1.8.10 +# Doxyfile 1.8.14 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -20,8 +20,8 @@ # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "Core Plot (Mac OS)" +PROJECT_NAME = "Core Plot (macOS)" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -44,7 +44,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "Cocoa plotting framework for Mac OS X and iOS" +PROJECT_BRIEF = "Cocoa plotting framework for macOS, iOS, and tvOS" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 @@ -226,7 +226,8 @@ TAB_SIZE = 4 # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. ALIASES = "YES=@ref YES" \ "NO=@ref NO" \ @@ -312,6 +313,15 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = NO +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or @@ -337,7 +347,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -708,7 +718,7 @@ LAYOUT_FILE = "$(SOURCE_ROOT)/../documentation/doxygen/DoxygenLayout. # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -758,6 +768,12 @@ WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = YES +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated @@ -791,7 +807,7 @@ INPUT = "$(SOURCE_ROOT)/CorePlot.h" \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of # possible encodings. # The default value is: UTF-8. @@ -808,8 +824,8 @@ INPUT_ENCODING = UTF-8 # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, -# *.vhdl, *.ucf, *.qsf, *.as and *.js. +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. FILE_PATTERNS = @@ -899,6 +915,10 @@ IMAGE_PATH = "$(SOURCE_ROOT)/../documentation/" # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -908,6 +928,10 @@ INPUT_FILTER = # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = @@ -992,7 +1016,7 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: @@ -1025,7 +1049,7 @@ VERBATIM_HEADERS = YES # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was -# compiled with the --with-libclang option. +# generated with the -Duse-libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO @@ -1038,6 +1062,17 @@ CLANG_ASSISTED_PARSING = NO CLANG_OPTIONS = +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files +# were built. This is equivalent to specifying the "-p" option to a clang tool, +# such as clang-check. These options will then be passed to the parser. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: 0. + +CLANG_COMPILATION_DATABASE_PATH = 0 + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1157,7 +1192,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1193,6 +1228,17 @@ HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = NO +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via Javascript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have Javascript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1216,12 +1262,12 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# environment (see: https://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1337,7 +1383,7 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1345,8 +1391,7 @@ QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1354,23 +1399,21 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = @@ -1463,7 +1506,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1475,7 +1518,7 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1502,8 +1545,8 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://www.mathjax.org/mathjax @@ -1564,7 +1607,7 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1577,7 +1620,7 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1764,12 +1807,20 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_BIB_STYLE = plain +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1939,9 +1990,9 @@ DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -2041,10 +2092,15 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = "NS_DESIGNATED_INITIALIZER:=''", \ - "NS_RETURNS_INNER_POINTER:=''", \ - "NS_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type", \ - "NS_OPTIONS(_type,_name):=enum _name : _type _name; enum _name : _type" +PREDEFINED = "NS_DESIGNATED_INITIALIZER:= " \ + "NS_RETURNS_INNER_POINTER:= " \ + "NS_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_CLOSED_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_OPTIONS(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_SWIFT_NAME(_name):= " \ + "cpt_deprecated:= " \ + "cpt_swift_enum:= " \ + "cpt_swift_struct:= " # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2366,6 +2422,11 @@ DIAFILE_DIRS = PLANTUML_JAR_PATH = +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. diff --git a/examples/AAPLot/AAPL.plist b/examples/AAPLot/AAPL.plist deleted file mode 100644 index 482c91dc4..000000000 --- a/examples/AAPLot/AAPL.plist +++ /dev/null @@ -1,963 +0,0 @@ - - - - - endDate - 2009-06-19T02:55:22Z - financialData - - - adjClose - 144.67 - close - 144.67 - date - 2009-06-05T04:00:00Z - high - 146.4 - low - 143.21 - open - 145.31 - volume - 22585700 - - - adjClose - 143.74 - close - 143.74 - date - 2009-06-04T04:00:00Z - high - 144.18 - low - 140.04 - open - 140.13 - volume - 19537200 - - - adjClose - 140.95 - close - 140.95 - date - 2009-06-03T04:00:00Z - high - 141.11 - low - 139.07 - open - 140 - volume - 20171800 - - - adjClose - 139.49 - close - 139.49 - date - 2009-06-02T04:00:00Z - high - 141.34 - low - 138.35 - open - 138.99 - volume - 16199500 - - - adjClose - 139.35 - close - 139.35 - date - 2009-06-01T04:00:00Z - high - 139.99 - low - 136 - open - 136.47 - volume - 16160700 - - - adjClose - 135.81 - close - 135.81 - date - 2009-05-29T04:00:00Z - high - 135.9 - low - 133.85 - open - 135.39 - volume - 16304800 - - - adjClose - 135.07 - close - 135.07 - date - 2009-05-28T04:00:00Z - high - 135.39 - low - 132.03 - open - 133.45 - volume - 17397200 - - - adjClose - 133.05 - close - 133.05 - date - 2009-05-27T04:00:00Z - high - 134.98 - low - 130.91 - open - 131.78 - volume - 23086500 - - - adjClose - 130.78 - close - 130.78 - date - 2009-05-26T04:00:00Z - high - 130.83 - low - 124.55 - open - 124.76 - volume - 22692300 - - - adjClose - 122.5 - close - 122.5 - date - 2009-05-22T04:00:00Z - high - 124.18 - low - 121.75 - open - 124.05 - volume - 10642800 - - - adjClose - 124.18 - close - 124.18 - date - 2009-05-21T04:00:00Z - high - 126.78 - low - 122.89 - open - 125.15 - volume - 14569500 - - - adjClose - 125.87 - close - 125.87 - date - 2009-05-20T04:00:00Z - high - 129.21 - low - 125.3 - open - 127.63 - volume - 13878000 - - - adjClose - 127.45 - close - 127.45 - date - 2009-05-19T04:00:00Z - high - 129.31 - low - 125.74 - open - 126.82 - volume - 13300800 - - - adjClose - 126.65 - close - 126.65 - date - 2009-05-18T04:00:00Z - high - 126.7 - low - 121.57 - open - 123.73 - volume - 16387200 - - - adjClose - 122.42 - close - 122.42 - date - 2009-05-15T04:00:00Z - high - 124.62 - low - 121.61 - open - 122.32 - volume - 13127400 - - - adjClose - 122.95 - close - 122.95 - date - 2009-05-14T04:00:00Z - high - 123.53 - low - 119.7 - open - 119.78 - volume - 15993800 - - - adjClose - 119.49 - close - 119.49 - date - 2009-05-13T04:00:00Z - high - 124.02 - low - 119.38 - open - 123.21 - volume - 21284700 - - - adjClose - 124.42 - close - 124.42 - date - 2009-05-12T04:00:00Z - high - 129.71 - low - 123.25 - open - 129.56 - volume - 21767200 - - - adjClose - 129.57 - close - 129.57 - date - 2009-05-11T04:00:00Z - high - 130.96 - low - 127.12 - open - 127.37 - volume - 14452100 - - - adjClose - 129.19 - close - 129.19 - date - 2009-05-08T04:00:00Z - high - 131.23 - low - 126.26 - open - 129.04 - volume - 16713000 - - - adjClose - 129.06 - close - 129.06 - date - 2009-05-07T04:00:00Z - high - 132.39 - low - 127.9 - open - 132.33 - volume - 18992000 - - - adjClose - 132.5 - close - 132.5 - date - 2009-05-06T04:00:00Z - high - 133.5 - low - 130.22 - open - 133.33 - volume - 16912100 - - - adjClose - 132.71 - close - 132.71 - date - 2009-05-05T04:00:00Z - high - 132.86 - low - 131.12 - open - 131.75 - volume - 14223400 - - - adjClose - 132.07 - close - 132.07 - date - 2009-05-04T04:00:00Z - high - 132.25 - low - 127.68 - open - 128.24 - volume - 21762800 - - - adjClose - 127.24 - close - 127.24 - date - 2009-05-01T04:00:00Z - high - 127.95 - low - 125.8 - open - 125.8 - volume - 14197000 - - - adjClose - 125.83 - close - 125.83 - date - 2009-04-30T04:00:00Z - high - 127 - low - 124.92 - open - 126.22 - volume - 17803200 - - - adjClose - 125.14 - close - 125.14 - date - 2009-04-29T04:00:00Z - high - 126.85 - low - 123.83 - open - 124.85 - volume - 16361100 - - - adjClose - 123.9 - close - 123.9 - date - 2009-04-28T04:00:00Z - high - 126.21 - low - 123.26 - open - 123.35 - volume - 16280600 - - - adjClose - 124.73 - close - 124.73 - date - 2009-04-27T04:00:00Z - high - 125 - low - 122.66 - open - 122.9 - volume - 17167500 - - - adjClose - 123.9 - close - 123.9 - date - 2009-04-24T04:00:00Z - high - 125.14 - low - 122.97 - open - 124.64 - volume - 19313000 - - - adjClose - 125.4 - close - 125.4 - date - 2009-04-23T04:00:00Z - high - 127.2 - low - 123.51 - open - 126.62 - volume - 33755600 - - - adjClose - 121.51 - close - 121.51 - date - 2009-04-22T04:00:00Z - high - 125.35 - low - 121.2 - open - 122.63 - volume - 33527400 - - - adjClose - 121.76 - close - 121.76 - date - 2009-04-21T04:00:00Z - high - 122.14 - low - 118.6 - open - 118.89 - volume - 16810200 - - - adjClose - 120.5 - close - 120.5 - date - 2009-04-20T04:00:00Z - high - 122.99 - low - 119.16 - open - 121.73 - volume - 16659500 - - - adjClose - 123.42 - close - 123.42 - date - 2009-04-17T04:00:00Z - high - 124.25 - low - 120.25 - open - 121.18 - volume - 17767700 - - - adjClose - 121.45 - close - 121.45 - date - 2009-04-16T04:00:00Z - high - 123.15 - low - 118.79 - open - 119.19 - volume - 21194500 - - - adjClose - 117.64 - close - 117.64 - date - 2009-04-15T04:00:00Z - high - 118.25 - low - 115.76 - open - 117.2 - volume - 14745800 - - - adjClose - 118.31 - close - 118.31 - date - 2009-04-14T04:00:00Z - high - 120.17 - low - 117.25 - open - 119.57 - volume - 16236500 - - - adjClose - 120.22 - close - 120.22 - date - 2009-04-13T04:00:00Z - high - 120.98 - low - 119 - open - 120.01 - volume - 13901300 - - - adjClose - 119.57 - close - 119.57 - date - 2009-04-09T04:00:00Z - high - 120 - low - 117.96 - open - 118.42 - volume - 18955600 - - - adjClose - 116.32 - close - 116.32 - date - 2009-04-08T04:00:00Z - high - 116.79 - low - 114.58 - open - 115.43 - volume - 16272500 - - - adjClose - 115 - close - 115 - date - 2009-04-07T04:00:00Z - high - 116.67 - low - 114.19 - open - 116.53 - volume - 19163600 - - - adjClose - 118.45 - close - 118.45 - date - 2009-04-06T04:00:00Z - high - 118.75 - low - 113.28 - open - 114.94 - volume - 23502300 - - - adjClose - 115.99 - close - 115.99 - date - 2009-04-03T04:00:00Z - high - 116.13 - low - 113.52 - open - 114.19 - volume - 22722900 - - - adjClose - 112.71 - close - 112.71 - date - 2009-04-02T04:00:00Z - high - 114.75 - low - 109.78 - open - 110.14 - volume - 29013100 - - - adjClose - 108.69 - close - 108.69 - date - 2009-04-01T04:00:00Z - high - 109 - low - 103.89 - open - 104.09 - volume - 21049000 - - - adjClose - 105.12 - close - 105.12 - date - 2009-03-31T04:00:00Z - high - 107.45 - low - 105 - open - 105.45 - volume - 20338500 - - - adjClose - 104.49 - close - 104.49 - date - 2009-03-30T04:00:00Z - high - 105.01 - low - 102.61 - open - 104.51 - volume - 17957000 - - - adjClose - 106.85 - close - 106.85 - date - 2009-03-27T04:00:00Z - high - 108.53 - low - 106.4 - open - 108.23 - volume - 17602600 - - - adjClose - 109.87 - close - 109.87 - date - 2009-03-26T04:00:00Z - high - 109.98 - low - 107.58 - open - 107.83 - volume - 22009000 - - - adjClose - 106.49 - close - 106.49 - date - 2009-03-25T04:00:00Z - high - 108.36 - low - 103.86 - open - 107.58 - volume - 23093500 - - - adjClose - 106.5 - close - 106.5 - date - 2009-03-24T04:00:00Z - high - 109.44 - low - 105.39 - open - 106.36 - volume - 22879000 - - - adjClose - 107.66 - close - 107.66 - date - 2009-03-23T04:00:00Z - high - 108.16 - low - 101.75 - open - 102.71 - volume - 23799900 - - - adjClose - 101.59 - close - 101.59 - date - 2009-03-20T04:00:00Z - high - 103.11 - low - 100.57 - open - 102.09 - volume - 24842400 - - - adjClose - 101.62 - close - 101.62 - date - 2009-03-19T04:00:00Z - high - 103.2 - low - 100.25 - open - 101.85 - volume - 17863600 - - - adjClose - 101.52 - close - 101.52 - date - 2009-03-18T04:00:00Z - high - 103.48 - low - 99.72 - open - 99.91 - volume - 28429900 - - - adjClose - 99.66 - close - 99.66 - date - 2009-03-17T04:00:00Z - high - 99.69 - low - 95.07000000000001 - open - 95.23999999999999 - volume - 28094500 - - - adjClose - 95.42 - close - 95.42 - date - 2009-03-16T04:00:00Z - high - 97.39 - low - 94.17999999999999 - open - 96.53 - volume - 28473000 - - - adjClose - 95.92999999999999 - close - 95.92999999999999 - date - 2009-03-13T04:00:00Z - high - 97.2 - low - 95.01000000000001 - open - 96.3 - volume - 21470300 - - - overallHigh - 146.4 - overallLow - 94.17999999999999 - startDate - 2009-03-27T02:55:22Z - symbol - AAPL - - diff --git a/examples/AAPLot/AAPLot.png b/examples/AAPLot/AAPLot.png deleted file mode 100644 index c218d2598..000000000 Binary files a/examples/AAPLot/AAPLot.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot.xcodeproj/project.pbxproj b/examples/AAPLot/AAPLot.xcodeproj/project.pbxproj deleted file mode 100644 index c1936d1b5..000000000 --- a/examples/AAPLot/AAPLot.xcodeproj/project.pbxproj +++ /dev/null @@ -1,497 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 47; - objects = { - -/* Begin PBXBuildFile section */ - 073703570FE5193C006D46AD /* APFinancialData.m in Sources */ = {isa = PBXBuildFile; fileRef = 073703560FE5193C006D46AD /* APFinancialData.m */; }; - 073703B10FE51E6C006D46AD /* NSDateFormatterExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 073703B00FE51E6C006D46AD /* NSDateFormatterExtensions.m */; }; - 1D3623260D0F684500981E51 /* AAPLotAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AAPLotAppDelegate.m */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 280E754D0DD40C5E005A515E /* FlipsideView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 280E754A0DD40C5E005A515E /* FlipsideView.xib */; }; - 280E754E0DD40C5E005A515E /* MainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 280E754B0DD40C5E005A515E /* MainView.xib */; }; - 280E754F0DD40C5E005A515E /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 280E754C0DD40C5E005A515E /* MainWindow.xib */; }; - 288765590DF743DE002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765580DF743DE002DB57D /* CoreGraphics.framework */; }; - 289233A60DB2D0840083E9F9 /* FlipsideView.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233A30DB2D0840083E9F9 /* FlipsideView.m */; }; - 289233AE0DB2D0DB0083E9F9 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233A90DB2D0DB0083E9F9 /* MainViewController.m */; }; - 289233AF0DB2D0DB0083E9F9 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233AB0DB2D0DB0083E9F9 /* RootViewController.m */; }; - 289233B00DB2D0DB0083E9F9 /* FlipsideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233AD0DB2D0DB0083E9F9 /* FlipsideViewController.m */; }; - AB8989470FE0309E00FDC37F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB8989460FE0309E00FDC37F /* QuartzCore.framework */; }; - AB8F94580FDEFA1500E61485 /* APYahooDataPuller.m in Sources */ = {isa = PBXBuildFile; fileRef = AB8F94570FDEFA1500E61485 /* APYahooDataPuller.m */; }; - ABA5345E0FEB40CE0046A8DA /* AAPL.plist in Resources */ = {isa = PBXBuildFile; fileRef = ABA5345D0FEB40CE0046A8DA /* AAPL.plist */; }; - C3CD283017DE9B9C008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD282F17DE9B9C008EED1E /* Accelerate.framework */; }; - C3D3936C19FD6B1D00148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3936B19FD6B1D00148319 /* Images.xcassets */; }; - C3D414941A7D838200B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3D414911A7D836300B6F5D6 /* libCorePlot-CocoaTouch.a */; }; - C3F0BA3919EC9F6300F7CB47 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3F0BA3819EC9F6300F7CB47 /* Launch Screen.xib */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - C3D414881A7D836300B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D4147C1A7D836300B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 8DC2EF5B0486A6940098B216; - remoteInfo = CorePlot; - }; - C3D4148A1A7D836300B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D4147C1A7D836300B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 0730F600109492D800E95162; - remoteInfo = UnitTests; - }; - C3D4148C1A7D836300B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D4147C1A7D836300B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C38A09781A46185200D45436; - remoteInfo = CorePlot_iOS; - }; - C3D4148E1A7D836300B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D4147C1A7D836300B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C38A09821A46185300D45436; - remoteInfo = CorePlot_iOSTests; - }; - C3D414901A7D836300B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D4147C1A7D836300B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C38A09BA1A4619A900D45436; - remoteInfo = "CorePlot-CocoaTouch"; - }; - C3D414921A7D836300B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D4147C1A7D836300B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C38A09C41A4619A900D45436; - remoteInfo = "CorePlot-CocoaTouchTests"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 073703550FE5193C006D46AD /* APFinancialData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APFinancialData.h; sourceTree = ""; }; - 073703560FE5193C006D46AD /* APFinancialData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APFinancialData.m; sourceTree = ""; }; - 073703AF0FE51E6C006D46AD /* NSDateFormatterExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDateFormatterExtensions.h; sourceTree = ""; }; - 073703B00FE51E6C006D46AD /* NSDateFormatterExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDateFormatterExtensions.m; sourceTree = ""; }; - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D3623240D0F684500981E51 /* AAPLotAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAPLotAppDelegate.h; sourceTree = ""; }; - 1D3623250D0F684500981E51 /* AAPLotAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAPLotAppDelegate.m; sourceTree = ""; }; - 1D6058910D05DD3D006BFB54 /* AAPLot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AAPLot.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 280E754A0DD40C5E005A515E /* FlipsideView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FlipsideView.xib; sourceTree = ""; }; - 280E754B0DD40C5E005A515E /* MainView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainView.xib; sourceTree = ""; }; - 280E754C0DD40C5E005A515E /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainWindow.xib; path = ../MainWindow.xib; sourceTree = ""; }; - 288765580DF743DE002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 289233A20DB2D0840083E9F9 /* FlipsideView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlipsideView.h; path = Classes/FlipsideView.h; sourceTree = ""; }; - 289233A30DB2D0840083E9F9 /* FlipsideView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlipsideView.m; path = Classes/FlipsideView.m; sourceTree = ""; }; - 289233A80DB2D0DB0083E9F9 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = MainViewController.h; path = Classes/MainViewController.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 289233A90DB2D0DB0083E9F9 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = MainViewController.m; path = Classes/MainViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 289233AA0DB2D0DB0083E9F9 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; - 289233AB0DB2D0DB0083E9F9 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; - 289233AC0DB2D0DB0083E9F9 /* FlipsideViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlipsideViewController.h; path = Classes/FlipsideViewController.h; sourceTree = ""; }; - 289233AD0DB2D0DB0083E9F9 /* FlipsideViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlipsideViewController.m; path = Classes/FlipsideViewController.m; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* AAPLot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAPLot_Prefix.pch; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AB8989460FE0309E00FDC37F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - AB8F94560FDEFA1500E61485 /* APYahooDataPuller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = APYahooDataPuller.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - AB8F94570FDEFA1500E61485 /* APYahooDataPuller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = APYahooDataPuller.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - ABA5345D0FEB40CE0046A8DA /* AAPL.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = AAPL.plist; sourceTree = ""; }; - C3CA9B5819E1F79B008DF7A3 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; - C3CD282F17DE9B9C008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - C3D3936B19FD6B1D00148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = AAPLot/Images.xcassets; sourceTree = ""; }; - C3D4147C1A7D836300B6F5D6 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = ""; }; - C3F0BA3819EC9F6300F7CB47 /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, - 288765590DF743DE002DB57D /* CoreGraphics.framework in Frameworks */, - AB8989470FE0309E00FDC37F /* QuartzCore.framework in Frameworks */, - C3CD283017DE9B9C008EED1E /* Accelerate.framework in Frameworks */, - C3D414941A7D838200B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0737034D0FE518E7006D46AD /* Data Acquisition */ = { - isa = PBXGroup; - children = ( - AB8F94560FDEFA1500E61485 /* APYahooDataPuller.h */, - AB8F94570FDEFA1500E61485 /* APYahooDataPuller.m */, - 073703550FE5193C006D46AD /* APFinancialData.h */, - 073703560FE5193C006D46AD /* APFinancialData.m */, - 073703AF0FE51E6C006D46AD /* NSDateFormatterExtensions.h */, - 073703B00FE51E6C006D46AD /* NSDateFormatterExtensions.m */, - ); - name = "Data Acquisition"; - sourceTree = ""; - }; - 080E96DDFE201D6D7F000001 /* Application Controllers */ = { - isa = PBXGroup; - children = ( - 280E754C0DD40C5E005A515E /* MainWindow.xib */, - 1D3623240D0F684500981E51 /* AAPLotAppDelegate.h */, - 1D3623250D0F684500981E51 /* AAPLotAppDelegate.m */, - 289233AA0DB2D0DB0083E9F9 /* RootViewController.h */, - 289233AB0DB2D0DB0083E9F9 /* RootViewController.m */, - ); - name = "Application Controllers"; - path = Classes; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* AAPLot.app */, - ); - name = Products; - sourceTree = ""; - }; - 281C6CD70DB2D82200F60ACC /* Flipside View */ = { - isa = PBXGroup; - children = ( - 280E754A0DD40C5E005A515E /* FlipsideView.xib */, - 289233A20DB2D0840083E9F9 /* FlipsideView.h */, - 289233A30DB2D0840083E9F9 /* FlipsideView.m */, - 289233AC0DB2D0DB0083E9F9 /* FlipsideViewController.h */, - 289233AD0DB2D0DB0083E9F9 /* FlipsideViewController.m */, - ); - name = "Flipside View"; - sourceTree = ""; - }; - 289233A00DB2D0730083E9F9 /* Main View */ = { - isa = PBXGroup; - children = ( - 280E754B0DD40C5E005A515E /* MainView.xib */, - 289233A80DB2D0DB0083E9F9 /* MainViewController.h */, - 289233A90DB2D0DB0083E9F9 /* MainViewController.m */, - C3F0BA3819EC9F6300F7CB47 /* Launch Screen.xib */, - ); - name = "Main View"; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - C3D4147C1A7D836300B6F5D6 /* CorePlot.xcodeproj */, - 289233A00DB2D0730083E9F9 /* Main View */, - 0737034D0FE518E7006D46AD /* Data Acquisition */, - 281C6CD70DB2D82200F60ACC /* Flipside View */, - 080E96DDFE201D6D7F000001 /* Application Controllers */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - indentWidth = 4; - name = CustomTemplate; - sourceTree = ""; - tabWidth = 4; - usesTabs = 0; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* AAPLot_Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - C3CA9B5819E1F79B008DF7A3 /* CorePlotWarnings.xcconfig */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - C3D3936B19FD6B1D00148319 /* Images.xcassets */, - ABA5345D0FEB40CE0046A8DA /* AAPL.plist */, - 8D1107310486CEB800E47090 /* Info.plist */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - AB8989460FE0309E00FDC37F /* QuartzCore.framework */, - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, - 1D30AB110D05D00D00671497 /* Foundation.framework */, - 288765580DF743DE002DB57D /* CoreGraphics.framework */, - C3CD282F17DE9B9C008EED1E /* Accelerate.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - C3D4147D1A7D836300B6F5D6 /* Products */ = { - isa = PBXGroup; - children = ( - C3D414891A7D836300B6F5D6 /* CorePlot.framework */, - C3D4148B1A7D836300B6F5D6 /* UnitTests.xctest */, - C3D4148D1A7D836300B6F5D6 /* CorePlot.framework */, - C3D4148F1A7D836300B6F5D6 /* UnitTests iOS.xctest */, - C3D414911A7D836300B6F5D6 /* libCorePlot-CocoaTouch.a */, - C3D414931A7D836300B6F5D6 /* CorePlot-CocoaTouchTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* AAPLot */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "AAPLot" */; - buildPhases = ( - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = AAPLot; - productName = AAPLot; - productReference = 1D6058910D05DD3D006BFB54 /* AAPLot.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0700; - TargetAttributes = { - 1D6058900D05DD3D006BFB54 = { - DevelopmentTeam = 28ZA45DE7D; - }; - }; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AAPLot" */; - compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - en, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = C3D4147D1A7D836300B6F5D6 /* Products */; - ProjectRef = C3D4147C1A7D836300B6F5D6 /* CorePlot.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* AAPLot */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - C3D414891A7D836300B6F5D6 /* CorePlot.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = CorePlot.framework; - remoteRef = C3D414881A7D836300B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C3D4148B1A7D836300B6F5D6 /* UnitTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = UnitTests.xctest; - remoteRef = C3D4148A1A7D836300B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C3D4148D1A7D836300B6F5D6 /* CorePlot.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = CorePlot.framework; - remoteRef = C3D4148C1A7D836300B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C3D4148F1A7D836300B6F5D6 /* UnitTests iOS.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "UnitTests iOS.xctest"; - remoteRef = C3D4148E1A7D836300B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C3D414911A7D836300B6F5D6 /* libCorePlot-CocoaTouch.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libCorePlot-CocoaTouch.a"; - remoteRef = C3D414901A7D836300B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C3D414931A7D836300B6F5D6 /* CorePlot-CocoaTouchTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "CorePlot-CocoaTouchTests.xctest"; - remoteRef = C3D414921A7D836300B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 280E754D0DD40C5E005A515E /* FlipsideView.xib in Resources */, - 280E754E0DD40C5E005A515E /* MainView.xib in Resources */, - C3D3936C19FD6B1D00148319 /* Images.xcassets in Resources */, - 280E754F0DD40C5E005A515E /* MainWindow.xib in Resources */, - ABA5345E0FEB40CE0046A8DA /* AAPL.plist in Resources */, - C3F0BA3919EC9F6300F7CB47 /* Launch Screen.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 1D3623260D0F684500981E51 /* AAPLotAppDelegate.m in Sources */, - 289233A60DB2D0840083E9F9 /* FlipsideView.m in Sources */, - 289233AE0DB2D0DB0083E9F9 /* MainViewController.m in Sources */, - 289233AF0DB2D0DB0083E9F9 /* RootViewController.m in Sources */, - 289233B00DB2D0DB0083E9F9 /* FlipsideViewController.m in Sources */, - AB8F94580FDEFA1500E61485 /* APYahooDataPuller.m in Sources */, - 073703570FE5193C006D46AD /* APFinancialData.m in Sources */, - 073703B10FE51E6C006D46AD /* NSDateFormatterExtensions.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3CA9B5819E1F79B008DF7A3 /* CorePlotWarnings.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = AAPLot_Prefix.pch; - HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; - PRODUCT_NAME = AAPLot; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3CA9B5819E1F79B008DF7A3 /* CorePlotWarnings.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = AAPLot_Prefix.pch; - HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; - PRODUCT_NAME = AAPLot; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SYMROOT = "$(SRCROOT)/../../build"; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - SDKROOT = iphoneos; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "AAPLot" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AAPLot" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/examples/AAPLot/AAPLot.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/AAPLot/AAPLot.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 0044da799..000000000 --- a/examples/AAPLot/AAPLot.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 340f2376e..000000000 --- a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "images" : [ - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-Spotlight-40@2x.png", - "scale" : "2x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png deleted file mode 100644 index 489d32b6c..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png deleted file mode 100644 index e732a791c..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small.png deleted file mode 100644 index 0310c42a8..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png deleted file mode 100644 index 8170f07ca..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png deleted file mode 100644 index c7fba2304..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon.png deleted file mode 100644 index ca3d9f35b..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon@2x.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon@2x.png deleted file mode 100644 index d67508c07..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon@2x.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot_Prefix.pch b/examples/AAPLot/AAPLot_Prefix.pch deleted file mode 100644 index dc5f28052..000000000 --- a/examples/AAPLot/AAPLot_Prefix.pch +++ /dev/null @@ -1,10 +0,0 @@ -// -// Prefix header for all source files of the 'AAPLot' target in the 'AAPLot' project -// - -#define DEBUG (1) - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/examples/AAPLot/APFinancialData.h b/examples/AAPLot/APFinancialData.h deleted file mode 100644 index 9a2509602..000000000 --- a/examples/AAPLot/APFinancialData.h +++ /dev/null @@ -1,7 +0,0 @@ -#import "CorePlot-CocoaTouch.h" - -@interface NSDictionary(APFinancialData) - -+(nonnull CPTDictionary)dictionaryWithCSVLine:(nonnull NSString *)csvLine; - -@end diff --git a/examples/AAPLot/APFinancialData.m b/examples/AAPLot/APFinancialData.m deleted file mode 100644 index 3d32947d0..000000000 --- a/examples/AAPLot/APFinancialData.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "APFinancialData.h" -#import "NSDateFormatterExtensions.h" - -@implementation NSDictionary(APFinancialData) - -+(nonnull CPTDictionary)dictionaryWithCSVLine:(nonnull NSString *)csvLine -{ - CPTStringArray csvChunks = [csvLine componentsSeparatedByString:@","]; - - CPTMutableDictionary csvDict = [NSMutableDictionary dictionaryWithCapacity:7]; - - // Date,Open,High,Low,Close,Volume,Adj Close - // 2009-06-08,143.82,144.23,139.43,143.85,33255400,143.85 - NSDate *theDate = [[NSDateFormatter csvDateFormatter] dateFromString:csvChunks[0]]; - - csvDict[@"date"] = theDate; - NSDecimalNumber *theOpen = [NSDecimalNumber decimalNumberWithString:csvChunks[1]]; - csvDict[@"open"] = theOpen; - NSDecimalNumber *theHigh = [NSDecimalNumber decimalNumberWithString:csvChunks[2]]; - csvDict[@"high"] = theHigh; - NSDecimalNumber *theLow = [NSDecimalNumber decimalNumberWithString:csvChunks[3]]; - csvDict[@"low"] = theLow; - NSDecimalNumber *theClose = [NSDecimalNumber decimalNumberWithString:csvChunks[4]]; - csvDict[@"close"] = theClose; - NSDecimalNumber *theVolume = [NSDecimalNumber decimalNumberWithString:csvChunks[5]]; - csvDict[@"volume"] = theVolume; - NSDecimalNumber *theAdjClose = [NSDecimalNumber decimalNumberWithString:csvChunks[6]]; - csvDict[@"adjClose"] = theAdjClose; - - // non-mutable autoreleased dict - return [NSDictionary dictionaryWithDictionary:csvDict]; -} - -@end diff --git a/examples/AAPLot/APYahooDataPuller.h b/examples/AAPLot/APYahooDataPuller.h deleted file mode 100644 index b2598d1d0..000000000 --- a/examples/AAPLot/APYahooDataPuller.h +++ /dev/null @@ -1,35 +0,0 @@ -#import "APFinancialData.h" - -@class APYahooDataPuller; - -typedef NSArray *CPTFinancialDataArray; - -@protocol APYahooDataPullerDelegate - -@optional - --(void)dataPullerDidFinishFetch:(nonnull APYahooDataPuller *)dp; - -@end - -#pragma mark - - -@interface APYahooDataPuller : NSObject - -@property (nonatomic, readwrite, weak, nullable) id delegate; -@property (nonatomic, readwrite, copy, nonnull) NSString *symbol; -@property (nonatomic, readwrite, strong, nonnull) NSDate *startDate; -@property (nonatomic, readwrite, strong, nonnull) NSDate *endDate; -@property (nonatomic, readwrite, copy, nonnull) NSString *targetSymbol; -@property (nonatomic, readwrite, strong, nonnull) NSDate *targetStartDate; -@property (nonatomic, readwrite, strong, nonnull) NSDate *targetEndDate; -@property (nonatomic, readonly, strong, nonnull) CPTFinancialDataArray financialData; -@property (nonatomic, readonly, strong, nonnull) NSDecimalNumber *overallHigh; -@property (nonatomic, readonly, strong, nonnull) NSDecimalNumber *overallLow; -@property (nonatomic, readonly, strong, nonnull) NSDecimalNumber *overallVolumeHigh; -@property (nonatomic, readonly, strong, nonnull) NSDecimalNumber *overallVolumeLow; -@property (nonatomic, readonly, assign) BOOL loadingData; - --(nonnull instancetype)initWithTargetSymbol:(nonnull NSString *)aSymbol targetStartDate:(nonnull NSDate *)aStartDate targetEndDate:(nonnull NSDate *)anEndDate; - -@end diff --git a/examples/AAPLot/APYahooDataPuller.m b/examples/AAPLot/APYahooDataPuller.m deleted file mode 100644 index 7c8c5c7f0..000000000 --- a/examples/AAPLot/APYahooDataPuller.m +++ /dev/null @@ -1,422 +0,0 @@ -#import "APFinancialData.h" -#import "APYahooDataPuller.h" - -@interface APYahooDataPuller() - -@property (nonatomic, readwrite, copy, nonnull) NSString *csvString; - -@property (nonatomic, readwrite, strong, nonnull) NSDecimalNumber *overallHigh; -@property (nonatomic, readwrite, strong, nonnull) NSDecimalNumber *overallLow; -@property (nonatomic, readwrite, strong, nonnull) NSDecimalNumber *overallVolumeHigh; -@property (nonatomic, readwrite, strong, nonnull) NSDecimalNumber *overallVolumeLow; -@property (nonatomic, readwrite, strong, nonnull) CPTFinancialDataArray financialData; - -@property (nonatomic, readwrite, assign) BOOL loadingData; -@property (nonatomic, readwrite, strong, nullable) NSMutableData *receivedData; -@property (nonatomic, readwrite, strong, nullable) NSURLConnection *connection; - --(nonnull instancetype)initWithDictionary:(nonnull CPTDictionary)aDict targetSymbol:(nonnull NSString *)aSymbol targetStartDate:(nonnull NSDate *)aStartDate targetEndDate:(nonnull NSDate *)anEndDate; - --(nonnull CPTDictionary)plistRep; --(BOOL)writeToFile:(nonnull NSString *)path atomically:(BOOL)flag; --(void)fetch; --(BOOL)shouldDownload; --(nonnull NSString *)pathForSymbol:(nonnull NSString *)aSymbol; --(nonnull NSString *)faultTolerantPathForSymbol:(nonnull NSString *)aSymbol; --(nonnull CPTDictionary)dictionaryForSymbol:(nonnull NSString *)aSymbol; --(nonnull NSString *)URL; --(void)notifyPulledData; --(void)parseCSVAndPopulate; - -NSTimeInterval timeIntervalForNumberOfWeeks(double numberOfWeeks); - -@end - -#pragma mark - - -NSTimeInterval timeIntervalForNumberOfWeeks(double numberOfWeeks) -{ - NSTimeInterval seconds = fabs(60.0 * 60.0 * 24.0 * 7.0 * numberOfWeeks); - - return seconds; -} - -@implementation APYahooDataPuller - -@synthesize symbol; -@synthesize startDate; -@synthesize endDate; -@synthesize targetStartDate; -@synthesize targetEndDate; -@synthesize targetSymbol; -@synthesize overallLow; -@synthesize overallHigh; -@synthesize overallVolumeHigh; -@synthesize overallVolumeLow; -@synthesize csvString; -@synthesize financialData; - -@synthesize receivedData; -@synthesize connection; -@synthesize loadingData; - -@synthesize delegate; - --(void)setDelegate:(id)aDelegate -{ - if ( delegate != aDelegate ) { - delegate = aDelegate; - if ( self.financialData.count > 0 ) { - [self notifyPulledData]; // loads cached data onto UI - } - } -} - --(nonnull CPTDictionary)plistRep -{ - CPTMutableDictionary rep = [NSMutableDictionary dictionaryWithCapacity:7]; - - rep[@"symbol"] = self.symbol; - rep[@"startDate"] = self.startDate; - rep[@"endDate"] = self.endDate; - rep[@"overallHigh"] = self.overallHigh; - rep[@"overallLow"] = self.overallLow; - rep[@"overallVolumeHigh"] = self.overallVolumeHigh; - rep[@"overallVolumeLow"] = self.overallVolumeLow; - rep[@"financialData"] = self.financialData; - - return [NSDictionary dictionaryWithDictionary:rep]; -} - --(BOOL)writeToFile:(nonnull NSString *)path atomically:(BOOL)flag -{ - NSLog(@"writeToFile:%@", path); - BOOL success = [[self plistRep] writeToFile:path atomically:flag]; - return success; -} - --(nonnull instancetype)initWithDictionary:(nonnull CPTDictionary)aDict targetSymbol:(nonnull NSString *)aSymbol targetStartDate:(nonnull NSDate *)aStartDate targetEndDate:(nonnull NSDate *)anEndDate -{ - self = [super init]; - if ( self != nil ) { - NSString *theSymbol = aDict[@"symbol"]; - self.symbol = theSymbol ? theSymbol : @""; - NSDate *theStartDate = aDict[@"startDate"]; - self.startDate = theStartDate ? theStartDate : [NSDate date]; - NSDate *theEndDate = aDict[@"endDate"]; - self.endDate = theEndDate ? theEndDate : [NSDate date]; - NSNumber *low = aDict[@"overallLow"]; - self.overallLow = low ? [NSDecimalNumber decimalNumberWithDecimal:low.decimalValue] : [NSDecimalNumber notANumber]; - NSNumber *high = aDict[@"overallHigh"]; - self.overallHigh = high ? [NSDecimalNumber decimalNumberWithDecimal:high.decimalValue] : [NSDecimalNumber notANumber]; - NSNumber *volumeLow = aDict[@"overallVolumeLow"]; - self.overallVolumeLow = low ? [NSDecimalNumber decimalNumberWithDecimal:volumeLow.decimalValue] : [NSDecimalNumber notANumber]; - NSNumber *volumeHigh = aDict[@"overallVolumeHigh"]; - self.overallVolumeHigh = high ? [NSDecimalNumber decimalNumberWithDecimal:volumeHigh.decimalValue] : [NSDecimalNumber notANumber]; - CPTFinancialDataArray dataArray = aDict[@"financialData"]; - self.financialData = dataArray ? dataArray : [[NSArray alloc] init]; - - self.targetSymbol = aSymbol; - self.targetStartDate = aStartDate; - self.targetEndDate = anEndDate; - - self.csvString = @""; - - [self performSelector:@selector(fetch) withObject:nil afterDelay:0.01]; - } - return self; -} - --(nonnull NSString *)pathForSymbol:(nonnull NSString *)aSymbol -{ - CPTStringArray paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsDirectory = paths[0]; - NSString *docPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.plist", aSymbol]]; - - return docPath; -} - --(nonnull NSString *)faultTolerantPathForSymbol:(nonnull NSString *)aSymbol -{ - NSString *docPath = [self pathForSymbol:aSymbol]; - - if ( ![[NSFileManager defaultManager] fileExistsAtPath:docPath] ) { - // if there isn't one in the user's documents directory, see if we ship with this data - docPath = [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.plist", aSymbol]]; - } - return docPath; -} - -// Always returns *something* --(nonnull CPTDictionary)dictionaryForSymbol:(nonnull NSString *)aSymbol -{ - NSString *path = [self faultTolerantPathForSymbol:aSymbol]; - - CPTMutableDictionary localPlistDict = [NSMutableDictionary dictionaryWithContentsOfFile:path]; - - return localPlistDict; -} - --(nonnull instancetype)initWithTargetSymbol:(nonnull NSString *)aSymbol targetStartDate:(nonnull NSDate *)aStartDate targetEndDate:(nonnull NSDate *)anEndDate -{ - CPTDictionary cachedDictionary = [self dictionaryForSymbol:aSymbol]; - - if ( nil != cachedDictionary ) { - return [self initWithDictionary:cachedDictionary targetSymbol:aSymbol targetStartDate:aStartDate targetEndDate:anEndDate]; - } - - CPTMutableDictionary rep = [NSMutableDictionary dictionaryWithCapacity:7]; - rep[@"symbol"] = aSymbol; - rep[@"startDate"] = aStartDate; - rep[@"endDate"] = anEndDate; - rep[@"overallHigh"] = [NSDecimalNumber notANumber]; - rep[@"overallLow"] = [NSDecimalNumber notANumber]; - rep[@"overallVolumeHigh"] = [NSDecimalNumber notANumber]; - rep[@"overallVolumeLow"] = [NSDecimalNumber notANumber]; - rep[@"financialData"] = @[]; - - return [self initWithDictionary:rep targetSymbol:aSymbol targetStartDate:aStartDate targetEndDate:anEndDate]; -} - --(nonnull instancetype)init -{ - NSTimeInterval secondsAgo = -timeIntervalForNumberOfWeeks(14.0); // 12 weeks ago - NSDate *start = [NSDate dateWithTimeIntervalSinceNow:secondsAgo]; - - NSDate *end = [NSDate date]; - - return [self initWithTargetSymbol:@"GOOG" targetStartDate:start targetEndDate:end]; -} - --(void)dealloc -{ - delegate = nil; -} - -// http://www.goldb.org/ystockquote.html --(nonnull NSString *)URL -{ - NSUInteger unitFlags = NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitYear; - - NSCalendar *gregorian = [[NSCalendar alloc] - initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; - - NSString *url = [NSString stringWithFormat:@"https://ichart.yahoo.com/table.csv?s=%@&", self.targetSymbol]; - - NSDate *tStartDate = self.targetStartDate; - - if ( tStartDate ) { - NSDateComponents *compsStart = [gregorian components:unitFlags fromDate:tStartDate]; - - url = [url stringByAppendingFormat:@"a=%ld&", (long)compsStart.month - 1]; - url = [url stringByAppendingFormat:@"b=%ld&", (long)compsStart.day]; - url = [url stringByAppendingFormat:@"c=%ld&", (long)compsStart.year]; - } - - NSDate *tEndDate = self.targetEndDate; - if ( tEndDate ) { - NSDateComponents *compsEnd = [gregorian components:unitFlags fromDate:tEndDate]; - - url = [url stringByAppendingFormat:@"d=%ld&", (long)compsEnd.month - 1]; - url = [url stringByAppendingFormat:@"e=%ld&", (long)compsEnd.day]; - url = [url stringByAppendingFormat:@"f=%ld&", (long)compsEnd.year]; - } - - url = [url stringByAppendingString:@"g=d&"]; - - url = [url stringByAppendingString:@"ignore=.csv"]; - url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - - return url; -} - --(void)notifyPulledData -{ - id theDelegate = self.delegate; - - if ( [theDelegate respondsToSelector:@selector(dataPullerDidFinishFetch:)] ) { - [theDelegate performSelector:@selector(dataPullerDidFinishFetch:) withObject:self]; - } -} - -#pragma mark - -#pragma mark Downloading of data - --(BOOL)shouldDownload -{ - BOOL shouldDownload = YES; - - return shouldDownload; -} - --(void)fetch -{ - if ( self.loadingData ) { - return; - } - - if ( [self shouldDownload] ) { - self.loadingData = YES; - NSString *urlString = [self URL]; - NSLog(@"URL = %@", urlString); - NSURL *url = [NSURL URLWithString:urlString]; - NSURLRequest *theRequest = [NSURLRequest requestWithURL:url - cachePolicy:NSURLRequestUseProtocolCachePolicy - timeoutInterval:60.0]; - - // create the connection with the request - // and start loading the data - self.connection = [NSURLConnection connectionWithRequest:theRequest delegate:self]; - if ( self.connection ) { - self.receivedData = [NSMutableData data]; - } - else { - // TODO: Inform the user that the download could not be started - self.loadingData = NO; - } - } -} - --(void)connection:(nonnull NSURLConnection *)connection didReceiveData:(nonnull NSData *)data -{ - // append the new data to the receivedData - [self.receivedData appendData:data]; -} - --(void)connection:(nonnull NSURLConnection *)connection didReceiveResponse:(nonnull NSURLResponse *)response -{ - // this method is called when the server has determined that it - // has enough information to create the NSURLResponse - // it can be called multiple times, for example in the case of a - // redirect, so each time we reset the data. - self.receivedData.length = 0; -} - --(void)cancelDownload -{ - if ( self.loadingData ) { - [self.connection cancel]; - self.loadingData = NO; - - self.receivedData = nil; - self.connection = nil; - } -} - --(void)connection:(nonnull NSURLConnection *)connection didFailWithError:(nonnull NSError *)error -{ - self.loadingData = NO; - self.receivedData = nil; - self.connection = nil; - NSLog(@"err = %@", error.localizedDescription); - // TODO:report err -} - --(void)connectionDidFinishLoading:(nonnull NSURLConnection *)connection -{ - self.loadingData = NO; - self.connection = nil; - - NSMutableData *data = self.receivedData; - if ( data ) { - NSString *csv = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - self.csvString = csv; - } - else { - self.csvString = @""; - } - - self.receivedData = nil; - [self parseCSVAndPopulate]; - - // see if we need to write to file - CPTDictionary dictionaryForSymbol = [self dictionaryForSymbol:self.symbol]; - - BOOL sameSymbol = NO; - NSString *dictSymbol = dictionaryForSymbol[@"symbol"]; - if ( dictSymbol ) { - sameSymbol = [self.symbol isEqualToString:dictSymbol]; - } - - BOOL sameStart = NO; - NSDate *dictStart = dictionaryForSymbol[@"startDate"]; - if ( dictStart ) { - sameStart = ([self.startDate compare:dictStart] != NSOrderedSame); - } - - BOOL sameEnd = NO; - NSDate *dictEnd = dictionaryForSymbol[@"endDate"]; - if ( dictEnd ) { - sameEnd = ([self.startDate compare:dictEnd] != NSOrderedSame); - } - - if ( !sameSymbol || !sameStart || !sameEnd ) { - [self writeToFile:[self pathForSymbol:self.symbol] atomically:YES]; - } - else { - NSLog(@"Not writing to file -- No Need, its data is fresh."); - } -} - --(void)parseCSVAndPopulate -{ - CPTStringArray csvLines = [self.csvString componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; - - NSMutableArray *newFinancials = [NSMutableArray arrayWithCapacity:csvLines.count]; - CPTDictionary currentFinancial = nil; - NSString *line = nil; - - self.overallHigh = [NSDecimalNumber notANumber]; - self.overallLow = [NSDecimalNumber notANumber]; - self.overallVolumeHigh = [NSDecimalNumber notANumber]; - self.overallVolumeLow = [NSDecimalNumber notANumber]; - - for ( NSUInteger i = 1; i < csvLines.count - 1; i++ ) { - line = csvLines[i]; - currentFinancial = [NSDictionary dictionaryWithCSVLine:line]; - [newFinancials addObject:currentFinancial]; - - NSDecimalNumber *high = currentFinancial[@"high"]; - NSDecimalNumber *low = currentFinancial[@"low"]; - NSDecimalNumber *volume = currentFinancial[@"volume"]; - - if ( [self.overallHigh isEqual:[NSDecimalNumber notANumber]] ) { - self.overallHigh = high; - } - - if ( [self.overallLow isEqual:[NSDecimalNumber notANumber]] ) { - self.overallLow = low; - } - - if ( [low compare:self.overallLow] == NSOrderedAscending ) { - self.overallLow = low; - } - if ( [high compare:self.overallHigh] == NSOrderedDescending ) { - self.overallHigh = high; - } - - if ( [self.overallVolumeHigh isEqual:[NSDecimalNumber notANumber]] ) { - self.overallVolumeHigh = volume; - } - - if ( [self.overallVolumeLow isEqual:[NSDecimalNumber notANumber]] ) { - self.overallVolumeLow = volume; - } - - if ( [volume compare:self.overallVolumeLow] == NSOrderedAscending ) { - self.overallVolumeLow = volume; - } - - if ( [volume compare:self.overallVolumeHigh] == NSOrderedDescending ) { - self.overallVolumeHigh = volume; - } - } - self.startDate = self.targetStartDate; - self.endDate = self.targetEndDate; - self.symbol = self.targetSymbol; - - self.financialData = [NSArray arrayWithArray:newFinancials]; - [self notifyPulledData]; -} - -@end diff --git a/examples/AAPLot/Classes/AAPLotAppDelegate.h b/examples/AAPLot/Classes/AAPLotAppDelegate.h deleted file mode 100644 index 13e1ab5d5..000000000 --- a/examples/AAPLot/Classes/AAPLotAppDelegate.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// AAPLotAppDelegate.h -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import - -@class RootViewController; - -@interface AAPLotAppDelegate : NSObject - -@property (nonatomic, strong, nullable) IBOutlet UIWindow *window; -@property (nonatomic, strong, nullable) IBOutlet RootViewController *rootViewController; - -@end diff --git a/examples/AAPLot/Classes/AAPLotAppDelegate.m b/examples/AAPLot/Classes/AAPLotAppDelegate.m deleted file mode 100644 index 0ab940279..000000000 --- a/examples/AAPLot/Classes/AAPLotAppDelegate.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// AAPLotAppDelegate.m -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import "AAPLotAppDelegate.h" -#import "RootViewController.h" - -@implementation AAPLotAppDelegate - -@synthesize window; -@synthesize rootViewController; - --(void)applicationDidFinishLaunching:(nonnull UIApplication *)application -{ - self.window.rootViewController = self.rootViewController; - [self.window makeKeyAndVisible]; -} - -@end diff --git a/examples/AAPLot/Classes/FlipsideView.h b/examples/AAPLot/Classes/FlipsideView.h deleted file mode 100644 index 26746ed6f..000000000 --- a/examples/AAPLot/Classes/FlipsideView.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// FlipsideView.h -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import - -@interface FlipsideView : UIView { -} - -@end diff --git a/examples/AAPLot/Classes/FlipsideView.m b/examples/AAPLot/Classes/FlipsideView.m deleted file mode 100644 index 179b28f9d..000000000 --- a/examples/AAPLot/Classes/FlipsideView.m +++ /dev/null @@ -1,26 +0,0 @@ -// -// FlipsideView.m -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import "FlipsideView.h" - -@implementation FlipsideView - --(nonnull instancetype)initWithFrame:(CGRect)frame -{ - if ( (self = [super initWithFrame:frame]) ) { - // Initialization code - } - return self; -} - --(void)drawRect:(CGRect)rect -{ - // Drawing code -} - -@end diff --git a/examples/AAPLot/Classes/FlipsideViewController.h b/examples/AAPLot/Classes/FlipsideViewController.h deleted file mode 100644 index ae62c708e..000000000 --- a/examples/AAPLot/Classes/FlipsideViewController.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// FlipsideViewController.h -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import - -@interface FlipsideViewController : UIViewController { -} - -@end diff --git a/examples/AAPLot/Classes/FlipsideViewController.m b/examples/AAPLot/Classes/FlipsideViewController.m deleted file mode 100644 index 3758a24b3..000000000 --- a/examples/AAPLot/Classes/FlipsideViewController.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// FlipsideViewController.m -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import "FlipsideViewController.h" - -@implementation FlipsideViewController - --(void)viewDidLoad -{ - [super viewDidLoad]; - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - if ( [UIColor respondsToSelector:@selector(viewFlipsideBackgroundColor)] ) { - self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor]; - } -#pragma clang diagnostic pop -} - -/* - * // Override to allow orientations other than the default portrait orientation. - * - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - * // Return YES for supported orientations - * return (interfaceOrientation == UIInterfaceOrientationPortrait); - * } - */ - --(void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview - // Release anything that's not essential, such as cached data -} - -@end diff --git a/examples/AAPLot/Classes/MainViewController.h b/examples/AAPLot/Classes/MainViewController.h deleted file mode 100644 index ef107f67a..000000000 --- a/examples/AAPLot/Classes/MainViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -#import "APYahooDataPuller.h" -#import "CorePlot-CocoaTouch.h" -#import - -@class CPTGraphHostingView; -@class APYahooDataPuller; -@class CPTXYGraph; - -@interface MainViewController : UIViewController - -@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *graphHost; - -@end diff --git a/examples/AAPLot/Classes/MainViewController.m b/examples/AAPLot/Classes/MainViewController.m deleted file mode 100644 index 1dd039670..000000000 --- a/examples/AAPLot/Classes/MainViewController.m +++ /dev/null @@ -1,674 +0,0 @@ -#import "APFinancialData.h" -#import "APYahooDataPuller.h" -#import "MainViewController.h" - -#define ROWS_FIRST_DATA_ORDER 1 - -@interface MainViewController() - -@property (nonatomic, readwrite, strong, nullable) CPTXYGraph *graph; -@property (nonatomic, readwrite, strong, nonnull) APYahooDataPuller *datapuller; - -@end - -@implementation MainViewController - -@synthesize graph; -@synthesize datapuller; -@synthesize graphHost; - --(void)setView:(UIView *)aView -{ - super.view = aView; - if ( nil == aView ) { - self.graph = nil; - self.graphHost = nil; - } -} - --(void)viewDidLoad -{ - CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:self.view.bounds]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTStocksTheme]; - - [newGraph applyTheme:theme]; - self.graph = newGraph; - - newGraph.paddingRight = 50.0; - newGraph.paddingLeft = 50.0; - newGraph.plotAreaFrame.masksToBorder = NO; - newGraph.plotAreaFrame.cornerRadius = 0.0; - - CPTMutableLineStyle *borderLineStyle = [CPTMutableLineStyle lineStyle]; - borderLineStyle.lineColor = [CPTColor whiteColor]; - borderLineStyle.lineWidth = 2.0; - newGraph.plotAreaFrame.borderLineStyle = borderLineStyle; - self.graphHost.hostedGraph = newGraph; - - // Axes - CPTXYAxisSet *xyAxisSet = (CPTXYAxisSet *)newGraph.axisSet; - CPTXYAxis *xAxis = xyAxisSet.xAxis; - CPTMutableLineStyle *lineStyle = [xAxis.axisLineStyle mutableCopy]; - lineStyle.lineCap = kCGLineCapButt; - xAxis.axisLineStyle = lineStyle; - xAxis.labelingPolicy = CPTAxisLabelingPolicyNone; - - CPTXYAxis *yAxis = xyAxisSet.yAxis; - yAxis.axisLineStyle = nil; - - // Line plot with gradient fill - CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] initWithFrame:newGraph.bounds]; - dataSourceLinePlot.identifier = @"Data Source Plot"; - dataSourceLinePlot.dataLineStyle = nil; - dataSourceLinePlot.dataSource = self; - dataSourceLinePlot.cachePrecision = CPTPlotCachePrecisionDouble; - [newGraph addPlot:dataSourceLinePlot]; - - CPTColor *areaColor = [CPTColor colorWithComponentRed:CPTFloat(1.0) green:CPTFloat(1.0) blue:CPTFloat(1.0) alpha:CPTFloat(0.6)]; - CPTGradient *areaGradient = [CPTGradient gradientWithBeginningColor:areaColor endingColor:[CPTColor clearColor]]; - areaGradient.angle = -90.0; - CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; - dataSourceLinePlot.areaFill = areaGradientFill; - dataSourceLinePlot.areaBaseValue = @200.0; - - areaColor = [CPTColor colorWithComponentRed:CPTFloat(0.0) green:CPTFloat(1.0) blue:CPTFloat(0.0) alpha:CPTFloat(0.6)]; - areaGradient = [CPTGradient gradientWithBeginningColor:[CPTColor clearColor] endingColor:areaColor]; - areaGradient.angle = -90.0; - areaGradientFill = [CPTFill fillWithGradient:areaGradient]; - dataSourceLinePlot.areaFill2 = areaGradientFill; - dataSourceLinePlot.areaBaseValue2 = @400.0; - - // OHLC plot - CPTMutableLineStyle *whiteLineStyle = [CPTMutableLineStyle lineStyle]; - whiteLineStyle.lineColor = [CPTColor whiteColor]; - whiteLineStyle.lineWidth = 1.0; - CPTTradingRangePlot *ohlcPlot = [[CPTTradingRangePlot alloc] initWithFrame:newGraph.bounds]; - ohlcPlot.identifier = @"OHLC"; - ohlcPlot.lineStyle = whiteLineStyle; - CPTMutableTextStyle *whiteTextStyle = [CPTMutableTextStyle textStyle]; - whiteTextStyle.color = [CPTColor whiteColor]; - whiteTextStyle.fontSize = 8.0; - ohlcPlot.labelTextStyle = whiteTextStyle; - ohlcPlot.labelOffset = 5.0; - ohlcPlot.stickLength = 2.0; - ohlcPlot.dataSource = self; - ohlcPlot.plotStyle = CPTTradingRangePlotStyleOHLC; - ohlcPlot.cachePrecision = CPTPlotCachePrecisionDecimal; - [newGraph addPlot:ohlcPlot]; - - // Add plot space for bar chart - CPTXYPlotSpace *volumePlotSpace = [[CPTXYPlotSpace alloc] init]; - volumePlotSpace.identifier = @"Volume Plot Space"; - [newGraph addPlotSpace:volumePlotSpace]; - - // Volume plot - CPTBarPlot *volumePlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor blackColor] horizontalBars:NO]; - volumePlot.dataSource = self; - - lineStyle = [volumePlot.lineStyle mutableCopy]; - lineStyle.lineColor = [CPTColor whiteColor]; - volumePlot.lineStyle = lineStyle; - - volumePlot.fill = nil; - volumePlot.barWidth = @1.0; - volumePlot.identifier = @"Volume Plot"; - volumePlot.cachePrecision = CPTPlotCachePrecisionDouble; - [newGraph addPlot:volumePlot toPlotSpace:volumePlotSpace]; - - // Data puller - NSDate *start = [NSDate dateWithTimeIntervalSinceNow:-60.0 * 60.0 * 24.0 * 7.0 * 12.0]; // 12 weeks ago - NSDate *end = [NSDate date]; - APYahooDataPuller *dp = [[APYahooDataPuller alloc] initWithTargetSymbol:@"AAPL" targetStartDate:start targetEndDate:end]; - self.datapuller = dp; - dp.delegate = self; - - [super viewDidLoad]; -} - --(nonnull instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil -{ - if ( (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) ) { - } - return self; -} - -#pragma mark - -#pragma mark Plot Data Source Methods - --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot -{ - return self.datapuller.financialData.count; -} - -#if ROWS_FIRST_DATA_ORDER - --(nullable CPTNumericData *)dataForPlot:(nonnull CPTPlot *)plot recordIndexRange:(NSRange)indexRange -{ - CPTFinancialDataArray financialData = self.datapuller.financialData; - const NSUInteger financialDataCount = financialData.count; - - const BOOL useDoubles = plot.doublePrecisionCache; - - NSUInteger numFields = plot.numberOfFields; - - if ( [plot.identifier isEqual:@"Volume Plot"] ) { - numFields = 2; - } - - NSMutableData *data = [[NSMutableData alloc] initWithLength:indexRange.length * numFields * ( useDoubles ? sizeof(double) : sizeof(NSDecimal) )]; - - const NSUInteger maxIndex = NSMaxRange(indexRange); - - if ( [plot.identifier isEqual:@"Data Source Plot"] ) { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTScatterPlotFieldX: - *nextValue++ = (double)(i + 1); - break; - - case CPTScatterPlotFieldY: - value = fData[@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = value.doubleValue; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTScatterPlotFieldX: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTScatterPlotFieldY: - value = fData[@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = value.decimalValue; - break; - - default: - break; - } - } - } - } - } - else if ( [plot.identifier isEqual:@"Volume Plot"] ) { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTBarPlotFieldBarLocation: - *nextValue++ = (double)(i + 1); - break; - - case CPTBarPlotFieldBarTip: - value = fData[@"volume"]; - NSAssert(value, @"Volume value was nil"); - *nextValue++ = value.doubleValue; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTBarPlotFieldBarLocation: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTBarPlotFieldBarTip: - value = fData[@"volume"]; - NSAssert(value, @"Volume value was nil"); - *nextValue++ = value.decimalValue; - break; - - default: - break; - } - } - } - } - } - else { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTTradingRangePlotFieldX: - *nextValue++ = (double)(i + 1); - break; - - case CPTTradingRangePlotFieldOpen: - value = fData[@"open"]; - NSAssert(value, @"Open value was nil"); - *nextValue++ = value.doubleValue; - break; - - case CPTTradingRangePlotFieldHigh: - value = fData[@"high"]; - NSAssert(value, @"High value was nil"); - *nextValue++ = value.doubleValue; - break; - - case CPTTradingRangePlotFieldLow: - value = fData[@"low"]; - NSAssert(value, @"Low value was nil"); - *nextValue++ = value.doubleValue; - break; - - case CPTTradingRangePlotFieldClose: - value = fData[@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = value.doubleValue; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTTradingRangePlotFieldX: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTTradingRangePlotFieldOpen: - value = fData[@"open"]; - NSAssert(value, @"Open value was nil"); - *nextValue++ = value.decimalValue; - break; - - case CPTTradingRangePlotFieldHigh: - value = fData[@"high"]; - NSAssert(value, @"High value was nil"); - *nextValue++ = value.decimalValue; - break; - - case CPTTradingRangePlotFieldLow: - value = fData[@"low"]; - NSAssert(value, @"Low value was nil"); - *nextValue++ = value.decimalValue; - break; - - case CPTTradingRangePlotFieldClose: - value = fData[@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = value.decimalValue; - break; - - default: - break; - } - } - } - } - } - - CPTMutableNumericData *numericData = [CPTMutableNumericData numericDataWithData:data - dataType:(useDoubles ? plot.doubleDataType : plot.decimalDataType) - shape:@[@(indexRange.length), - @(numFields)] - dataOrder:CPTDataOrderRowsFirst]; - - return numericData; -} - -#else - --(nullable CPTNumericData *)dataForPlot:(nonnull CPTPlot *)plot recordIndexRange:(NSRange)indexRange -{ - CPTFinancialDataArray financialData = self.datapuller.financialData; - const NSUInteger financialDataCount = financialData.count; - - const BOOL useDoubles = plot.doublePrecisionCache; - - NSUInteger numFields = plot.numberOfFields; - - if ( [plot.identifier isEqual:@"Volume Plot"] ) { - numFields = 2; - } - - NSMutableData *data = [[NSMutableData alloc] initWithLength:indexRange.length * numFields * ( useDoubles ? sizeof(double) : sizeof(NSDecimal) )]; - - const NSUInteger maxIndex = NSMaxRange(indexRange); - - if ( [plot.identifier isEqual:@"Data Source Plot"] ) { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = (CPTDictionary)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTScatterPlotFieldX: - *nextValue++ = (double)(i + 1); - break; - - case CPTScatterPlotFieldY: - value = [fData objectForKey:@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value doubleValue]; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = (CPTDictionary)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTScatterPlotFieldX: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTScatterPlotFieldY: - value = [fData objectForKey:@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value decimalValue]; - break; - - default: - break; - } - } - } - } - } - else if ( [plot.identifier isEqual:@"Volume Plot"] ) { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = (CPTDictionary)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTBarPlotFieldBarLocation: - *nextValue++ = (double)(i + 1); - break; - - case CPTBarPlotFieldBarTip: - value = [fData objectForKey:@"volume"]; - NSAssert(value, @"Volume value was nil"); - *nextValue++ = [value doubleValue]; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = (CPTDictionary)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTBarPlotFieldBarLocation: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTBarPlotFieldBarTip: - value = [fData objectForKey:@"volume"]; - NSAssert(value, @"Volume value was nil"); - *nextValue++ = [value decimalValue]; - break; - - default: - break; - } - } - } - } - } - else { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = (CPTDictionary)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTTradingRangePlotFieldX: - *nextValue++ = (double)(i + 1); - break; - - case CPTTradingRangePlotFieldOpen: - value = [fData objectForKey:@"open"]; - NSAssert(value, @"Open value was nil"); - *nextValue++ = [value doubleValue]; - break; - - case CPTTradingRangePlotFieldHigh: - value = [fData objectForKey:@"high"]; - NSAssert(value, @"High value was nil"); - *nextValue++ = [value doubleValue]; - break; - - case CPTTradingRangePlotFieldLow: - value = [fData objectForKey:@"low"]; - NSAssert(value, @"Low value was nil"); - *nextValue++ = [value doubleValue]; - break; - - case CPTTradingRangePlotFieldClose: - value = [fData objectForKey:@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value doubleValue]; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - CPTDictionary fData = (CPTDictionary)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTTradingRangePlotFieldX: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTTradingRangePlotFieldOpen: - value = [fData objectForKey:@"open"]; - NSAssert(value, @"Open value was nil"); - *nextValue++ = [value decimalValue]; - break; - - case CPTTradingRangePlotFieldHigh: - value = [fData objectForKey:@"high"]; - NSAssert(value, @"High value was nil"); - *nextValue++ = [value decimalValue]; - break; - - case CPTTradingRangePlotFieldLow: - value = [fData objectForKey:@"low"]; - NSAssert(value, @"Low value was nil"); - *nextValue++ = [value decimalValue]; - break; - - case CPTTradingRangePlotFieldClose: - value = [fData objectForKey:@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value decimalValue]; - break; - - default: - break; - } - } - } - } - } - - CPTMutableNumericData *numericData = [CPTMutableNumericData numericDataWithData:data - dataType:(useDoubles ? plot.doubleDataType : plot.decimalDataType) - shape:@[@(indexRange.length), @(numFields)] - dataOrder:CPTDataOrderColumnsFirst]; - [data release]; - - return numericData; -} -#endif - --(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUInteger)index -{ - if ( ![(NSString *) plot.identifier isEqualToString:@"OHLC"] ) { - return (id)[NSNull null]; // Don't show any label - } - else if ( index % 5 ) { - return (id)[NSNull null]; - } - else { - return nil; // Use default label style - } -} - --(void)dataPullerDidFinishFetch:(nonnull APYahooDataPuller *)dp -{ - static CPTAnimationOperation *animationOperation = nil; - - CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; - CPTXYPlotSpace *volumePlotSpace = (CPTXYPlotSpace *)[self.graph plotSpaceWithIdentifier:@"Volume Plot Space"]; - - APYahooDataPuller *thePuller = self.datapuller; - - NSDecimalNumber *high = thePuller.overallHigh; - NSDecimalNumber *low = thePuller.overallLow; - NSDecimalNumber *length = [high decimalNumberBySubtracting:low]; - - NSLog(@"high = %@, low = %@, length = %@", high, low, length); - NSDecimalNumber *pricePlotSpaceDisplacementPercent = [NSDecimalNumber decimalNumberWithMantissa:33 - exponent:-2 - isNegative:NO]; - - NSDecimalNumber *lengthDisplacementValue = [length decimalNumberByMultiplyingBy:pricePlotSpaceDisplacementPercent]; - NSDecimalNumber *lowDisplayLocation = [low decimalNumberBySubtracting:lengthDisplacementValue]; - NSDecimalNumber *lengthDisplayLocation = [length decimalNumberByAdding:lengthDisplacementValue]; - - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(thePuller.financialData.count + 1)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:lowDisplayLocation length:lengthDisplayLocation]; - - CPTScatterPlot *linePlot = (CPTScatterPlot *)[self.graph plotWithIdentifier:@"Data Source Plot"]; - linePlot.areaBaseValue = high; - linePlot.areaBaseValue2 = low; - - // Axes - CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.graph.axisSet; - - NSDecimalNumber *overallVolumeHigh = thePuller.overallVolumeHigh; - NSDecimalNumber *overallVolumeLow = thePuller.overallVolumeLow; - NSDecimalNumber *volumeLength = [overallVolumeHigh decimalNumberBySubtracting:overallVolumeLow]; - - // make the length aka height for y 3 times more so that we get a 1/3 area covered by volume - NSDecimalNumber *volumePlotSpaceDisplacementPercent = [NSDecimalNumber decimalNumberWithMantissa:3 - exponent:0 - isNegative:NO]; - - NSDecimalNumber *volumeLengthDisplacementValue = [volumeLength decimalNumberByMultiplyingBy:volumePlotSpaceDisplacementPercent]; - NSDecimalNumber *volumeLowDisplayLocation = overallVolumeLow; - NSDecimalNumber *volumeLengthDisplayLocation = [volumeLength decimalNumberByAdding:volumeLengthDisplacementValue]; - - volumePlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(thePuller.financialData.count + 1)]; - - if ( animationOperation ) { - [[CPTAnimation sharedInstance] removeAnimationOperation:animationOperation]; - } - - if ( volumeLowDisplayLocation && volumeLengthDisplayLocation ) { - animationOperation = [CPTAnimation animate:volumePlotSpace - property:@"yRange" - fromPlotRange:[CPTPlotRange plotRangeWithLocationDecimal:volumeLowDisplayLocation.decimalValue - lengthDecimal:CPTDecimalMultiply( volumeLengthDisplayLocation.decimalValue, CPTDecimalFromInteger(10) )] - toPlotRange:[CPTPlotRange plotRangeWithLocation:volumeLowDisplayLocation - length:volumeLengthDisplayLocation] - duration:2.5]; - } - else { - volumePlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:volumeLowDisplayLocation length:volumeLengthDisplayLocation]; - } - - axisSet.xAxis.orthogonalPosition = low; - axisSet.yAxis.majorIntervalLength = @50.0; - axisSet.yAxis.minorTicksPerInterval = 4; - axisSet.yAxis.orthogonalPosition = @1.0; - CPTPlotRangeArray exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@0.0 length:low]]; - - axisSet.yAxis.labelExclusionRanges = exclusionRanges; - - [self.graph reloadData]; -} - -@end diff --git a/examples/AAPLot/Classes/RootViewController.h b/examples/AAPLot/Classes/RootViewController.h deleted file mode 100644 index 0c2f2d472..000000000 --- a/examples/AAPLot/Classes/RootViewController.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// RootViewController.h -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import - -@class MainViewController; -@class FlipsideViewController; - -@interface RootViewController : UIViewController - -@property (nonatomic, strong, nullable) IBOutlet UIButton *infoButton; -@property (nonatomic, strong, nonnull) MainViewController *mainViewController; -@property (nonatomic, strong, nonnull) UINavigationBar *flipsideNavigationBar; -@property (nonatomic, strong, nonnull) FlipsideViewController *flipsideViewController; - --(IBAction)toggleView; - -@end diff --git a/examples/AAPLot/Classes/RootViewController.m b/examples/AAPLot/Classes/RootViewController.m deleted file mode 100644 index 9f53bd403..000000000 --- a/examples/AAPLot/Classes/RootViewController.m +++ /dev/null @@ -1,112 +0,0 @@ -// -// RootViewController.m -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import "FlipsideViewController.h" -#import "MainViewController.h" -#import "RootViewController.h" - -@implementation RootViewController - -@synthesize infoButton; -@synthesize flipsideNavigationBar; -@synthesize mainViewController; -@synthesize flipsideViewController; - --(void)viewDidLoad -{ - [super viewDidLoad]; - MainViewController *viewController = [[MainViewController alloc] initWithNibName:@"MainView" bundle:nil]; - self.mainViewController = viewController; - - UIButton *button = self.infoButton; - if ( button ) { - [self.view insertSubview:viewController.view belowSubview:button]; - } - self.mainViewController.view.frame = self.view.bounds; -} - --(void)loadFlipsideViewController -{ - FlipsideViewController *viewController = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil]; - - self.flipsideViewController = viewController; - - self.flipsideViewController.view.frame = self.view.bounds; - - // Set up the navigation bar - UINavigationBar *aNavigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 44.0)]; - aNavigationBar.barStyle = UIBarStyleBlackOpaque; - self.flipsideNavigationBar = aNavigationBar; - - UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone - target:self - action:@selector(toggleView)]; - UINavigationItem *navigationItem = [[UINavigationItem alloc] initWithTitle:@"AAPLot"]; - navigationItem.rightBarButtonItem = buttonItem; - [self.flipsideNavigationBar pushNavigationItem:navigationItem animated:NO]; -} - --(IBAction)toggleView -{ - /* - * This method is called when the info or Done button is pressed. - * It flips the displayed view from the main view to the flipside view and vice-versa. - */ - if ( self.flipsideViewController == nil ) { - [self loadFlipsideViewController]; - } - - UIView *mainView = self.mainViewController.view; - UIView *flipsideView = self.flipsideViewController.view; - - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationDuration:1]; - UIViewAnimationTransition transition = (mainView.superview ? UIViewAnimationTransitionFlipFromRight : UIViewAnimationTransitionFlipFromLeft); - [UIView setAnimationTransition:transition forView:self.view cache:YES]; - - if ( mainView.superview != nil ) { - [self.flipsideViewController viewWillAppear:YES]; - [self.mainViewController viewWillDisappear:YES]; - [mainView removeFromSuperview]; - [self.infoButton removeFromSuperview]; - [self.view addSubview:flipsideView]; - [self.view insertSubview:self.flipsideNavigationBar aboveSubview:flipsideView]; - [self.mainViewController viewDidDisappear:YES]; - [self.flipsideViewController viewDidAppear:YES]; - } - else { - [self.mainViewController viewWillAppear:YES]; - [self.flipsideViewController viewWillDisappear:YES]; - [flipsideView removeFromSuperview]; - [self.flipsideNavigationBar removeFromSuperview]; - [self.view addSubview:mainView]; - UIButton *button = self.infoButton; - if ( button ) { - [self.view insertSubview:button aboveSubview:self.mainViewController.view]; - } - [self.flipsideViewController viewDidDisappear:YES]; - [self.mainViewController viewDidAppear:YES]; - } - [UIView commitAnimations]; -} - -/* - * // Override to allow orientations other than the default portrait orientation. - * - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - * // Return YES for supported orientations - * return (interfaceOrientation == UIInterfaceOrientationPortrait); - * } - */ - --(void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview - // Release anything that's not essential, such as cached data -} - -@end diff --git a/examples/AAPLot/FlipsideView.xib b/examples/AAPLot/FlipsideView.xib deleted file mode 100644 index 165ced2e7..000000000 --- a/examples/AAPLot/FlipsideView.xib +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/AAPLot/Launch Screen.xib b/examples/AAPLot/Launch Screen.xib deleted file mode 100644 index f8672842a..000000000 --- a/examples/AAPLot/Launch Screen.xib +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/AAPLot/MainView.xib b/examples/AAPLot/MainView.xib deleted file mode 100644 index e968aa1ef..000000000 --- a/examples/AAPLot/MainView.xib +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/AAPLot/MainWindow.xib b/examples/AAPLot/MainWindow.xib deleted file mode 100644 index 182fe85d1..000000000 --- a/examples/AAPLot/MainWindow.xib +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/AAPLot/NSDateFormatterExtensions.h b/examples/AAPLot/NSDateFormatterExtensions.h deleted file mode 100644 index 380cd36e4..000000000 --- a/examples/AAPLot/NSDateFormatterExtensions.h +++ /dev/null @@ -1,7 +0,0 @@ -#import - -@interface NSDateFormatter(APExtensions) - -+(nonnull NSDateFormatter *)csvDateFormatter; - -@end diff --git a/examples/AAPLot/NSDateFormatterExtensions.m b/examples/AAPLot/NSDateFormatterExtensions.m deleted file mode 100644 index 53e754d36..000000000 --- a/examples/AAPLot/NSDateFormatterExtensions.m +++ /dev/null @@ -1,18 +0,0 @@ -#import "NSDateFormatterExtensions.h" - -@implementation NSDateFormatter(APExtensions) - -+(nonnull NSDateFormatter *)csvDateFormatter -{ - static NSDateFormatter *df = nil; - static dispatch_once_t onceToken = 0; - - dispatch_once(&onceToken, ^{ - df = [[NSDateFormatter alloc] init]; - df.dateFormat = @"yyyy-MM-dd"; - }); - - return df; -} - -@end diff --git a/examples/AAPLot/main.m b/examples/AAPLot/main.m deleted file mode 100644 index 9098265c6..000000000 --- a/examples/AAPLot/main.m +++ /dev/null @@ -1,10 +0,0 @@ -#import - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - int retVal = UIApplicationMain(argc, argv, nil, nil); - - return retVal; - } -} diff --git a/examples/CPTTestApp-iPad/CPTTestApp_iPad-Info.plist b/examples/CPTTestApp-iPad/Base.lproj/CPTTestApp_iPad-Info.plist similarity index 95% rename from examples/CPTTestApp-iPad/CPTTestApp_iPad-Info.plist rename to examples/CPTTestApp-iPad/Base.lproj/CPTTestApp_iPad-Info.plist index f0cf9adbd..65b56f8c5 100644 --- a/examples/CPTTestApp-iPad/CPTTestApp_iPad-Info.plist +++ b/examples/CPTTestApp-iPad/Base.lproj/CPTTestApp_iPad-Info.plist @@ -18,6 +18,8 @@ ${PRODUCT_NAME} CFBundlePackageType APPL + CFBundleShortVersionString + 1.0 CFBundleSignature ???? CFBundleVersion diff --git a/examples/CPTTestApp-iPad/CPTTestApp_iPadViewController.xib b/examples/CPTTestApp-iPad/Base.lproj/CPTTestApp_iPadViewController.xib similarity index 100% rename from examples/CPTTestApp-iPad/CPTTestApp_iPadViewController.xib rename to examples/CPTTestApp-iPad/Base.lproj/CPTTestApp_iPadViewController.xib diff --git a/examples/CPTTestApp-iPad/Launch Screen.xib b/examples/CPTTestApp-iPad/Base.lproj/Launch Screen.xib similarity index 66% rename from examples/CPTTestApp-iPad/Launch Screen.xib rename to examples/CPTTestApp-iPad/Base.lproj/Launch Screen.xib index 31b1b876d..84090add7 100644 --- a/examples/CPTTestApp-iPad/Launch Screen.xib +++ b/examples/CPTTestApp-iPad/Base.lproj/Launch Screen.xib @@ -1,8 +1,12 @@ - - + + + + + - - + + + @@ -11,14 +15,14 @@ - - + diff --git a/examples/CPTTestApp-iPad/MainWindow.xib b/examples/CPTTestApp-iPad/Base.lproj/MainWindow.xib similarity index 100% rename from examples/CPTTestApp-iPad/MainWindow.xib rename to examples/CPTTestApp-iPad/Base.lproj/MainWindow.xib diff --git a/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/project.pbxproj b/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/project.pbxproj index c9104df7c..afd032e09 100644 --- a/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/project.pbxproj +++ b/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/project.pbxproj @@ -12,12 +12,11 @@ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; - 2899E5220DE3E06400AC0155 /* CPTTestApp_iPadViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* CPTTestApp_iPadViewController.xib */; }; - 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 28D7ACF80DDB3853001CB0EB /* CPTTestApp_iPadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* CPTTestApp_iPadViewController.m */; }; BC65758F116549890008F594 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC65758E116549890008F594 /* QuartzCore.framework */; }; - C34677AE19F3341700429A85 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C34677AD19F3341700429A85 /* Launch Screen.xib */; }; - C3CD283917DE9C59008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD283817DE9C59008EED1E /* Accelerate.framework */; }; + C3D0A1F520E019BF00BA2921 /* CPTTestApp_iPadViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1F720E019BF00BA2921 /* CPTTestApp_iPadViewController.xib */; }; + C3D0A20620E019CD00BA2921 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A20820E019CD00BA2921 /* MainWindow.xib */; }; + C3D0A20920E019D400BA2921 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A20B20E019D400BA2921 /* Launch Screen.xib */; }; C3D3936019FD670400148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3935F19FD670400148319 /* Images.xcassets */; }; C3D414AD1A7D844400B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3D414AA1A7D843800B6F5D6 /* libCorePlot-CocoaTouch.a */; }; C3F47B6E17BF99DE0075181F /* CorePlotIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = C3F47B6C17BF99DE0075181F /* CorePlotIcon.png */; }; @@ -25,6 +24,20 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + C31D01E01D10F4FF008C1EF2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C31D01E21D10F4FF008C1EF2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; C3D414A11A7D843800B6F5D6 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; @@ -76,17 +89,17 @@ 1D6058910D05DD3D006BFB54 /* CPTTestApp-iPad.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CPTTestApp-iPad.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 2899E5210DE3E06400AC0155 /* CPTTestApp_iPadViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CPTTestApp_iPadViewController.xib; sourceTree = ""; }; - 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 28D7ACF60DDB3853001CB0EB /* CPTTestApp_iPadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTTestApp_iPadViewController.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 28D7ACF70DDB3853001CB0EB /* CPTTestApp_iPadViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTTestApp_iPadViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* CPTTestApp_iPad_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestApp_iPad_Prefix.pch; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* CPTTestApp_iPad-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "CPTTestApp_iPad-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; BC65758E116549890008F594 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - C34677AD19F3341700429A85 /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; }; C36E7CC519DE1C1F00EDEACB /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C37A40E120E0320500C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CPTTestApp_iPad-Info.plist"; sourceTree = ""; }; C3CD283817DE9C59008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; + C3D0A20520E019C900BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/CPTTestApp_iPadViewController.xib; sourceTree = ""; }; + C3D0A20720E019CD00BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainWindow.xib; sourceTree = ""; }; + C3D0A20A20E019D400BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Base.lproj/Launch Screen.xib"; sourceTree = ""; }; C3D3935F19FD670400148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "CPTTestApp-iPad/Images.xcassets"; sourceTree = ""; }; C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = ""; }; C3F47B6C17BF99DE0075181F /* CorePlotIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CorePlotIcon.png; sourceTree = ""; }; @@ -102,7 +115,6 @@ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, BC65758F116549890008F594 /* QuartzCore.framework in Frameworks */, - C3CD283917DE9C59008EED1E /* Accelerate.framework in Frameworks */, C3D414AD1A7D844400B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -159,12 +171,12 @@ isa = PBXGroup; children = ( C3D3935F19FD670400148319 /* Images.xcassets */, - 2899E5210DE3E06400AC0155 /* CPTTestApp_iPadViewController.xib */, - 28AD733E0D9D9553002E5188 /* MainWindow.xib */, - C34677AD19F3341700429A85 /* Launch Screen.xib */, + C3D0A1F720E019BF00BA2921 /* CPTTestApp_iPadViewController.xib */, + C3D0A20820E019CD00BA2921 /* MainWindow.xib */, + C3D0A20B20E019D400BA2921 /* Launch Screen.xib */, C3F47B6C17BF99DE0075181F /* CorePlotIcon.png */, C3F47B6D17BF99DE0075181F /* CorePlotIcon@2x.png */, - 8D1107310486CEB800E47090 /* CPTTestApp_iPad-Info.plist */, + C37A40E220E0320500C4FF48 /* CPTTestApp_iPad-Info.plist */, ); name = Resources; sourceTree = ""; @@ -190,6 +202,8 @@ C3D414A81A7D843800B6F5D6 /* UnitTests iOS.xctest */, C3D414AA1A7D843800B6F5D6 /* libCorePlot-CocoaTouch.a */, C3D414AC1A7D843800B6F5D6 /* CorePlot-CocoaTouchTests.xctest */, + C31D01E11D10F4FF008C1EF2 /* CorePlot.framework */, + C31D01E31D10F4FF008C1EF2 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -220,17 +234,23 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0900; + TargetAttributes = { + 1D6058900D05DD3D006BFB54 = { + DevelopmentTeam = 28ZA45DE7D; + }; + }; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CPTTestApp-iPad" */; compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + ja, + en, + de, + fr, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; projectDirPath = ""; @@ -248,6 +268,20 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + C31D01E11D10F4FF008C1EF2 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C31D01E01D10F4FF008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C31D01E31D10F4FF008C1EF2 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C31D01E21D10F4FF008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; C3D414A21A7D843800B6F5D6 /* CorePlot.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -297,12 +331,12 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, - 2899E5220DE3E06400AC0155 /* CPTTestApp_iPadViewController.xib in Resources */, + C3D0A20620E019CD00BA2921 /* MainWindow.xib in Resources */, + C3D0A1F520E019BF00BA2921 /* CPTTestApp_iPadViewController.xib in Resources */, C3F47B6E17BF99DE0075181F /* CorePlotIcon.png in Resources */, C3D3936019FD670400148319 /* Images.xcassets in Resources */, C3F47B6F17BF99DE0075181F /* CorePlotIcon@2x.png in Resources */, - C34677AE19F3341700429A85 /* Launch Screen.xib in Resources */, + C3D0A20920E019D400BA2921 /* Launch Screen.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -321,6 +355,41 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXVariantGroup section */ + C37A40E220E0320500C4FF48 /* CPTTestApp_iPad-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A40E120E0320500C4FF48 /* Base */, + ); + name = "CPTTestApp_iPad-Info.plist"; + sourceTree = ""; + }; + C3D0A1F720E019BF00BA2921 /* CPTTestApp_iPadViewController.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A20520E019C900BA2921 /* Base */, + ); + name = CPTTestApp_iPadViewController.xib; + sourceTree = ""; + }; + C3D0A20820E019CD00BA2921 /* MainWindow.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A20720E019CD00BA2921 /* Base */, + ); + name = MainWindow.xib; + sourceTree = ""; + }; + C3D0A20B20E019D400BA2921 /* Launch Screen.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A20A20E019D400BA2921 /* Base */, + ); + name = "Launch Screen.xib"; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ 1D6058940D05DD3E006BFB54 /* Debug */ = { isa = XCBuildConfiguration; @@ -333,12 +402,12 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + DEVELOPMENT_TEAM = 28ZA45DE7D; GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_iPad_Prefix.pch; HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = "CPTTestApp_iPad-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/CPTTestApp_iPad-Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.CPTTestAppiPad; PRODUCT_NAME = "CPTTestApp-iPad"; }; @@ -355,10 +424,11 @@ CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Distribution"; COPY_PHASE_STRIP = YES; + DEVELOPMENT_TEAM = 28ZA45DE7D; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_iPad_Prefix.pch; HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = "CPTTestApp_iPad-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/CPTTestApp_iPad-Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.CPTTestAppiPad; PRODUCT_NAME = "CPTTestApp-iPad"; VALIDATE_PRODUCT = YES; @@ -367,14 +437,16 @@ }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C36E7CC519DE1C1F00EDEACB /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", @@ -383,19 +455,21 @@ SDKROOT = iphoneos; SYMROOT = "$(SRCROOT)/../../build"; TARGETED_DEVICE_FAMILY = 2; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\" \"${PROJECT_DIR}/../../framework/Source\" \"${PROJECT_DIR}/../../framework/iPhoneOnly\""; }; name = Debug; }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C36E7CC519DE1C1F00EDEACB /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = ( "-ObjC", @@ -404,7 +478,7 @@ SDKROOT = iphoneos; SYMROOT = "$(SRCROOT)/../../build"; TARGETED_DEVICE_FAMILY = 2; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\" \"${PROJECT_DIR}/../../framework/Source\" \"${PROJECT_DIR}/../../framework/iPhoneOnly\""; }; name = Release; }; diff --git a/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPad.xcscheme b/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPad.xcscheme index 5b1f80c15..8ee44490d 100644 --- a/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPad.xcscheme +++ b/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPad.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "YES"> - - - - + + - - -@interface CPTTestApp_iPadViewController : UIViewController +@interface CPTTestApp_iPadViewController : UIViewController -@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray dataForChart; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *dataForChart; @property (nonatomic, readwrite, strong, nonnull) NSArray *dataForPlot; // Plot construction methods diff --git a/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.m b/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.m index b30d7bf03..4312843d4 100644 --- a/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.m +++ b/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.m @@ -70,7 +70,7 @@ -(void)viewDidAppear:(BOOL)animated self.piePlotIsRotating = YES; } --(void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag +-(void)animationDidStop:(CAAnimation *__unused)theAnimation finished:(BOOL __unused)flag { self.piePlotIsRotating = NO; [self.piePlot performSelector:@selector(reloadData) withObject:nil afterDelay:0.4]; @@ -106,9 +106,9 @@ -(void)constructScatterPlot x.majorIntervalLength = @0.5; x.orthogonalPosition = @2.0; x.minorTicksPerInterval = 2; - CPTPlotRangeArray exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], - [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], - [CPTPlotRange plotRangeWithLocation:@2.99 length:@0.02]]; + CPTPlotRangeArray *exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@2.99 length:@0.02]]; x.labelExclusionRanges = exclusionRanges; CPTXYAxis *y = axisSet.yAxis; @@ -195,7 +195,7 @@ -(void)constructScatterPlot -(void)constructBarChart { - // Create barChart from theme +// Create barChart from theme CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; @@ -211,7 +211,7 @@ -(void)constructBarChart newGraph.paddingRight = 20.0; newGraph.paddingBottom = 80.0; - // Add plot space for horizontal bar charts +// Add plot space for horizontal bar charts CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@300.0]; plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@16.0]; @@ -227,13 +227,13 @@ -(void)constructBarChart x.titleLocation = @7.5; x.titleOffset = 55.0; - // Define some custom labels for the data elements +// Define some custom labels for the data elements x.labelRotation = CPTFloat(M_PI_4); x.labelingPolicy = CPTAxisLabelingPolicyNone; - CPTNumberArray customTickLocations = @[@1, @5, @10, @15]; - CPTStringArray xAxisLabels = @[@"Label A", @"Label B", @"Label C", @"Label D"]; - NSUInteger labelLocation = 0; - CPTMutableAxisLabelSet customLabels = [NSMutableSet setWithCapacity:xAxisLabels.count]; + CPTNumberArray *customTickLocations = @[@1, @5, @10, @15]; + CPTStringArray *xAxisLabels = @[@"Label A", @"Label B", @"Label C", @"Label D"]; + NSUInteger labelLocation = 0; + CPTMutableAxisLabelSet *customLabels = [NSMutableSet setWithCapacity:xAxisLabels.count]; for ( NSNumber *tickLocation in customTickLocations ) { CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithText:xAxisLabels[labelLocation++] textStyle:x.labelTextStyle]; newLabel.tickLocation = tickLocation; @@ -254,7 +254,7 @@ -(void)constructBarChart y.titleOffset = 45.0; y.titleLocation = @150.0; - // First bar plot +// First bar plot CPTBarPlot *barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor darkGrayColor] horizontalBars:NO]; barPlot.baseValue = @0.0; barPlot.dataSource = self; @@ -262,7 +262,7 @@ -(void)constructBarChart barPlot.identifier = @"Bar Plot 1"; [newGraph addPlot:barPlot toPlotSpace:plotSpace]; - // Second bar plot +// Second bar plot barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor blueColor] horizontalBars:NO]; barPlot.dataSource = self; barPlot.baseValue = @0.0; @@ -275,7 +275,7 @@ -(void)constructBarChart -(void)constructPieChart { - // Create pieChart from theme +// Create pieChart from theme CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; @@ -293,14 +293,14 @@ -(void)constructPieChart newGraph.axisSet = nil; - // Prepare a radial overlay gradient for shading/gloss +// Prepare a radial overlay gradient for shading/gloss CPTGradient *overlayGradient = [[CPTGradient alloc] init]; overlayGradient.gradientType = CPTGradientTypeRadial; overlayGradient = [overlayGradient addColorStop:[[CPTColor blackColor] colorWithAlphaComponent:CPTFloat(0.0)] atPosition:CPTFloat(0.0)]; overlayGradient = [overlayGradient addColorStop:[[CPTColor blackColor] colorWithAlphaComponent:CPTFloat(0.3)] atPosition:CPTFloat(0.9)]; overlayGradient = [overlayGradient addColorStop:[[CPTColor blackColor] colorWithAlphaComponent:CPTFloat(0.7)] atPosition:CPTFloat(1.0)]; - // Add pie chart +// Add pie chart CPTPieChart *newPlot = [[CPTPieChart alloc] init]; newPlot.dataSource = self; newPlot.pieRadius = 130.0; @@ -313,14 +313,14 @@ -(void)constructPieChart [newGraph addPlot:newPlot]; self.piePlot = newPlot; - // Add some initial data +// Add some initial data self.dataForChart = @[@20.0, @30.0, @(NAN), @60.0]; } #pragma mark - #pragma mark CPTBarPlot delegate method --(void)barPlot:(nonnull CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index +-(void)barPlot:(nonnull CPTBarPlot *__unused)plot barWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"barWasSelectedAtRecordIndex %lu", (unsigned long)index); } @@ -373,7 +373,7 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum num = @(NAN); } else { - num = @( (index + 1) * (index + 1) ); + num = @((index + 1) * (index + 1)); if ( [plot.identifier isEqual:@"Bar Plot 2"] ) { num = @(num.integerValue - 10); } @@ -385,7 +385,7 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum if ( index % 8 ) { NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); num = self.dataForPlot[index][key]; - // Green plot gets shifted above the blue +// Green plot gets shifted above the blue if ( [(NSString *) plot.identifier isEqualToString:@"Green Plot"] ) { if ( fieldEnum == CPTScatterPlotFieldY ) { num = @(num.doubleValue + 1.0); @@ -410,7 +410,7 @@ -(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUI static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - whiteText = [[CPTMutableTextStyle alloc] init]; + whiteText = [[CPTMutableTextStyle alloc] init]; whiteText.color = [CPTColor whiteColor]; }); diff --git a/examples/CPTTestApp-iPhone/BarChart.xib b/examples/CPTTestApp-iPhone/BarChart.xib deleted file mode 100644 index 08a16b67e..000000000 --- a/examples/CPTTestApp-iPhone/BarChart.xib +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/CPTTestApp-iPhone/Base.lproj/BarChart.xib b/examples/CPTTestApp-iPhone/Base.lproj/BarChart.xib new file mode 100644 index 000000000..646ef95c3 --- /dev/null +++ b/examples/CPTTestApp-iPhone/Base.lproj/BarChart.xib @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp-iPhone/Info.plist b/examples/CPTTestApp-iPhone/Base.lproj/Info.plist similarity index 95% rename from examples/CPTTestApp-iPhone/Info.plist rename to examples/CPTTestApp-iPhone/Base.lproj/Info.plist index 5e25306a4..3f5c82874 100644 --- a/examples/CPTTestApp-iPhone/Info.plist +++ b/examples/CPTTestApp-iPhone/Base.lproj/Info.plist @@ -18,6 +18,8 @@ ${PRODUCT_NAME} CFBundlePackageType APPL + CFBundleShortVersionString + 1.0 CFBundleSignature ???? CFBundleVersion diff --git a/examples/CPTTestApp-iPhone/Launch Screen.xib b/examples/CPTTestApp-iPhone/Base.lproj/Launch Screen.xib similarity index 66% rename from examples/CPTTestApp-iPhone/Launch Screen.xib rename to examples/CPTTestApp-iPhone/Base.lproj/Launch Screen.xib index 4529d82e3..b51d6d522 100644 --- a/examples/CPTTestApp-iPhone/Launch Screen.xib +++ b/examples/CPTTestApp-iPhone/Base.lproj/Launch Screen.xib @@ -1,8 +1,12 @@ - - + + + + + - - + + + @@ -11,14 +15,14 @@ - - + diff --git a/examples/CPTTestApp-iPhone/MainWindow.xib b/examples/CPTTestApp-iPhone/Base.lproj/MainWindow.xib similarity index 77% rename from examples/CPTTestApp-iPhone/MainWindow.xib rename to examples/CPTTestApp-iPhone/Base.lproj/MainWindow.xib index eb90ba470..19255ec6e 100644 --- a/examples/CPTTestApp-iPhone/MainWindow.xib +++ b/examples/CPTTestApp-iPhone/Base.lproj/MainWindow.xib @@ -1,7 +1,10 @@ - - + + + - + + + @@ -16,19 +19,18 @@ - - + + - - + + - - + @@ -45,6 +47,7 @@ + @@ -52,9 +55,4 @@ - - - - - diff --git a/examples/CPTTestApp-iPhone/Base.lproj/PieChart.xib b/examples/CPTTestApp-iPhone/Base.lproj/PieChart.xib new file mode 100644 index 000000000..840e4935a --- /dev/null +++ b/examples/CPTTestApp-iPhone/Base.lproj/PieChart.xib @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp-iPhone/ScatterPlot.xib b/examples/CPTTestApp-iPhone/Base.lproj/ScatterPlot.xib similarity index 50% rename from examples/CPTTestApp-iPhone/ScatterPlot.xib rename to examples/CPTTestApp-iPhone/Base.lproj/ScatterPlot.xib index 7e1ed2991..b1747d817 100644 --- a/examples/CPTTestApp-iPhone/ScatterPlot.xib +++ b/examples/CPTTestApp-iPhone/Base.lproj/ScatterPlot.xib @@ -1,7 +1,10 @@ - - + + + - + + + @@ -11,15 +14,10 @@ - + - - + + - - - - - diff --git a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/project.pbxproj b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/project.pbxproj index cb532b83c..672347980 100644 --- a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/project.pbxproj +++ b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/project.pbxproj @@ -9,27 +9,40 @@ /* Begin PBXBuildFile section */ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 282CCBFE0DB6C98000C4EA27 /* BarChart.xib in Resources */ = {isa = PBXBuildFile; fileRef = 282CCBFD0DB6C98000C4EA27 /* BarChart.xib */; }; 288765080DF74369002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765070DF74369002DB57D /* CoreGraphics.framework */; }; - 28AD73880D9D96C1002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD73870D9D96C1002E5188 /* MainWindow.xib */; }; - BC74A34110FC418D00E7E90D /* PieChart.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC74A34010FC418D00E7E90D /* PieChart.xib */; }; BC8166CE1100DD00006D898E /* 16-line-chart.png in Resources */ = {isa = PBXBuildFile; fileRef = BC8166CC1100DD00006D898E /* 16-line-chart.png */; }; BC8166CF1100DD00006D898E /* 17-bar-chart.png in Resources */ = {isa = PBXBuildFile; fileRef = BC8166CD1100DD00006D898E /* 17-bar-chart.png */; }; BC8166D21100DD6F006D898E /* 62-contrast.png in Resources */ = {isa = PBXBuildFile; fileRef = BC8166D11100DD6F006D898E /* 62-contrast.png */; }; BC9B81DA0FB893F70035D8DA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC9B81D90FB893F70035D8DA /* QuartzCore.framework */; }; - BC9B84360FB8B7110035D8DA /* ScatterPlot.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC9B84350FB8B7110035D8DA /* ScatterPlot.xib */; }; - C34677B219F3345500429A85 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C34677B119F3345500429A85 /* Launch Screen.xib */; }; C359603719CE34FC005CDFB9 /* BarChartController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C359603319CE34FB005CDFB9 /* BarChartController.swift */; }; C359603819CE34FC005CDFB9 /* iPhoneAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C359603419CE34FB005CDFB9 /* iPhoneAppDelegate.swift */; }; C359603919CE34FC005CDFB9 /* PieChartController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C359603519CE34FB005CDFB9 /* PieChartController.swift */; }; C359603A19CE34FC005CDFB9 /* ScatterPlotController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C359603619CE34FB005CDFB9 /* ScatterPlotController.swift */; }; C3B9F9D417503CDD001CCC50 /* BlueTexture.png in Resources */ = {isa = PBXBuildFile; fileRef = C3B9F9D317503CDD001CCC50 /* BlueTexture.png */; }; - C3CD283E17DE9C95008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD283D17DE9C95008EED1E /* Accelerate.framework */; }; + C3D0A20C20E019EB00BA2921 /* PieChart.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A20E20E019EB00BA2921 /* PieChart.xib */; }; + C3D0A21C20E019F000BA2921 /* BarChart.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A21E20E019F000BA2921 /* BarChart.xib */; }; + C3D0A21F20E019F300BA2921 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A22120E019F300BA2921 /* MainWindow.xib */; }; + C3D0A22220E019F800BA2921 /* ScatterPlot.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A22420E019F800BA2921 /* ScatterPlot.xib */; }; + C3D0A22520E019FF00BA2921 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A22720E019FF00BA2921 /* Launch Screen.xib */; }; C3D3936419FD671100148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3936319FD671100148319 /* Images.xcassets */; }; C3D414C61A7D847C00B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3D414C31A7D846500B6F5D6 /* libCorePlot-CocoaTouch.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + C31D01F11D10F506008C1EF2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C31D01F31D10F506008C1EF2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; C3D414BA1A7D846500B6F5D6 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; @@ -78,25 +91,25 @@ 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 1D6058910D05DD3D006BFB54 /* CPTTestApp-iPhone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CPTTestApp-iPhone.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 282CCBFD0DB6C98000C4EA27 /* BarChart.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BarChart.xib; sourceTree = ""; }; 288765070DF74369002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 28AD73870D9D96C1002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BC74A34010FC418D00E7E90D /* PieChart.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PieChart.xib; sourceTree = ""; }; BC8166CC1100DD00006D898E /* 16-line-chart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "16-line-chart.png"; path = "GlyphishIcons/16-line-chart.png"; sourceTree = ""; }; BC8166CD1100DD00006D898E /* 17-bar-chart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "17-bar-chart.png"; path = "GlyphishIcons/17-bar-chart.png"; sourceTree = ""; }; BC8166D11100DD6F006D898E /* 62-contrast.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "62-contrast.png"; path = "GlyphishIcons/62-contrast.png"; sourceTree = ""; }; BC9B81D90FB893F70035D8DA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - BC9B84350FB8B7110035D8DA /* ScatterPlot.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ScatterPlot.xib; sourceTree = ""; }; - C34677B119F3345500429A85 /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; }; C359603319CE34FB005CDFB9 /* BarChartController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarChartController.swift; sourceTree = ""; }; C359603419CE34FB005CDFB9 /* iPhoneAppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = iPhoneAppDelegate.swift; sourceTree = ""; }; C359603519CE34FB005CDFB9 /* PieChartController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PieChartController.swift; sourceTree = ""; }; C359603619CE34FB005CDFB9 /* ScatterPlotController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScatterPlotController.swift; sourceTree = ""; }; C359603B19CE352A005CDFB9 /* CPTTestApp-iPhone-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "CPTTestApp-iPhone-Bridging-Header.h"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C37A40F020E0322D00C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; C3B9F9D317503CDD001CCC50 /* BlueTexture.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = BlueTexture.png; sourceTree = ""; }; C3C3CBDE19EA125D00A0296A /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; C3CD283D17DE9C95008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; + C3D0A22820E01A0600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PieChart.xib; sourceTree = ""; }; + C3D0A22920E01A0600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/BarChart.xib; sourceTree = ""; }; + C3D0A22A20E01A0600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainWindow.xib; sourceTree = ""; }; + C3D0A22B20E01A0600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ScatterPlot.xib; sourceTree = ""; }; + C3D0A22C20E01A0600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Base.lproj/Launch Screen.xib"; sourceTree = ""; }; C3D3936319FD671100148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "CPTTestApp-iPhone/Images.xcassets"; sourceTree = ""; }; C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ @@ -110,7 +123,6 @@ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 288765080DF74369002DB57D /* CoreGraphics.framework in Frameworks */, BC9B81DA0FB893F70035D8DA /* QuartzCore.framework in Frameworks */, - C3CD283E17DE9C95008EED1E /* Accelerate.framework in Frameworks */, C3D414C61A7D847C00B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -170,12 +182,12 @@ BC8166CC1100DD00006D898E /* 16-line-chart.png */, BC8166CD1100DD00006D898E /* 17-bar-chart.png */, C3B9F9D317503CDD001CCC50 /* BlueTexture.png */, - BC74A34010FC418D00E7E90D /* PieChart.xib */, - 282CCBFD0DB6C98000C4EA27 /* BarChart.xib */, - 28AD73870D9D96C1002E5188 /* MainWindow.xib */, - 8D1107310486CEB800E47090 /* Info.plist */, - BC9B84350FB8B7110035D8DA /* ScatterPlot.xib */, - C34677B119F3345500429A85 /* Launch Screen.xib */, + C3D0A22720E019FF00BA2921 /* Launch Screen.xib */, + C3D0A22120E019F300BA2921 /* MainWindow.xib */, + C3D0A22420E019F800BA2921 /* ScatterPlot.xib */, + C3D0A21E20E019F000BA2921 /* BarChart.xib */, + C3D0A20E20E019EB00BA2921 /* PieChart.xib */, + C37A40F120E0322D00C4FF48 /* Info.plist */, ); name = Resources; sourceTree = ""; @@ -201,6 +213,8 @@ C3D414C11A7D846500B6F5D6 /* UnitTests iOS.xctest */, C3D414C31A7D846500B6F5D6 /* libCorePlot-CocoaTouch.a */, C3D414C51A7D846500B6F5D6 /* CorePlot-CocoaTouchTests.xctest */, + C31D01F21D10F506008C1EF2 /* CorePlot.framework */, + C31D01F41D10F506008C1EF2 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -232,17 +246,24 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0930; + TargetAttributes = { + 1D6058900D05DD3D006BFB54 = { + DevelopmentTeam = 28ZA45DE7D; + LastSwiftMigration = 1020; + }; + }; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CPTTestApp-iPhone" */; compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + fr, + de, + ja, + en, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CPTTestApp-iPhone */; projectDirPath = ""; @@ -260,6 +281,20 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + C31D01F21D10F506008C1EF2 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C31D01F11D10F506008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C31D01F41D10F506008C1EF2 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C31D01F31D10F506008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; C3D414BB1A7D846500B6F5D6 /* CorePlot.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -309,12 +344,12 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 28AD73880D9D96C1002E5188 /* MainWindow.xib in Resources */, - 282CCBFE0DB6C98000C4EA27 /* BarChart.xib in Resources */, - BC9B84360FB8B7110035D8DA /* ScatterPlot.xib in Resources */, + C3D0A21F20E019F300BA2921 /* MainWindow.xib in Resources */, + C3D0A21C20E019F000BA2921 /* BarChart.xib in Resources */, + C3D0A22220E019F800BA2921 /* ScatterPlot.xib in Resources */, C3D3936419FD671100148319 /* Images.xcassets in Resources */, - BC74A34110FC418D00E7E90D /* PieChart.xib in Resources */, - C34677B219F3345500429A85 /* Launch Screen.xib in Resources */, + C3D0A20C20E019EB00BA2921 /* PieChart.xib in Resources */, + C3D0A22520E019FF00BA2921 /* Launch Screen.xib in Resources */, BC8166CE1100DD00006D898E /* 16-line-chart.png in Resources */, BC8166CF1100DD00006D898E /* 17-bar-chart.png in Resources */, BC8166D21100DD6F006D898E /* 62-contrast.png in Resources */, @@ -338,6 +373,57 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXVariantGroup section */ + C37A40F120E0322D00C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A40F020E0322D00C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; + C3D0A20E20E019EB00BA2921 /* PieChart.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A22820E01A0600BA2921 /* Base */, + ); + name = PieChart.xib; + sourceTree = ""; + }; + C3D0A21E20E019F000BA2921 /* BarChart.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A22920E01A0600BA2921 /* Base */, + ); + name = BarChart.xib; + sourceTree = ""; + }; + C3D0A22120E019F300BA2921 /* MainWindow.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A22A20E01A0600BA2921 /* Base */, + ); + name = MainWindow.xib; + sourceTree = ""; + }; + C3D0A22420E019F800BA2921 /* ScatterPlot.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A22B20E01A0600BA2921 /* Base */, + ); + name = ScatterPlot.xib; + sourceTree = ""; + }; + C3D0A22720E019FF00BA2921 /* Launch Screen.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A22C20E01A0600BA2921 /* Base */, + ); + name = "Launch Screen.xib"; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ 1D6058940D05DD3E006BFB54 /* Debug */ = { isa = XCBuildConfiguration; @@ -345,16 +431,15 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_OBJC_ARC = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + DEVELOPMENT_TEAM = 28ZA45DE7D; GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_iPhone_Prefix.pch; HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; LIBRARY_SEARCH_PATHS = ""; OTHER_LDFLAGS = ( "-all_load", @@ -364,7 +449,7 @@ PRODUCT_NAME = "CPTTestApp-iPhone"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SWIFT_OBJC_BRIDGING_HEADER = "CPTTestApp-iPhone-Bridging-Header.h"; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -374,14 +459,14 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_OBJC_ARC = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; COPY_PHASE_STRIP = YES; + DEVELOPMENT_TEAM = 28ZA45DE7D; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_iPhone_Prefix.pch; HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; LIBRARY_SEARCH_PATHS = ""; OTHER_LDFLAGS = ( "-all_load", @@ -391,22 +476,24 @@ PRODUCT_NAME = "CPTTestApp-iPhone"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SWIFT_OBJC_BRIDGING_HEADER = "CPTTestApp-iPhone-Bridging-Header.h"; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; }; name = Release; }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C3CBDE19EA125D00A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/Frameworks"; @@ -417,21 +504,22 @@ SDKROOT = iphoneos; SYMROOT = "$(SRCROOT)/../../build"; TARGETED_DEVICE_FAMILY = 1; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\" \"${PROJECT_DIR}/../../framework/Source\" \"${PROJECT_DIR}/../../framework/iPhoneOnly\""; }; name = Debug; }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C3CBDE19EA125D00A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/Frameworks"; @@ -442,7 +530,7 @@ SDKROOT = iphoneos; SYMROOT = "$(SRCROOT)/../../build"; TARGETED_DEVICE_FAMILY = 1; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\" \"${PROJECT_DIR}/../../framework/Source\" \"${PROJECT_DIR}/../../framework/iPhoneOnly\""; }; name = Release; }; diff --git a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPhone.xcscheme b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPhone.xcscheme index 64a983c54..0977a0925 100644 --- a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPhone.xcscheme +++ b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPhone.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "YES"> - - - - + + - - UInt + func numberOfRecords(for plot: CPTPlot) -> UInt { return 16 } - func numberForPlot(plot: CPTPlot, field: UInt, recordIndex: UInt) -> AnyObject? + func number(for plot: CPTPlot, field: UInt, record: UInt) -> Any? { switch CPTBarPlotField(rawValue: Int(field))! { - case .BarLocation: - return recordIndex as NSNumber + case .barLocation: + return record as NSNumber - case .BarTip: + case .barTip: let plotID = plot.identifier as! String - return (plotID == "Bar Plot 2" ? recordIndex : ((recordIndex + 1) * (recordIndex + 1)) ) as NSNumber + return (plotID == "Bar Plot 2" ? record : ((record + 1) * (record + 1)) ) as NSNumber default: return nil diff --git a/examples/CPTTestApp-iPhone/Classes/PieChartController.swift b/examples/CPTTestApp-iPhone/Classes/PieChartController.swift index ea01894e6..3b99ed916 100644 --- a/examples/CPTTestApp-iPhone/Classes/PieChartController.swift +++ b/examples/CPTTestApp-iPhone/Classes/PieChartController.swift @@ -1,19 +1,19 @@ import UIKit -class PieChartController : UIViewController, CPTPieChartDataSource { +class PieChartController : UIViewController, CPTPieChartDataSource, CPTPieChartDelegate { private var pieGraph : CPTXYGraph? = nil let dataForChart = [20.0, 30.0, 60.0] - // MARK: Initialization + // MARK: - Initialization - override func viewDidAppear(animated : Bool) + override func viewDidAppear(_ animated : Bool) { super.viewDidAppear(animated) // Create graph from theme - let newGraph = CPTXYGraph(frame: CGRectZero) - newGraph.applyTheme(CPTTheme(named: kCPTDarkGradientTheme)) + let newGraph = CPTXYGraph(frame: .zero) + newGraph.apply(CPTTheme(named: .darkGradientTheme)) let hostingView = self.view as! CPTGraphHostingView hostingView.hostedGraph = newGraph @@ -27,55 +27,55 @@ class PieChartController : UIViewController, CPTPieChartDataSource { newGraph.axisSet = nil let whiteText = CPTMutableTextStyle() - whiteText.color = CPTColor.whiteColor() + whiteText.color = .white() newGraph.titleTextStyle = whiteText newGraph.title = "Graph Title" // Add pie chart - let piePlot = CPTPieChart(frame: CGRectZero) + let piePlot = CPTPieChart(frame: .zero) piePlot.dataSource = self piePlot.pieRadius = 131.0 - piePlot.identifier = "Pie Chart 1" - piePlot.startAngle = CGFloat(M_PI_4) - piePlot.sliceDirection = .CounterClockwise + piePlot.identifier = "Pie Chart 1" as NSString + piePlot.startAngle = CGFloat(.pi / 4.0) + piePlot.sliceDirection = .counterClockwise piePlot.centerAnchor = CGPoint(x: 0.5, y: 0.38) piePlot.borderLineStyle = CPTLineStyle() piePlot.delegate = self - newGraph.addPlot(piePlot) + newGraph.add(piePlot) self.pieGraph = newGraph } // MARK: - Plot Data Source Methods - func numberOfRecordsForPlot(plot: CPTPlot) -> UInt + func numberOfRecords(for plot: CPTPlot) -> UInt { return UInt(self.dataForChart.count) } - func numberForPlot(plot: CPTPlot, field: UInt, recordIndex: UInt) -> AnyObject? + func number(for plot: CPTPlot, field: UInt, record: UInt) -> Any? { - if Int(recordIndex) > self.dataForChart.count { + if Int(record) > self.dataForChart.count { return nil } else { switch CPTPieChartField(rawValue: Int(field))! { - case .SliceWidth: - return (self.dataForChart)[Int(recordIndex)] as NSNumber + case .sliceWidth: + return (self.dataForChart)[Int(record)] as NSNumber default: - return recordIndex as NSNumber + return record as NSNumber } } } - func dataLabelForPlot(plot: CPTPlot, recordIndex: UInt) -> CPTLayer? + func dataLabel(for plot: CPTPlot, record: UInt) -> CPTLayer? { - let label = CPTTextLayer(text:"\(recordIndex)") + let label = CPTTextLayer(text:"\(record)") if let textStyle = label.textStyle?.mutableCopy() as? CPTMutableTextStyle { - textStyle.color = CPTColor.lightGrayColor() + textStyle.color = .lightGray() label.textStyle = textStyle } @@ -83,7 +83,7 @@ class PieChartController : UIViewController, CPTPieChartDataSource { return label } - func radialOffsetForPieChart(piePlot: CPTPieChart, recordIndex: UInt) -> CGFloat + func radialOffset(for piePlot: CPTPieChart, record recordIndex: UInt) -> CGFloat { var offset: CGFloat = 0.0 @@ -95,9 +95,8 @@ class PieChartController : UIViewController, CPTPieChartDataSource { } // MARK: - Delegate Methods - - func pieChart(plot: CPTPlot, sliceWasSelectedAtRecordIndex recordIndex: UInt) - { - self.pieGraph?.title = "Selected index: \(recordIndex)" + + func pieChart(_ plot: CPTPieChart, sliceWasSelectedAtRecord idx: UInt) { + self.pieGraph?.title = "Selected index: \(idx)" } } diff --git a/examples/CPTTestApp-iPhone/Classes/ScatterPlotController.swift b/examples/CPTTestApp-iPhone/Classes/ScatterPlotController.swift index 2f1681dd3..76b3191ee 100644 --- a/examples/CPTTestApp-iPhone/Classes/ScatterPlotController.swift +++ b/examples/CPTTestApp-iPhone/Classes/ScatterPlotController.swift @@ -1,20 +1,20 @@ import UIKit -class ScatterPlotController : UIViewController, CPTScatterPlotDataSource { +class ScatterPlotController : UIViewController, CPTScatterPlotDataSource, CPTAxisDelegate { private var scatterGraph : CPTXYGraph? = nil typealias plotDataType = [CPTScatterPlotField : Double] private var dataForPlot = [plotDataType]() - // MARK: Initialization + // MARK: - Initialization - override func viewDidAppear(animated : Bool) + override func viewDidAppear(_ animated : Bool) { super.viewDidAppear(animated) // Create graph from theme - let newGraph = CPTXYGraph(frame: CGRectZero) - newGraph.applyTheme(CPTTheme(named: kCPTDarkGradientTheme)) + let newGraph = CPTXYGraph(frame: .zero) + newGraph.apply(CPTTheme(named: .darkGradientTheme)) let hostingView = self.view as! CPTGraphHostingView hostingView.hostedGraph = newGraph @@ -45,7 +45,7 @@ class ScatterPlotController : UIViewController, CPTScatterPlotDataSource { ] } - if let y = axisSet.xAxis { + if let y = axisSet.yAxis { y.majorIntervalLength = 0.5 y.minorTicksPerInterval = 5 y.orthogonalPosition = 2.0 @@ -58,43 +58,43 @@ class ScatterPlotController : UIViewController, CPTScatterPlotDataSource { } // Create a blue plot area - let boundLinePlot = CPTScatterPlot(frame: CGRectZero) + let boundLinePlot = CPTScatterPlot(frame: .zero) let blueLineStyle = CPTMutableLineStyle() blueLineStyle.miterLimit = 1.0 blueLineStyle.lineWidth = 3.0 - blueLineStyle.lineColor = CPTColor.blueColor() + blueLineStyle.lineColor = .blue() boundLinePlot.dataLineStyle = blueLineStyle - boundLinePlot.identifier = "Blue Plot" + boundLinePlot.identifier = "Blue Plot" as NSString boundLinePlot.dataSource = self - newGraph.addPlot(boundLinePlot) + newGraph.add(boundLinePlot) let fillImage = CPTImage(named:"BlueTexture") - fillImage.tiled = true + fillImage.isTiled = true boundLinePlot.areaFill = CPTFill(image: fillImage) boundLinePlot.areaBaseValue = 0.0 // Add plot symbols let symbolLineStyle = CPTMutableLineStyle() - symbolLineStyle.lineColor = CPTColor.blackColor() - let plotSymbol = CPTPlotSymbol.ellipsePlotSymbol() - plotSymbol.fill = CPTFill(color: CPTColor.blueColor()) + symbolLineStyle.lineColor = .black() + let plotSymbol = CPTPlotSymbol.ellipse() + plotSymbol.fill = CPTFill(color: .blue()) plotSymbol.lineStyle = symbolLineStyle plotSymbol.size = CGSize(width: 10.0, height: 10.0) boundLinePlot.plotSymbol = plotSymbol // Create a green plot area - let dataSourceLinePlot = CPTScatterPlot(frame: CGRectZero) + let dataSourceLinePlot = CPTScatterPlot(frame: .zero) let greenLineStyle = CPTMutableLineStyle() greenLineStyle.lineWidth = 3.0 - greenLineStyle.lineColor = CPTColor.greenColor() + greenLineStyle.lineColor = .green() greenLineStyle.dashPattern = [5.0, 5.0] dataSourceLinePlot.dataLineStyle = greenLineStyle - dataSourceLinePlot.identifier = "Green Plot" + dataSourceLinePlot.identifier = "Green Plot" as NSString dataSourceLinePlot.dataSource = self // Put an area gradient under the plot above let areaColor = CPTColor(componentRed: 0.3, green: 1.0, blue: 0.3, alpha: 0.8) - let areaGradient = CPTGradient(beginningColor: areaColor, endingColor: CPTColor.clearColor()) + let areaGradient = CPTGradient(beginning: areaColor, ending: .clear()) areaGradient.angle = -90.0 let areaGradientFill = CPTFill(gradient: areaGradient) dataSourceLinePlot.areaFill = areaGradientFill @@ -102,14 +102,14 @@ class ScatterPlotController : UIViewController, CPTScatterPlotDataSource { // Animate in the new plot, as an example dataSourceLinePlot.opacity = 0.0 - newGraph.addPlot(dataSourceLinePlot) + newGraph.add(dataSourceLinePlot) let fadeInAnimation = CABasicAnimation(keyPath: "opacity") fadeInAnimation.duration = 1.0 - fadeInAnimation.removedOnCompletion = false - fadeInAnimation.fillMode = kCAFillModeForwards + fadeInAnimation.isRemovedOnCompletion = false + fadeInAnimation.fillMode = .forwards fadeInAnimation.toValue = 1.0 - dataSourceLinePlot.addAnimation(fadeInAnimation, forKey: "animateOpacity") + dataSourceLinePlot.add(fadeInAnimation, forKey: "animateOpacity") // Add some initial data var contentArray = [plotDataType]() @@ -126,16 +126,16 @@ class ScatterPlotController : UIViewController, CPTScatterPlotDataSource { // MARK: - Plot Data Source Methods - func numberOfRecordsForPlot(plot: CPTPlot) -> UInt + func numberOfRecords(for plot: CPTPlot) -> UInt { return UInt(self.dataForPlot.count) } - func numberForPlot(plot: CPTPlot, field: UInt, recordIndex: UInt) -> AnyObject? + func number(for plot: CPTPlot, field: UInt, record: UInt) -> Any? { let plotField = CPTScatterPlotField(rawValue: Int(field)) - if let num = self.dataForPlot[Int(recordIndex)][plotField!] { + if let num = self.dataForPlot[Int(record)][plotField!] { let plotID = plot.identifier as! String if (plotField! == .Y) && (plotID == "Green Plot") { return (num + 1.0) as NSNumber @@ -151,7 +151,7 @@ class ScatterPlotController : UIViewController, CPTScatterPlotDataSource { // MARK: - Axis Delegate Methods - func axis(axis: CPTAxis, shouldUpdateAxisLabelsAtLocations locations: NSSet!) -> Bool + func axis(_ axis: CPTAxis, shouldUpdateAxisLabelsAtLocations locations: Set) -> Bool { if let formatter = axis.labelFormatter { let labelOffset = axis.labelOffset @@ -160,21 +160,20 @@ class ScatterPlotController : UIViewController, CPTScatterPlotDataSource { for tickLocation in locations { if let labelTextStyle = axis.labelTextStyle?.mutableCopy() as? CPTMutableTextStyle { - if tickLocation.doubleValue >= 0.0 { - labelTextStyle.color = CPTColor.greenColor() + labelTextStyle.color = .green() } else { - labelTextStyle.color = CPTColor.redColor() + labelTextStyle.color = .red() } - let labelString = formatter.stringForObjectValue(tickLocation) + let labelString = formatter.string(for:tickLocation) let newLabelLayer = CPTTextLayer(text: labelString, style: labelTextStyle) let newLabel = CPTAxisLabel(contentLayer: newLabelLayer) - newLabel.tickLocation = tickLocation as! NSNumber + newLabel.tickLocation = tickLocation newLabel.offset = labelOffset - + newLabels.insert(newLabel) } diff --git a/examples/CPTTestApp-iPhone/Classes/iPhoneAppDelegate.swift b/examples/CPTTestApp-iPhone/Classes/iPhoneAppDelegate.swift index e19b8b21d..42189f9ec 100644 --- a/examples/CPTTestApp-iPhone/Classes/iPhoneAppDelegate.swift +++ b/examples/CPTTestApp-iPhone/Classes/iPhoneAppDelegate.swift @@ -11,7 +11,7 @@ class iPhoneAppDelegate : NSObject, UIApplicationDelegate, UITabBarControllerDel @IBOutlet var window: UIWindow? = nil @IBOutlet var tabBarController: UITabBarController? = nil - func applicationDidFinishLaunching(application: UIApplication) { + func applicationDidFinishLaunching(_ application: UIApplication) { if let myWindow = self.window { myWindow.rootViewController = self.tabBarController myWindow.makeKeyAndVisible() diff --git a/examples/CPTTestApp-iPhone/PieChart.xib b/examples/CPTTestApp-iPhone/PieChart.xib deleted file mode 100644 index 2489ea51a..000000000 --- a/examples/CPTTestApp-iPhone/PieChart.xib +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/CPTTestApp/Info.plist b/examples/CPTTestApp/Base.lproj/Info.plist similarity index 100% rename from examples/CPTTestApp/Info.plist rename to examples/CPTTestApp/Base.lproj/Info.plist diff --git a/examples/CPTTestApp/CPTTestApp.xcodeproj/project.pbxproj b/examples/CPTTestApp/CPTTestApp.xcodeproj/project.pbxproj index e095a99a2..a844a7791 100644 --- a/examples/CPTTestApp/CPTTestApp.xcodeproj/project.pbxproj +++ b/examples/CPTTestApp/CPTTestApp.xcodeproj/project.pbxproj @@ -7,22 +7,21 @@ objects = { /* Begin PBXBuildFile section */ - 07032B7111ABB9F300463D20 /* CorePlot.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 07032B6A11ABB9E000463D20 /* CorePlot.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 07032B7211ABB9F700463D20 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07032B6A11ABB9E000463D20 /* CorePlot.framework */; }; 077382B10F3DC1FB002F10E2 /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = 077382B00F3DC1FB002F10E2 /* Controller.m */; }; - 07C13BBB0FF9322A00BEE616 /* BlueTexture.png in Resources */ = {isa = PBXBuildFile; fileRef = 07C13BBA0FF9322A00BEE616 /* BlueTexture.png */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - 90AF4F440F36CF1800753D26 /* CPTTestApp.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90AF4F430F36CF1800753D26 /* CPTTestApp.xib */; }; BC8E74240FC0B96000DF8511 /* RotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8E74230FC0B96000DF8511 /* RotationView.m */; }; - C317AB4F1093CC1E00B25011 /* PlotSymbolDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C317AB4E1093CC1E00B25011 /* PlotSymbolDemo.xib */; }; - C317AB711093E09D00B25011 /* AxisDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C317AB701093E09D00B25011 /* AxisDemo.xib */; }; C317AB751093E17500B25011 /* AxisDemoController.m in Sources */ = {isa = PBXBuildFile; fileRef = C317AB731093E17500B25011 /* AxisDemoController.m */; }; C34D4F8E0F8ED78400969C24 /* CPTPlotSymbolTestController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34D4F8C0F8ED78400969C24 /* CPTPlotSymbolTestController.m */; }; - C38017DD124132020052B00D /* SelectionDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C38017DC124132020052B00D /* SelectionDemo.xib */; }; + C36912D21C0B48DF000A1D61 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07032B6A11ABB9E000463D20 /* CorePlot.framework */; }; + C36912D31C0B48DF000A1D61 /* CorePlot.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 07032B6A11ABB9E000463D20 /* CorePlot.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; C38017E1124132610052B00D /* SelectionDemoController.m in Sources */ = {isa = PBXBuildFile; fileRef = C38017E0124132610052B00D /* SelectionDemoController.m */; }; C39BB9A4181C154500D95E01 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */; }; + C3D0A18B20E017C500BA2921 /* AxisDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A18D20E017C500BA2921 /* AxisDemo.xib */; }; + C3D0A19A20E017CC00BA2921 /* CPTTestApp.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A19C20E017CC00BA2921 /* CPTTestApp.xib */; }; + C3D0A19D20E017D100BA2921 /* PlotSymbolDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A19F20E017D100BA2921 /* PlotSymbolDemo.xib */; }; + C3D0A1A020E017D600BA2921 /* SelectionDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1A220E017D600BA2921 /* SelectionDemo.xib */; }; C3D3935C19FD653300148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3935B19FD653300148319 /* Images.xcassets */; }; /* End PBXBuildFile section */ @@ -48,6 +47,13 @@ remoteGlobalIDString = 8DC2EF4F0486A6940098B216; remoteInfo = CorePlot; }; + C36912D41C0B48DF000A1D61 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 07032B6311ABB9E000463D20 /* CorePlot.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 8DC2EF4F0486A6940098B216; + remoteInfo = "CorePlot Mac"; + }; C371E4D01BB714EC00AC18DB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 07032B6311ABB9E000463D20 /* CorePlot.xcodeproj */; @@ -76,6 +82,20 @@ remoteGlobalIDString = C38A09C41A4619A900D45436; remoteInfo = "CorePlot-CocoaTouchTests"; }; + C3CBFB691BE5874200519EE8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 07032B6311ABB9E000463D20 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C3CBFB6B1BE5874200519EE8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 07032B6311ABB9E000463D20 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -85,7 +105,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 07032B7111ABB9F300463D20 /* CorePlot.framework in Copy Frameworks */, + C36912D31C0B48DF000A1D61 /* CorePlot.framework in Copy Frameworks */, ); name = "Copy Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -97,30 +117,29 @@ 0761854B0F3CB3CB00A89A76 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = CorePlot.framework; path = ../../../../framework/build/Debug/CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 077382AF0F3DC1FB002F10E2 /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Controller.h; path = Source/Controller.h; sourceTree = ""; }; 077382B00F3DC1FB002F10E2 /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Controller.m; path = Source/Controller.m; sourceTree = ""; }; - 07C13BBA0FF9322A00BEE616 /* BlueTexture.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = BlueTexture.png; path = Resources/BlueTexture.png; sourceTree = ""; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Source/main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* CPTTestApp_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestApp_Prefix.pch; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* CPTTestApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CPTTestApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 90AF4F430F36CF1800753D26 /* CPTTestApp.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = CPTTestApp.xib; path = Resources/CPTTestApp.xib; sourceTree = ""; }; BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BC8E74220FC0B96000DF8511 /* RotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RotationView.h; path = Source/RotationView.h; sourceTree = ""; }; BC8E74230FC0B96000DF8511 /* RotationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RotationView.m; path = Source/RotationView.m; sourceTree = ""; }; - C317AB4E1093CC1E00B25011 /* PlotSymbolDemo.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = PlotSymbolDemo.xib; path = Resources/PlotSymbolDemo.xib; sourceTree = ""; }; - C317AB701093E09D00B25011 /* AxisDemo.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = AxisDemo.xib; path = Resources/AxisDemo.xib; sourceTree = ""; }; C317AB731093E17500B25011 /* AxisDemoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AxisDemoController.m; path = Source/AxisDemoController.m; sourceTree = ""; }; C317AB741093E17500B25011 /* AxisDemoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AxisDemoController.h; path = Source/AxisDemoController.h; sourceTree = ""; }; C34D4F8C0F8ED78400969C24 /* CPTPlotSymbolTestController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotSymbolTestController.m; path = Source/CPTPlotSymbolTestController.m; sourceTree = ""; }; C34D4F8D0F8ED78400969C24 /* CPTPlotSymbolTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotSymbolTestController.h; path = Source/CPTPlotSymbolTestController.h; sourceTree = ""; }; - C38017DC124132020052B00D /* SelectionDemo.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = SelectionDemo.xib; path = Resources/SelectionDemo.xib; sourceTree = ""; }; + C3564D2522A2D11D000A54C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + C37A40A620E030C000C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; C38017DF124132610052B00D /* SelectionDemoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectionDemoController.h; path = Source/SelectionDemoController.h; sourceTree = ""; }; C38017E0124132610052B00D /* SelectionDemoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SelectionDemoController.m; path = Source/SelectionDemoController.m; sourceTree = ""; }; C3880C3919DCD6A000ED0618 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3D0A1A320E017E400BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/AxisDemo.xib; sourceTree = ""; }; + C3D0A1A420E017E400BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/CPTTestApp.xib; sourceTree = ""; }; + C3D0A1A520E017E400BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PlotSymbolDemo.xib; sourceTree = ""; }; + C3D0A1A620E017E400BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SelectionDemo.xib; sourceTree = ""; }; C3D3935B19FD653300148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = CPTTestApp/Images.xcassets; sourceTree = ""; }; /* End PBXFileReference section */ @@ -129,7 +148,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 07032B7211ABB9F700463D20 /* CorePlot.framework in Frameworks */, + C36912D21C0B48DF000A1D61 /* CorePlot.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, C39BB9A4181C154500D95E01 /* QuartzCore.framework in Frameworks */, ); @@ -147,6 +166,8 @@ C371E4D31BB714EC00AC18DB /* UnitTests iOS.xctest */, C371E4D51BB714EC00AC18DB /* libCorePlot-CocoaTouch.a */, C371E4D71BB714EC00AC18DB /* CorePlot-CocoaTouchTests.xctest */, + C3CBFB6A1BE5874200519EE8 /* CorePlot.framework */, + C3CBFB6C1BE5874200519EE8 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -226,13 +247,12 @@ isa = PBXGroup; children = ( C3D3935B19FD653300148319 /* Images.xcassets */, - 8D1107310486CEB800E47090 /* Info.plist */, - 07C13BBA0FF9322A00BEE616 /* BlueTexture.png */, + C37A40A720E030C000C4FF48 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - C317AB701093E09D00B25011 /* AxisDemo.xib */, - 90AF4F430F36CF1800753D26 /* CPTTestApp.xib */, - C317AB4E1093CC1E00B25011 /* PlotSymbolDemo.xib */, - C38017DC124132020052B00D /* SelectionDemo.xib */, + C3D0A18D20E017C500BA2921 /* AxisDemo.xib */, + C3D0A19C20E017CC00BA2921 /* CPTTestApp.xib */, + C3D0A19F20E017D100BA2921 /* PlotSymbolDemo.xib */, + C3D0A1A220E017D600BA2921 /* SelectionDemo.xib */, ); name = Resources; sourceTree = ""; @@ -262,6 +282,7 @@ ); dependencies = ( 07032B7411ABBA0E00463D20 /* PBXTargetDependency */, + C36912D51C0B48DF000A1D61 /* PBXTargetDependency */, ); name = CPTTestApp; productInstallPath = "$(HOME)/Applications"; @@ -276,17 +297,18 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = NO; - LastUpgradeCheck = 0730; + LastUpgradeCheck = 1100; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CPTTestApp" */; compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + ja, + de, + en, + fr, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CPTTestApp */; projectDirPath = ""; @@ -346,6 +368,20 @@ remoteRef = C371E4D61BB714EC00AC18DB /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C3CBFB6A1BE5874200519EE8 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3CBFB691BE5874200519EE8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3CBFB6C1BE5874200519EE8 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C3CBFB6B1BE5874200519EE8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -355,11 +391,10 @@ files = ( 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, C3D3935C19FD653300148319 /* Images.xcassets in Resources */, - 90AF4F440F36CF1800753D26 /* CPTTestApp.xib in Resources */, - 07C13BBB0FF9322A00BEE616 /* BlueTexture.png in Resources */, - C317AB4F1093CC1E00B25011 /* PlotSymbolDemo.xib in Resources */, - C317AB711093E09D00B25011 /* AxisDemo.xib in Resources */, - C38017DD124132020052B00D /* SelectionDemo.xib in Resources */, + C3D0A19A20E017CC00BA2921 /* CPTTestApp.xib in Resources */, + C3D0A19D20E017D100BA2921 /* PlotSymbolDemo.xib in Resources */, + C3D0A18B20E017C500BA2921 /* AxisDemo.xib in Resources */, + C3D0A1A020E017D600BA2921 /* SelectionDemo.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -387,17 +422,66 @@ name = CorePlot; targetProxy = 07032B7311ABBA0E00463D20 /* PBXContainerItemProxy */; }; + C36912D51C0B48DF000A1D61 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CorePlot Mac"; + targetProxy = C36912D41C0B48DF000A1D61 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 089C165DFE840E0CC02AAC07 /* English */, + C3564D2522A2D11D000A54C9 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; + C37A40A720E030C000C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A40A620E030C000C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; + C3D0A18D20E017C500BA2921 /* AxisDemo.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1A320E017E400BA2921 /* Base */, + ); + name = AxisDemo.xib; + path = Resources; + sourceTree = ""; + }; + C3D0A19C20E017CC00BA2921 /* CPTTestApp.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1A420E017E400BA2921 /* Base */, + ); + name = CPTTestApp.xib; + path = Resources; + sourceTree = ""; + }; + C3D0A19F20E017D100BA2921 /* PlotSymbolDemo.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1A520E017E400BA2921 /* Base */, + ); + name = PlotSymbolDemo.xib; + path = Resources; + sourceTree = ""; + }; + C3D0A1A220E017D600BA2921 /* SelectionDemo.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1A620E017E400BA2921 /* Base */, + ); + name = SelectionDemo.xib; + path = Resources; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -408,18 +492,18 @@ ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_TREAT_WARNINGS_AS_ERRORS = YES; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = CPTTestApp; }; @@ -432,15 +516,16 @@ ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = CPTTestApp; }; @@ -448,15 +533,16 @@ }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3880C3919DCD6A000ED0618 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SYMROOT = "$(PROJECT_DIR)/../../build"; @@ -465,13 +551,15 @@ }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3880C3919DCD6A000ED0618 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; SYMROOT = "$(PROJECT_DIR)/../../build"; }; diff --git a/examples/CPTTestApp/CPTTestApp.xcodeproj/xcshareddata/xcschemes/CPTTestApp.xcscheme b/examples/CPTTestApp/CPTTestApp.xcodeproj/xcshareddata/xcschemes/CPTTestApp.xcscheme index f4d925ecc..a741352d0 100644 --- a/examples/CPTTestApp/CPTTestApp.xcodeproj/xcshareddata/xcschemes/CPTTestApp.xcscheme +++ b/examples/CPTTestApp/CPTTestApp.xcodeproj/xcshareddata/xcschemes/CPTTestApp.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "YES"> - - - - + + - - - + + - + + + - - + + - + + diff --git a/examples/CPTTestApp/Resources/CPTTestApp.xib b/examples/CPTTestApp/Resources/Base.lproj/CPTTestApp.xib similarity index 95% rename from examples/CPTTestApp/Resources/CPTTestApp.xib rename to examples/CPTTestApp/Resources/Base.lproj/CPTTestApp.xib index 8bec09504..4b7d3ae17 100644 --- a/examples/CPTTestApp/Resources/CPTTestApp.xib +++ b/examples/CPTTestApp/Resources/Base.lproj/CPTTestApp.xib @@ -1,13 +1,14 @@ - - + + - + + - + @@ -558,18 +559,19 @@ + - + - + - - - + - + - - + + - + @@ -657,13 +659,12 @@ - - - + - - - - - - @@ -688,7 +683,7 @@ - + @@ -696,7 +691,7 @@ - + @@ -704,15 +699,15 @@ - + - + - - + @@ -745,7 +741,7 @@ y - + diff --git a/examples/CPTTestApp/Resources/PlotSymbolDemo.xib b/examples/CPTTestApp/Resources/Base.lproj/PlotSymbolDemo.xib similarity index 67% rename from examples/CPTTestApp/Resources/PlotSymbolDemo.xib rename to examples/CPTTestApp/Resources/Base.lproj/PlotSymbolDemo.xib index bffdf5c16..ce94cac6a 100644 --- a/examples/CPTTestApp/Resources/PlotSymbolDemo.xib +++ b/examples/CPTTestApp/Resources/Base.lproj/PlotSymbolDemo.xib @@ -1,26 +1,29 @@ - - + + - + + + - - + + - + + diff --git a/examples/CPTTestApp/Resources/SelectionDemo.xib b/examples/CPTTestApp/Resources/Base.lproj/SelectionDemo.xib similarity index 68% rename from examples/CPTTestApp/Resources/SelectionDemo.xib rename to examples/CPTTestApp/Resources/Base.lproj/SelectionDemo.xib index 9dee883b9..c79ae2d56 100644 --- a/examples/CPTTestApp/Resources/SelectionDemo.xib +++ b/examples/CPTTestApp/Resources/Base.lproj/SelectionDemo.xib @@ -1,26 +1,29 @@ - - + + - + + + - - + + - + + diff --git a/examples/CPTTestApp/Resources/BlueTexture.png b/examples/CPTTestApp/Resources/BlueTexture.png deleted file mode 100644 index ea004c70d..000000000 Binary files a/examples/CPTTestApp/Resources/BlueTexture.png and /dev/null differ diff --git a/examples/CPTTestApp/Source/CPTPlotSymbolTestController.m b/examples/CPTTestApp/Source/CPTPlotSymbolTestController.m index 9cb1fa30c..8cf7d0aee 100644 --- a/examples/CPTTestApp/Source/CPTPlotSymbolTestController.m +++ b/examples/CPTTestApp/Source/CPTPlotSymbolTestController.m @@ -50,7 +50,7 @@ -(void)awakeFromNib // Create a series of plots that uses the data source method for ( NSUInteger i = CPTPlotSymbolTypeNone; i <= CPTPlotSymbolTypeCustom; i++ ) { CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] initWithFrame:newGraph.bounds]; - dataSourceLinePlot.identifier = [NSString stringWithFormat:@"%lu", (unsigned long)i]; + dataSourceLinePlot.identifier = @(i); dataSourceLinePlot.shadow = lineShadow; CPTMutableLineStyle *lineStyle = [dataSourceLinePlot.dataLineStyle mutableCopy]; @@ -67,7 +67,7 @@ -(void)awakeFromNib #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return 10; } @@ -82,7 +82,7 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum break; case CPTScatterPlotFieldY: - num = @( ( (NSString *)plot.identifier ).integerValue ); + num = (NSNumber *)plot.identifier; break; default: @@ -103,7 +103,7 @@ -(nullable CPTPlotSymbol *)symbolForScatterPlot:(nonnull CPTScatterPlot *)plot r symbolShadow.shadowColor = [CPTColor blackColor]; CPTPlotSymbol *symbol = [[CPTPlotSymbol alloc] init]; - symbol.symbolType = (CPTPlotSymbolType)( (NSString *)plot.identifier ).intValue; + symbol.symbolType = (CPTPlotSymbolType)((NSString *)plot.identifier).intValue; symbol.fill = [CPTFill fillWithGradient:gradientFill]; symbol.shadow = symbolShadow; @@ -116,9 +116,9 @@ -(nullable CPTPlotSymbol *)symbolForScatterPlot:(nonnull CPTScatterPlot *)plot r CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, NULL, 0., 0.); - CGPathAddEllipseInRect( path, NULL, CGRectMake(0., 0., 10., 10.) ); - CGPathAddEllipseInRect( path, NULL, CGRectMake(1.5, 4., 3., 3.) ); - CGPathAddEllipseInRect( path, NULL, CGRectMake(5.5, 4., 3., 3.) ); + CGPathAddEllipseInRect(path, NULL, CGRectMake(0., 0., 10., 10.)); + CGPathAddEllipseInRect(path, NULL, CGRectMake(1.5, 4., 3., 3.)); + CGPathAddEllipseInRect(path, NULL, CGRectMake(5.5, 4., 3., 3.)); CGPathMoveToPoint(path, NULL, 5., 2.); CGPathAddArc(path, NULL, 5., 3.3, 2.8, 0., M_PI, TRUE); CGPathCloseSubpath(path); diff --git a/examples/CPTTestApp/Source/Controller.m b/examples/CPTTestApp/Source/Controller.m index 081a64185..9f1d5439a 100644 --- a/examples/CPTTestApp/Source/Controller.m +++ b/examples/CPTTestApp/Source/Controller.m @@ -1,5 +1,9 @@ #import "Controller.h" +#import "AxisDemoController.h" +#import "CPTPlotSymbolTestController.h" +#import "SelectionDemoController.h" + static const CGFloat kZDistanceBetweenLayers = 20.0; static NSString *const bindingsPlot = @"Bindings Plot"; @@ -9,10 +13,20 @@ @interface Controller() +-(void)plotSymbolWindowClosed; +-(void)axisDemoWindowClosed; +-(void)selectionDemoWindowClosed; + @property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *hostView; -@property (nonatomic, readwrite, weak, nullable) IBOutlet NSWindow *plotSymbolWindow; -@property (nonatomic, readwrite, weak, nullable) IBOutlet NSWindow *axisDemoWindow; -@property (nonatomic, readwrite, weak, nullable) IBOutlet NSWindow *selectionDemoWindow; + +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSWindow *plotSymbolWindow; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTPlotSymbolTestController *plotSymbolTestController; + +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSWindow *axisDemoWindow; +@property (nonatomic, readwrite, strong, nullable) IBOutlet AxisDemoController *axisDemoController; + +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSWindow *selectionDemoWindow; +@property (nonatomic, readwrite, strong, nullable) IBOutlet SelectionDemoController *selectionDemoController; @property (nonatomic, readwrite, strong, nonnull) CPTXYGraph *graph; @property (nonatomic, readwrite, strong, nullable) RotationView *overlayRotationView; @@ -32,8 +46,11 @@ @implementation Controller @synthesize hostView; @synthesize plotSymbolWindow; +@synthesize plotSymbolTestController; @synthesize axisDemoWindow; +@synthesize axisDemoController; @synthesize selectionDemoWindow; +@synthesize selectionDemoController; @synthesize graph; @synthesize overlayRotationView; @@ -64,12 +81,12 @@ -(void)awakeFromNib -(id)newObject { - NSNumber *x1 = @(1.0 + ( (NSMutableArray *)self.content ).count * 0.05); + NSNumber *x1 = @(1.0 + ((NSMutableArray *)self.content).count * 0.05); NSNumber *y1 = @(1.2 * arc4random() / (double)UINT32_MAX + 1.2); return @{ - @"x": x1, - @"y": y1 + @"x": x1, + @"y": y1 }; } @@ -80,9 +97,7 @@ -(void)setupGraph { // Create graph and apply a dark theme CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:NSRectToCGRect(self.hostView.bounds)]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; - [newGraph applyTheme:theme]; self.hostView.hostedGraph = newGraph; self.graph = newGraph; @@ -91,8 +106,8 @@ -(void)setupGraph NSString *lineTwo = @"This is the Second Line of the Title"; NSMutableAttributedString *graphTitle = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n%@", lineOne, lineTwo]]; - [graphTitle addAttribute:NSForegroundColorAttributeName value:[NSColor grayColor] range:NSMakeRange(0, lineOne.length)]; - [graphTitle addAttribute:NSForegroundColorAttributeName value:[NSColor darkGrayColor] range:NSMakeRange(lineOne.length + 1, lineTwo.length)]; + [graphTitle addAttribute:NSForegroundColorAttributeName value:[NSColor labelColor] range:NSMakeRange(0, lineOne.length)]; + [graphTitle addAttribute:NSForegroundColorAttributeName value:[NSColor secondaryLabelColor] range:NSMakeRange(lineOne.length + 1, lineTwo.length)]; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; paragraphStyle.alignment = CPTTextAlignmentCenter; [graphTitle addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, graphTitle.length)]; @@ -105,11 +120,14 @@ -(void)setupGraph newGraph.titleDisplacement = CGPointMake(0.0, 50.0); newGraph.titlePlotAreaFrameAnchor = CPTRectAnchorTop; + // newGraph.fill = [CPTFill fillWithColor:[CPTColor colorWithNSColor:[NSColor windowBackgroundColor]]]; + newGraph.plotAreaFrame.fill = [CPTFill fillWithColor:[CPTColor colorWithNSColor:[NSColor controlBackgroundColor]]]; + // Graph padding - newGraph.paddingLeft = 60.0; + newGraph.paddingLeft = 10.0; newGraph.paddingTop = 60.0; - newGraph.paddingRight = 60.0; - newGraph.paddingBottom = 60.0; + newGraph.paddingRight = 10.0; + newGraph.paddingBottom = 10.0; // Plot area delegate newGraph.plotAreaFrame.plotArea.delegate = self; @@ -126,33 +144,38 @@ -(void)setupAxes // Grid line styles CPTMutableLineStyle *majorGridLineStyle = [CPTMutableLineStyle lineStyle]; majorGridLineStyle.lineWidth = 0.75; - majorGridLineStyle.lineColor = [[CPTColor colorWithGenericGray:0.2] colorWithAlphaComponent:0.75]; + majorGridLineStyle.lineColor = [[CPTColor colorWithNSColor:[NSColor gridColor]] colorWithAlphaComponent:0.75]; CPTMutableLineStyle *minorGridLineStyle = [CPTMutableLineStyle lineStyle]; minorGridLineStyle.lineWidth = 0.25; - minorGridLineStyle.lineColor = [[CPTColor whiteColor] colorWithAlphaComponent:0.1]; + minorGridLineStyle.lineColor = [[CPTColor colorWithNSColor:[NSColor gridColor]] colorWithAlphaComponent:0.1]; CPTMutableLineStyle *redLineStyle = [CPTMutableLineStyle lineStyle]; redLineStyle.lineWidth = 10.0; - redLineStyle.lineColor = [[CPTColor redColor] colorWithAlphaComponent:0.5]; + redLineStyle.lineColor = [[CPTColor colorWithNSColor:[NSColor systemRedColor]] colorWithAlphaComponent:0.5]; // Axes // Label x axis with a fixed interval policy CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.graph.axisSet; CPTXYAxis *x = axisSet.xAxis; + + CPTMutableTextStyle *textStyle = [x.titleTextStyle mutableCopy]; + textStyle.color = [CPTColor colorWithNSColor:[NSColor secondaryLabelColor]]; + + x.labelTextStyle = textStyle; x.majorIntervalLength = @0.5; x.orthogonalPosition = @2.0; x.minorTicksPerInterval = 2; x.majorGridLineStyle = majorGridLineStyle; x.minorGridLineStyle = minorGridLineStyle; - CPTPlotRangeArray exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], - [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], - [CPTPlotRange plotRangeWithLocation:@2.99 length:@0.02]]; + CPTPlotRangeArray *exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@2.99 length:@0.02]]; x.labelExclusionRanges = exclusionRanges; NSMutableAttributedString *xTitle = [[NSMutableAttributedString alloc] initWithString:@"X Axis\nLine 2"]; - [xTitle addAttribute:NSForegroundColorAttributeName value:[NSColor whiteColor] range:NSMakeRange(0, 6)]; - [xTitle addAttribute:NSForegroundColorAttributeName value:[NSColor grayColor] range:NSMakeRange(7, 6)]; + [xTitle addAttribute:NSForegroundColorAttributeName value:[NSColor secondaryLabelColor] range:NSMakeRange(0, 6)]; + [xTitle addAttribute:NSForegroundColorAttributeName value:[NSColor tertiaryLabelColor] range:NSMakeRange(7, 6)]; NSMutableParagraphStyle *xParagraphStyle = [[NSMutableParagraphStyle alloc] init]; xParagraphStyle.alignment = CPTTextAlignmentCenter; [xTitle addAttribute:NSParagraphStyleAttributeName value:xParagraphStyle range:NSMakeRange(0, xTitle.length)]; @@ -164,6 +187,7 @@ -(void)setupAxes // Label y with an automatic label policy. CPTXYAxis *y = axisSet.yAxis; y.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + y.labelTextStyle = textStyle; y.orthogonalPosition = @2.0; y.minorTicksPerInterval = 2; y.preferredNumberOfMajorTicks = 8; @@ -176,8 +200,8 @@ -(void)setupAxes y.labelExclusionRanges = exclusionRanges; NSMutableAttributedString *yTitle = [[NSMutableAttributedString alloc] initWithString:@"Y Axis\nLine 2"]; - [yTitle addAttribute:NSForegroundColorAttributeName value:[NSColor whiteColor] range:NSMakeRange(0, 6)]; - [yTitle addAttribute:NSForegroundColorAttributeName value:[NSColor grayColor] range:NSMakeRange(7, 6)]; + [yTitle addAttribute:NSForegroundColorAttributeName value:[NSColor secondaryLabelColor] range:NSMakeRange(0, 6)]; + [yTitle addAttribute:NSForegroundColorAttributeName value:[NSColor tertiaryLabelColor] range:NSMakeRange(7, 6)]; NSMutableParagraphStyle *yParagraphStyle = [[NSMutableParagraphStyle alloc] init]; yParagraphStyle.alignment = CPTTextAlignmentCenter; [yTitle addAttribute:NSParagraphStyleAttributeName value:yParagraphStyle range:NSMakeRange(0, yTitle.length)]; @@ -192,6 +216,7 @@ -(void)setupAxes // Add an extra y axis (red) // We add constraints to this axis below CPTXYAxis *y2 = [[CPTXYAxis alloc] initWithFrame:CGRectZero]; + y2.labelingPolicy = CPTAxisLabelingPolicyAutomatic; y2.orthogonalPosition = @3.0; y2.minorTicksPerInterval = 0; @@ -206,8 +231,10 @@ -(void)setupAxes y2.minorTickLineStyle = nil; y2.labelTextStyle = nil; y2.visibleRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@3.0]; + y2.titleTextStyle = textStyle; y2.title = @"Y2 title"; y2.titleLocation = @3.0; + // Set axes self.graph.axisSet.axes = @[x, y, y2]; } @@ -232,17 +259,19 @@ -(void)setupScatterPlots [boundLinePlot bind:CPTScatterPlotBindingYValues toObject:self withKeyPath:@"arrangedObjects.y" options:nil]; // Put an area gradient under the plot above - CPTImage *fillImage = [CPTImage imageNamed:@"BlueTexture"]; - fillImage.tiled = YES; - CPTFill *areaImageFill = [CPTFill fillWithImage:fillImage]; - boundLinePlot.areaFill = areaImageFill; + CPTColor *areaColor = [CPTColor colorWithComponentRed:0.3 green:0.3 blue:1.0 alpha:0.8]; + CPTGradient *areaGradient = [CPTGradient gradientWithBeginningColor:areaColor endingColor:[CPTColor clearColor]]; + areaGradient.angle = -90.0; + CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; + + boundLinePlot.areaFill = areaGradientFill; boundLinePlot.areaBaseValue = @1.0; // Add plot symbols CPTMutableLineStyle *symbolLineStyle = [CPTMutableLineStyle lineStyle]; symbolLineStyle.lineColor = [CPTColor blackColor]; CPTPlotSymbol *plotSymbol = [CPTPlotSymbol ellipsePlotSymbol]; - plotSymbol.fill = [CPTFill fillWithColor:[CPTColor blueColor]]; + plotSymbol.fill = [CPTFill fillWithColor:[CPTColor colorWithNSColor:[NSColor systemBlueColor]]]; plotSymbol.lineStyle = symbolLineStyle; plotSymbol.size = CGSizeMake(10.0, 10.0); boundLinePlot.plotSymbol = plotSymbol; @@ -259,14 +288,14 @@ -(void)setupScatterPlots lineStyle = [dataSourceLinePlot.dataLineStyle mutableCopy]; lineStyle.lineWidth = 1.0; - lineStyle.lineColor = [CPTColor greenColor]; + lineStyle.lineColor = [CPTColor colorWithNSColor:[NSColor systemGreenColor]]; dataSourceLinePlot.dataLineStyle = lineStyle; dataSourceLinePlot.dataSource = self; - CPTMutableTextStyle *whiteTextStyle = [CPTMutableTextStyle textStyle]; - whiteTextStyle.color = [CPTColor whiteColor]; - dataSourceLinePlot.labelTextStyle = whiteTextStyle; + CPTMutableTextStyle *textStyle = [CPTMutableTextStyle textStyle]; + textStyle.color = [CPTColor colorWithNSColor:[NSColor secondaryLabelColor]]; + dataSourceLinePlot.labelTextStyle = textStyle; dataSourceLinePlot.labelOffset = 5.0; dataSourceLinePlot.labelRotation = M_PI_4; @@ -276,10 +305,11 @@ -(void)setupScatterPlots dataSourceLinePlot.interpolation = CPTScatterPlotInterpolationStepped; // Put an area gradient under the plot above - CPTColor *areaColor = [CPTColor colorWithComponentRed:0.3 green:1.0 blue:0.3 alpha:0.8]; - CPTGradient *areaGradient = [CPTGradient gradientWithBeginningColor:areaColor endingColor:[CPTColor clearColor]]; + areaColor = [CPTColor colorWithComponentRed:0.3 green:1.0 blue:0.3 alpha:0.8]; + areaGradient = [CPTGradient gradientWithBeginningColor:areaColor endingColor:[CPTColor clearColor]]; areaGradient.angle = -90.0; - CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; + areaGradientFill = [CPTFill fillWithGradient:areaGradient]; + dataSourceLinePlot.areaFill = areaGradientFill; dataSourceLinePlot.areaBaseValue = @1.75; @@ -338,15 +368,16 @@ -(void)setupBarPlots [self.graph addPlotSpace:barPlotSpace]; // First bar plot - CPTMutableTextStyle *whiteTextStyle = [CPTMutableTextStyle textStyle]; - whiteTextStyle.color = [CPTColor whiteColor]; + CPTMutableTextStyle *textStyle = [CPTMutableTextStyle textStyle]; + textStyle.color = [CPTColor colorWithNSColor:[NSColor secondaryLabelColor]]; + CPTBarPlot *barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor darkGrayColor] horizontalBars:YES]; barPlot.baseValue = @20.0; barPlot.dataSource = self; barPlot.barOffset = @(-0.25); barPlot.identifier = barPlot1; barPlot.plotRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@7.0]; - barPlot.labelTextStyle = whiteTextStyle; + barPlot.labelTextStyle = textStyle; [self.graph addPlot:barPlot toPlotSpace:barPlotSpace]; // Second bar plot @@ -364,14 +395,14 @@ -(void)setupBarPlots #pragma mark - #pragma mark Actions --(IBAction)reloadDataSourcePlot:(nullable id)sender +-(IBAction)reloadDataSourcePlot:(nullable id __unused)sender { CPTPlot *plot = [self.graph plotWithIdentifier:dataSourcePlot]; [plot reloadData]; } --(IBAction)removeData:(nullable id)sender +-(IBAction)removeData:(nullable id __unused)sender { NSUInteger index = self.selectionIndex; @@ -383,7 +414,7 @@ -(IBAction)removeData:(nullable id)sender } } --(IBAction)insertData:(nullable id)sender +-(IBAction)insertData:(nullable id __unused)sender { NSUInteger index = self.selectionIndex; @@ -414,7 +445,7 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum NSNumber *num; if ( [plot isKindOfClass:[CPTBarPlot class]] ) { - num = @( (index + 1) * (index + 1) ); + num = @((index + 1) * (index + 1)); if ( [plot.identifier isEqual:barPlot2] ) { num = @(num.integerValue - 10); } @@ -434,7 +465,7 @@ -(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUI if ( [(NSString *) plot.identifier isEqualToString:barPlot2] ) { return (id)[NSNull null]; // Don't show any label } - else if ( [(NSString *) plot.identifier isEqualToString:barPlot1] && (index < 4) ) { + else if ( [(NSString *) plot.identifier isEqualToString:barPlot1] && (index < 4)) { return (id)[NSNull null]; } else if ( index % 4 ) { @@ -448,7 +479,7 @@ -(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUI #pragma mark - #pragma mark CPTScatterPlot delegate method --(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index +-(void)scatterPlot:(nonnull CPTScatterPlot *__unused)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index { CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; @@ -459,7 +490,7 @@ -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordI // Setup a style for the annotation CPTMutableTextStyle *hitAnnotationTextStyle = [CPTMutableTextStyle textStyle]; - hitAnnotationTextStyle.color = [CPTColor whiteColor]; + hitAnnotationTextStyle.color = [CPTColor colorWithNSColor:[NSColor labelColor]]; hitAnnotationTextStyle.fontSize = CPTFloat(16.0); hitAnnotationTextStyle.fontName = @"Helvetica-Bold"; @@ -469,7 +500,7 @@ -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordI NSNumber *x = dataPoint[@"x"]; NSNumber *y = dataPoint[@"y"]; - CPTNumberArray anchorPoint = @[x, y]; + CPTNumberArray *anchorPoint = @[x, y]; // Add annotation // First make a string for the y value @@ -504,15 +535,16 @@ -(void)barPlot:(nonnull CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUIntege // Setup a style for the annotation CPTMutableTextStyle *hitAnnotationTextStyle = [CPTMutableTextStyle textStyle]; - hitAnnotationTextStyle.color = [CPTColor redColor]; + hitAnnotationTextStyle.color = [CPTColor colorWithNSColor:[NSColor labelColor]]; hitAnnotationTextStyle.fontSize = 16.0; hitAnnotationTextStyle.fontName = @"Helvetica-Bold"; // Determine point of symbol in plot coordinates - NSNumber *x = @0; - NSNumber *y = [self numberForPlot:plot field:0 recordIndex:index]; - CPTNumberArray anchorPoint = @[x, @(index)]; + NSNumber *x = @0; + NSNumber *y = [self numberForPlot:plot field:CPTBarPlotFieldBarLocation recordIndex:index]; + + CPTNumberArray *anchorPoint = @[x, @(index)]; // Add annotation // First make a string for the y value @@ -521,29 +553,44 @@ -(void)barPlot:(nonnull CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUIntege NSString *yString = [formatter stringFromNumber:y]; // Now add the annotation to the plot area - CPTPlotSpace *defaultSpace = self.graph.defaultPlotSpace; - if ( defaultSpace ) { + CPTPlotSpace *plotSpace = plot.plotSpace; + if ( plotSpace ) { CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:yString style:hitAnnotationTextStyle]; - annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:defaultSpace anchorPlotPoint:anchorPoint]; + annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:plotSpace anchorPlotPoint:anchorPoint]; annotation.contentLayer = textLayer; annotation.displacement = CGPointMake(0.0, 0.0); [self.graph.plotAreaFrame.plotArea addAnnotation:annotation]; self.symbolTextAnnotation = annotation; } - CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"barWidth"]; - animation.duration = 0.25; - animation.toValue = @0.0; - animation.repeatCount = 1; - animation.autoreverses = YES; - animation.removedOnCompletion = YES; - [plot addAnimation:animation forKey:@"barWidth"]; + const CGFloat duration = 0.25; + NSNumber *barWidth = plot.barWidth; + + if ( barWidth ) { + [CPTAnimation animate:plot + property:@"barWidth" + fromNumber:plot.barWidth + toNumber:@0.0 + duration:duration + withDelay:0.0 + animationCurve:CPTAnimationCurveDefault + delegate:nil]; + + [CPTAnimation animate:plot + property:@"barWidth" + fromNumber:nil + toNumber:barWidth + duration:duration + withDelay:duration + animationCurve:CPTAnimationCurveDefault + delegate:nil]; + } } #pragma mark - #pragma mark Plot area delegate method --(void)plotAreaWasSelected:(nonnull CPTPlotArea *)plotArea +-(void)plotAreaWasSelected:(nonnull CPTPlotArea *__unused)plotArea { // Remove the annotation CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; @@ -557,7 +604,7 @@ -(void)plotAreaWasSelected:(nonnull CPTPlotArea *)plotArea #pragma mark - #pragma mark PDF / image export --(IBAction)exportToPDF:(nullable id)sender +-(IBAction)exportToPDF:(nullable id __unused)sender { NSSavePanel *pdfSavingDialog = [NSSavePanel savePanel]; @@ -573,7 +620,7 @@ -(IBAction)exportToPDF:(nullable id)sender } } --(IBAction)exportToPNG:(nullable id)sender +-(IBAction)exportToPNG:(nullable id __unused)sender { NSSavePanel *pngSavingDialog = [NSSavePanel savePanel]; @@ -595,7 +642,7 @@ -(IBAction)exportToPNG:(nullable id)sender #pragma mark - #pragma mark Printing --(IBAction)printDocument:(nullable id)sender +-(IBAction)printDocument:(nullable id __unused)sender { NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo]; @@ -617,15 +664,15 @@ -(IBAction)printDocument:(nullable id)sender } } --(void)printOperationDidRun:(nonnull NSPrintOperation *)printOperation success:(BOOL)success contextInfo:(nullable void *)contextInfo +-(void)printOperationDidRun:(nonnull NSPrintOperation *__unused)printOperation success:(BOOL __unused)success contextInfo:(nullable void *__unused)contextInfo { - // print delegate +// print delegate } #pragma mark - #pragma mark Layer exploding for illustration --(IBAction)explodeLayers:(nullable id)sender +-(IBAction)explodeLayers:(nullable id __unused)sender { CATransform3D perspectiveRotation = CATransform3DMakeRotation(-40.0 * M_PI / 180.0, 0.0, 1.0, 0.0); @@ -640,7 +687,7 @@ -(IBAction)explodeLayers:(nullable id)sender overlayView.rotationDelegate = self; overlayView.rotationTransform = perspectiveRotation; overlayView.autoresizingMask = self.hostView.autoresizingMask; - [(self.hostView).superview addSubview:overlayView positioned:NSWindowAbove relativeTo:self.hostView]; + [self.hostView.superview addSubview:overlayView positioned:NSWindowAbove relativeTo:self.hostView]; self.overlayRotationView = overlayView; [CATransaction begin]; @@ -664,7 +711,7 @@ +(void)recursivelySplitSublayersInZForLayer:(nonnull CALayer *)layer depthLevel: } } --(IBAction)reassembleLayers:(nullable id)sender +-(IBAction)reassembleLayers:(nullable id __unused)sender { [CATransaction begin]; [CATransaction setValue:@1.0f forKey:kCATransactionAnimationDuration]; @@ -694,31 +741,70 @@ +(void)recursivelyAssembleSublayersInZForLayer:(nonnull CALayer *)layer -(IBAction)plotSymbolDemo:(nullable id)sender { if ( !self.plotSymbolWindow ) { - [NSBundle loadNibNamed:@"PlotSymbolDemo" owner:self]; + [[NSBundle mainBundle] loadNibNamed:@"PlotSymbolDemo" + owner:self + topLevelObjects:nil]; } NSWindow *window = self.plotSymbolWindow; [window makeKeyAndOrderFront:sender]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(plotSymbolWindowClosed) + name:NSWindowWillCloseNotification + object:window]; } -(IBAction)axisDemo:(nullable id)sender { if ( !self.axisDemoWindow ) { - [NSBundle loadNibNamed:@"AxisDemo" owner:self]; + [[NSBundle mainBundle] loadNibNamed:@"AxisDemo" + owner:self + topLevelObjects:nil]; } NSWindow *window = self.axisDemoWindow; [window makeKeyAndOrderFront:sender]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(axisDemoWindowClosed) + name:NSWindowWillCloseNotification + object:window]; } -(IBAction)selectionDemo:(nullable id)sender { if ( !self.selectionDemoWindow ) { - [NSBundle loadNibNamed:@"SelectionDemo" owner:self]; + [[NSBundle mainBundle] loadNibNamed:@"SelectionDemo" + owner:self + topLevelObjects:nil]; } NSWindow *window = self.selectionDemoWindow; [window makeKeyAndOrderFront:sender]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(selectionDemoWindowClosed) + name:NSWindowWillCloseNotification + object:window]; +} + +-(void)plotSymbolWindowClosed +{ + self.plotSymbolWindow = nil; + self.plotSymbolTestController = nil; +} + +-(void)axisDemoWindowClosed +{ + self.axisDemoWindow = nil; + self.axisDemoController = nil; +} + +-(void)selectionDemoWindowClosed +{ + self.selectionDemoWindow = nil; + self.selectionDemoController = nil; } #pragma mark - @@ -759,7 +845,7 @@ -(void)setLabelRotation:(CGFloat)newRotation { labelRotation = newRotation; - ( (CPTXYAxisSet *)self.graph.axisSet ).yAxis.labelRotation = newRotation; + ((CPTXYAxisSet *)self.graph.axisSet).yAxis.labelRotation = newRotation; [self.graph plotWithIdentifier:dataSourcePlot].labelRotation = newRotation; } diff --git a/examples/CPTTestApp/Source/RotationView.h b/examples/CPTTestApp/Source/RotationView.h index 80f9a40eb..0ec33c63c 100644 --- a/examples/CPTTestApp/Source/RotationView.h +++ b/examples/CPTTestApp/Source/RotationView.h @@ -17,4 +17,5 @@ @protocol CPTRotationDelegate -(void)rotateObjectUsingTransform:(CATransform3D)rotationTransform; + @end diff --git a/examples/CPTTestApp/Source/RotationView.m b/examples/CPTTestApp/Source/RotationView.m index f65a18c17..68b892fab 100644 --- a/examples/CPTTestApp/Source/RotationView.m +++ b/examples/CPTTestApp/Source/RotationView.m @@ -20,7 +20,7 @@ @implementation RotationView -(nonnull instancetype)initWithFrame:(NSRect)frame { - if ( (self = [super initWithFrame:frame]) ) { + if ((self = [super initWithFrame:frame])) { rotationTransform = CATransform3DIdentity; // Initialization code here. } @@ -30,7 +30,7 @@ -(nonnull instancetype)initWithFrame:(NSRect)frame #pragma mark - #pragma mark Mouse handling methods --(BOOL)acceptsFirstMouse:(nullable NSEvent *)theEvent +-(BOOL)acceptsFirstMouse:(nullable NSEvent *__unused)theEvent { return YES; } @@ -50,12 +50,13 @@ -(void)mouseDragged:(nonnull NSEvent *)theEvent CGFloat totalRotation = sqrt(displacementInX * displacementInX + displacementInY * displacementInY); CATransform3D oldTransform = self.rotationTransform; - CATransform3D newTransform = CATransform3DRotate( oldTransform, totalRotation * M_PI / 180.0, - ( (displacementInX / totalRotation) * oldTransform.m12 + (displacementInY / totalRotation) * oldTransform.m11 ), - ( (displacementInX / totalRotation) * oldTransform.m22 + (displacementInY / totalRotation) * oldTransform.m21 ), - ( (displacementInX / totalRotation) * oldTransform.m32 + (displacementInY / totalRotation) * oldTransform.m31 ) ); + CATransform3D newTransform = CATransform3DRotate(oldTransform, totalRotation * M_PI / 180.0, + ((displacementInX / totalRotation) * oldTransform.m12 + (displacementInY / totalRotation) * oldTransform.m11), + ((displacementInX / totalRotation) * oldTransform.m22 + (displacementInY / totalRotation) * oldTransform.m21), + ((displacementInX / totalRotation) * oldTransform.m32 + (displacementInY / totalRotation) * oldTransform.m31)); id theDelegate = self.rotationDelegate; + [theDelegate rotateObjectUsingTransform:newTransform]; self.rotationTransform = newTransform; diff --git a/examples/CPTTestApp/Source/SelectionDemoController.h b/examples/CPTTestApp/Source/SelectionDemoController.h index d4e3be7dc..a94d0e322 100644 --- a/examples/CPTTestApp/Source/SelectionDemoController.h +++ b/examples/CPTTestApp/Source/SelectionDemoController.h @@ -1,6 +1,8 @@ #import #import -@interface SelectionDemoController : NSObject +@interface SelectionDemoController : NSObject @end diff --git a/examples/CPTTestApp/Source/SelectionDemoController.m b/examples/CPTTestApp/Source/SelectionDemoController.m index 088ca6cd9..bcf2fdde1 100644 --- a/examples/CPTTestApp/Source/SelectionDemoController.m +++ b/examples/CPTTestApp/Source/SelectionDemoController.m @@ -266,7 +266,7 @@ -(nullable CPTPlotSymbol *)symbolForScatterPlot:(nonnull CPTScatterPlot *)plot r CPTPlotSymbol *symbol = (id)[NSNull null]; - if ( [(NSString *) plot.identifier isEqualToString:SELECTION_PLOT] && (index == 2) ) { + if ( [(NSString *) plot.identifier isEqualToString:SELECTION_PLOT] && (index == 2)) { if ( !redDot ) { redDot = [[CPTPlotSymbol alloc] init]; redDot.symbolType = CPTPlotSymbolTypeEllipse; @@ -282,7 +282,7 @@ -(nullable CPTPlotSymbol *)symbolForScatterPlot:(nonnull CPTScatterPlot *)plot r #pragma mark - #pragma mark CPTScatterPlot delegate methods --(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index +-(void)scatterPlot:(nonnull CPTScatterPlot *__unused)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index { self.selectedIndex = index; } @@ -296,6 +296,7 @@ -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDownEve self.selectedIndex = NSUIntegerMax; return YES; } + #endif #pragma mark - diff --git a/examples/CPTTestApp/English.lproj/InfoPlist.strings b/examples/CPTTestApp/en.lproj/InfoPlist.strings similarity index 100% rename from examples/CPTTestApp/English.lproj/InfoPlist.strings rename to examples/CPTTestApp/en.lproj/InfoPlist.strings diff --git a/examples/CorePlotExamples.xcworkspace/contents.xcworkspacedata b/examples/CorePlotExamples.xcworkspace/contents.xcworkspacedata index df38f3d5a..a9ec2bf00 100644 --- a/examples/CorePlotExamples.xcworkspace/contents.xcworkspacedata +++ b/examples/CorePlotExamples.xcworkspace/contents.xcworkspacedata @@ -30,18 +30,12 @@ - - - - + + + + IDEDidComputeMac32BitWarning + + + diff --git a/examples/CorePlotExamples.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/examples/CorePlotExamples.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..0c67376eb --- /dev/null +++ b/examples/CorePlotExamples.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,5 @@ + + + + + diff --git a/examples/CorePlotGallery/Plot_Gallery_Mac-Info.plist b/examples/CorePlotGallery/Base.lproj/Plot_Gallery_Mac-Info.plist similarity index 94% rename from examples/CorePlotGallery/Plot_Gallery_Mac-Info.plist rename to examples/CorePlotGallery/Base.lproj/Plot_Gallery_Mac-Info.plist index b0cb1bbde..0bd38f049 100644 --- a/examples/CorePlotGallery/Plot_Gallery_Mac-Info.plist +++ b/examples/CorePlotGallery/Base.lproj/Plot_Gallery_Mac-Info.plist @@ -20,6 +20,8 @@ ???? CFBundleVersion 1 + LSApplicationCategoryType + LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSMainNibFile diff --git a/examples/CorePlotGallery/Plot_Gallery_iOS-Info.plist b/examples/CorePlotGallery/Base.lproj/Plot_Gallery_iOS-Info.plist similarity index 100% rename from examples/CorePlotGallery/Plot_Gallery_iOS-Info.plist rename to examples/CorePlotGallery/Base.lproj/Plot_Gallery_iOS-Info.plist diff --git a/examples/AAPLot/Info.plist b/examples/CorePlotGallery/Base.lproj/Plot_Gallery_tvOS-Info.plist similarity index 60% rename from examples/AAPLot/Info.plist rename to examples/CorePlotGallery/Base.lproj/Plot_Gallery_tvOS-Info.plist index 4081ec7d1..4f338601b 100644 --- a/examples/AAPLot/Info.plist +++ b/examples/CorePlotGallery/Base.lproj/Plot_Gallery_tvOS-Info.plist @@ -3,34 +3,30 @@ CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} + en CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIcons~ipad - + $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName - ${PRODUCT_NAME} + $(PRODUCT_NAME) CFBundlePackageType APPL + CFBundleShortVersionString + 1.0 CFBundleSignature ???? CFBundleVersion - 1.0 + 1 LSRequiresIPhoneOS - NSMainNibFile - MainWindow - UILaunchStoryboardName - Launch Screen - UISupportedInterfaceOrientations + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities - UIInterfaceOrientationPortrait + arm64 diff --git a/examples/CorePlotGallery/Plot Gallery-Mac/PlotViewItem.xib b/examples/CorePlotGallery/Plot Gallery-Mac/PlotViewItem.xib new file mode 100644 index 000000000..047384075 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-Mac/PlotViewItem.xib @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/Contents.json index 853a3c734..b3e167fda 100644 --- a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "size" : "29x29", "idiom" : "iphone", @@ -54,6 +64,16 @@ "filename" : "Icon-60@3x.png", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "idiom" : "ipad", "size" : "29x29", @@ -116,6 +136,12 @@ "idiom" : "ipad", "filename" : "Icon-iPadPro@2x.png", "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "iTunesArtwork.png", + "scale" : "1x" } ], "info" : { diff --git a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png new file mode 100644 index 000000000..228e5b861 Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/Contents.json b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/AAPLot/AAPLot/Images.xcassets/LaunchImage.launchimage/Contents.json b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/LaunchImage.launchimage/Contents.json similarity index 88% rename from examples/AAPLot/AAPLot/Images.xcassets/LaunchImage.launchimage/Contents.json rename to examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/LaunchImage.launchimage/Contents.json index 3dd8aa5b6..6d2d4295e 100644 --- a/examples/AAPLot/AAPLot/Images.xcassets/LaunchImage.launchimage/Contents.json +++ b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -1,5 +1,21 @@ { "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "11.0", + "subtype" : "2436h", + "scale" : "3x" + }, + { + "orientation" : "landscape", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "11.0", + "subtype" : "2436h", + "scale" : "3x" + }, { "orientation" : "portrait", "idiom" : "iphone", diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..7aa641214 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "PlotGalleryLargeIconBack.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/PlotGalleryLargeIconBack.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/PlotGalleryLargeIconBack.png new file mode 100644 index 000000000..cb50a05bc Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/PlotGalleryLargeIconBack.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json new file mode 100644 index 000000000..cf8282aa5 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json @@ -0,0 +1,14 @@ +{ + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..f9614e449 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "PlotGalleryLargeIconFront.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/PlotGalleryLargeIconFront.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/PlotGalleryLargeIconFront.png new file mode 100644 index 000000000..43e6f1300 Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/PlotGalleryLargeIconFront.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..2f7e2f531 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "PlotGallerySmallIconBack.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/PlotGallerySmallIconBack.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/PlotGallerySmallIconBack.png new file mode 100644 index 000000000..9f511b9bc Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/PlotGallerySmallIconBack.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json new file mode 100644 index 000000000..cf8282aa5 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json @@ -0,0 +1,14 @@ +{ + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..387ff905b --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "PlotGallerySmallIconFront.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/PlotGallerySmallIconFront.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/PlotGallerySmallIconFront.png new file mode 100644 index 000000000..51a34de0f Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/PlotGallerySmallIconFront.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json new file mode 100644 index 000000000..dea6e49fd --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json @@ -0,0 +1,32 @@ +{ + "assets" : [ + { + "size" : "1280x768", + "idiom" : "tv", + "filename" : "App Icon - Large.imagestack", + "role" : "primary-app-icon" + }, + { + "size" : "400x240", + "idiom" : "tv", + "filename" : "App Icon - Small.imagestack", + "role" : "primary-app-icon" + }, + { + "size" : "2320x720", + "idiom" : "tv", + "filename" : "Top Shelf Image Wide.imageset", + "role" : "top-shelf-image-wide" + }, + { + "size" : "1920x720", + "idiom" : "tv", + "filename" : "Top Shelf Image.imageset", + "role" : "top-shelf-image" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json new file mode 100644 index 000000000..16a370df0 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json new file mode 100644 index 000000000..167022b51 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "PlotGalleryTopShelf.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/PlotGalleryTopShelf.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/PlotGalleryTopShelf.png new file mode 100644 index 000000000..ea9cef263 Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/PlotGalleryTopShelf.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 000000000..f4a929b0d --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "landscape", + "idiom" : "tv", + "extent" : "full-screen", + "minimum-system-version" : "11.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "tv", + "filename" : "LaunchImage.png", + "extent" : "full-screen", + "minimum-system-version" : "9.0", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/LaunchImage.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/LaunchImage.png new file mode 100644 index 000000000..d0ba363b2 Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/LaunchImage.png differ diff --git a/examples/CorePlotGallery/Plot_Gallery.xcodeproj/project.pbxproj b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/project.pbxproj index d70c93309..5fc2950c5 100644 --- a/examples/CorePlotGallery/Plot_Gallery.xcodeproj/project.pbxproj +++ b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/project.pbxproj @@ -9,8 +9,6 @@ /* Begin PBXBuildFile section */ 4F22FF4912342978006BF615 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF4712342978006BF615 /* main.m */; }; 4F22FF4C1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF4B1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m */; }; - 4F22FF5B12342A21006BF615 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4F22FF5712342A21006BF615 /* InfoPlist.strings */; }; - 4F22FF5C12342A21006BF615 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4F22FF5912342A21006BF615 /* MainMenu.xib */; }; 4F22FFA412342D7C006BF615 /* CompositePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9B12342D7C006BF615 /* CompositePlot.m */; }; 4F22FFA512342D7C006BF615 /* GradientScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */; }; 4F22FFA612342D7C006BF615 /* SimplePieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */; }; @@ -19,7 +17,6 @@ 4F22FFAF12342DB1006BF615 /* PlotGallery.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAC12342DB1006BF615 /* PlotGallery.m */; }; 4F22FFB012342DB1006BF615 /* PlotItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAE12342DB1006BF615 /* PlotItem.m */; }; 4F22FFE8123431D2006BF615 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F22FFE7123431D2006BF615 /* Quartz.framework */; }; - 4F35EBBD12360D89007C3389 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4F35EBBC12360D89007C3389 /* Icon.icns */; }; 4F35EBF7123611E3007C3389 /* PlotGalleryController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F35EBF4123611E3007C3389 /* PlotGalleryController.m */; }; 4F35EBF8123611E3007C3389 /* PlotView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F35EBF6123611E3007C3389 /* PlotView.m */; }; 4F8E1C14129077C200D2035F /* DatePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C13129077C200D2035F /* DatePlot.m */; }; @@ -28,62 +25,105 @@ 4FABDD421291110D003A2DB7 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F4892891290FFCD00EDB93F /* CorePlot.framework */; }; 4FABDD4612911127003A2DB7 /* CorePlot.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 4F4892891290FFCD00EDB93F /* CorePlot.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + C309C23423B3E12500DEDE9D /* PlotViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = C309C23323B3E12500DEDE9D /* PlotViewItem.xib */; }; + C309C23623B3E21500DEDE9D /* PlotViewItem.m in Sources */ = {isa = PBXBuildFile; fileRef = C309C23523B3E21500DEDE9D /* PlotViewItem.m */; }; C30B12431BCADD300084C567 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3D4146F1A7D824700B6F5D6 /* CorePlot.framework */; }; C30B12441BCADD300084C567 /* CorePlot.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C3D4146F1A7D824700B6F5D6 /* CorePlot.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - C30B12481BCADE170084C567 /* PlotItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAE12342DB1006BF615 /* PlotItem.m */; settings = {ASSET_TAGS = (); }; }; - C30B12491BCADE170084C567 /* PlotGallery.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAC12342DB1006BF615 /* PlotGallery.m */; settings = {ASSET_TAGS = (); }; }; - C30B124A1BCADE170084C567 /* PiNumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */; settings = {ASSET_TAGS = (); }; }; + C30B12481BCADE170084C567 /* PlotItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAE12342DB1006BF615 /* PlotItem.m */; }; + C30B12491BCADE170084C567 /* PlotGallery.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAC12342DB1006BF615 /* PlotGallery.m */; }; + C30B124A1BCADE170084C567 /* PiNumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */; }; + C30D8AFA1BCAF99D0003BB70 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C30D8AF91BCAF99D0003BB70 /* main.m */; }; + C30D8AFD1BCAF99D0003BB70 /* AppDelegateTV.m in Sources */ = {isa = PBXBuildFile; fileRef = C30D8AFC1BCAF99D0003BB70 /* AppDelegateTV.m */; }; + C30D8B081BCAF99D0003BB70 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C30D8B071BCAF99D0003BB70 /* Assets.xcassets */; }; + C30D8B211BCAFD3E0003BB70 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */; }; + C30D8B221BCAFD3E0003BB70 /* PlotItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAE12342DB1006BF615 /* PlotItem.m */; }; + C30D8B231BCAFD3E0003BB70 /* PlotGallery.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAC12342DB1006BF615 /* PlotGallery.m */; }; + C30D8B241BCAFD3E0003BB70 /* PiNumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */; }; + C30D8B251BCAFDE20003BB70 /* AxisDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1CC112908B0000D2035F /* AxisDemo.m */; }; + C30D8B261BCAFDE20003BB70 /* CandlestickPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */; }; + C30D8B271BCAFDE20003BB70 /* ColoredBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */; }; + C30D8B281BCAFDE20003BB70 /* CompositePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9B12342D7C006BF615 /* CompositePlot.m */; }; + C30D8B291BCAFDE20003BB70 /* ControlChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C35597951437E07800B41DA7 /* ControlChart.m */; }; + C30D8B2A1BCAFDE20003BB70 /* CurvedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */; }; + C30D8B2B1BCAFDE20003BB70 /* DatePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C13129077C200D2035F /* DatePlot.m */; }; + C30D8B2C1BCAFDE20003BB70 /* DonutChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F34F1412AB2598008FBDC3 /* DonutChart.m */; }; + C30D8B2D1BCAFDE20003BB70 /* FunctionPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */; }; + C30D8B2E1BCAFDE20003BB70 /* GradientScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */; }; + C30D8B2F1BCAFDE20003BB70 /* ImageDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D70BA5175EB29E00F27173 /* ImageDemo.m */; }; + C30D8B301BCAFDE20003BB70 /* LabelingPolicyDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */; }; + C30D8B311BCAFDE20003BB70 /* LineCapDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C367249213E103910070F47A /* LineCapDemo.m */; }; + C30D8B321BCAFDE20003BB70 /* OHLCPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1C513B18AAF007994B6 /* OHLCPlot.m */; }; + C30D8B331BCAFDE20003BB70 /* PlotSpaceDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */; }; + C30D8B341BCAFDE20003BB70 /* RangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A14BEB13AEB7E700D103EA /* RangePlot.m */; }; + C30D8B351BCAFDE20003BB70 /* RealTimePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */; }; + C30D8B361BCAFDE20003BB70 /* SteppedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C85129083B000D2035F /* SteppedScatterPlot.m */; }; + C30D8B371BCAFDE20003BB70 /* SimplePieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */; }; + C30D8B381BCAFDE20003BB70 /* SimpleScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA112342D7C006BF615 /* SimpleScatterPlot.m */; }; + C30D8B391BCAFDE20003BB70 /* VerticalBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA312342D7C006BF615 /* VerticalBarChart.m */; }; + C30D8B3D1BCAFFB50003BB70 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C30D8B3C1BCAFFB50003BB70 /* CoreGraphics.framework */; }; + C30D8B3F1BCAFFBB0003BB70 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C30D8B3E1BCAFFBB0003BB70 /* QuartzCore.framework */; }; + C30D8B411BCAFFC10003BB70 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C30D8B401BCAFFC10003BB70 /* Foundation.framework */; }; + C30D8B431BCAFFCB0003BB70 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C30D8B421BCAFFCB0003BB70 /* UIKit.framework */; }; + C32D229E23B1086600043720 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = C32D229C23B1086600043720 /* MainMenu.xib */; }; C3457A4D17AD7C5D000880F3 /* PiNumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */; }; - C34CB5461BC9A83C009270A0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C34CB5451BC9A83C009270A0 /* Images.xcassets */; settings = {ASSET_TAGS = (); }; }; - C34CB5541BC9A889009270A0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB5481BC9A889009270A0 /* AppDelegate.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5551BC9A889009270A0 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB54A1BC9A889009270A0 /* DetailViewController.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5561BC9A889009270A0 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C34CB54B1BC9A889009270A0 /* Launch Screen.xib */; settings = {ASSET_TAGS = (); }; }; - C34CB5571BC9A889009270A0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB54C1BC9A889009270A0 /* main.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5581BC9A889009270A0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C34CB54D1BC9A889009270A0 /* Main.storyboard */; settings = {ASSET_TAGS = (); }; }; - C34CB55A1BC9A889009270A0 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB5511BC9A889009270A0 /* RootViewController.m */; settings = {ASSET_TAGS = (); }; }; - C34CB55B1BC9A889009270A0 /* ThemeTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB5531BC9A889009270A0 /* ThemeTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + C3490DD820E025760089F309 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = C3490DDA20E025760089F309 /* Icon.icns */; }; + C34CB5461BC9A83C009270A0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C34CB5451BC9A83C009270A0 /* Images.xcassets */; }; + C34CB5541BC9A889009270A0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB5481BC9A889009270A0 /* AppDelegate.m */; }; + C34CB5551BC9A889009270A0 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB54A1BC9A889009270A0 /* DetailViewController.m */; }; + C34CB5571BC9A889009270A0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB54C1BC9A889009270A0 /* main.m */; }; + C34CB55A1BC9A889009270A0 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB5511BC9A889009270A0 /* RootViewController.m */; }; + C34CB55B1BC9A889009270A0 /* ThemeTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB5531BC9A889009270A0 /* ThemeTableViewController.m */; }; C34CB5601BC9AB7B009270A0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C34CB55F1BC9AB7B009270A0 /* Foundation.framework */; }; C34CB5621BC9AB85009270A0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C34CB5611BC9AB85009270A0 /* UIKit.framework */; }; C34CB5641BC9AB8C009270A0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C34CB5631BC9AB8C009270A0 /* CoreGraphics.framework */; }; C34CB5661BC9AB93009270A0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C34CB5651BC9AB93009270A0 /* QuartzCore.framework */; }; - C34CB5681BC9AB9E009270A0 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C34CB5671BC9AB9E009270A0 /* Accelerate.framework */; }; - C34CB57C1BC9B1C1009270A0 /* AxisDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1CC112908B0000D2035F /* AxisDemo.m */; settings = {ASSET_TAGS = (); }; }; - C34CB57D1BC9B1C1009270A0 /* CandlestickPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */; settings = {ASSET_TAGS = (); }; }; - C34CB57E1BC9B1C1009270A0 /* ColoredBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */; settings = {ASSET_TAGS = (); }; }; - C34CB57F1BC9B1C1009270A0 /* CompositePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9B12342D7C006BF615 /* CompositePlot.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5801BC9B1C1009270A0 /* ControlChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C35597951437E07800B41DA7 /* ControlChart.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5811BC9B1C1009270A0 /* CurvedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5821BC9B1C1009270A0 /* DatePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C13129077C200D2035F /* DatePlot.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5831BC9B1C1009270A0 /* DonutChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F34F1412AB2598008FBDC3 /* DonutChart.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5841BC9B1C1009270A0 /* FunctionPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5851BC9B1C1009270A0 /* GradientScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5861BC9B1C1009270A0 /* ImageDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D70BA5175EB29E00F27173 /* ImageDemo.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5871BC9B1C1009270A0 /* LabelingPolicyDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5881BC9B1C1009270A0 /* LineCapDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C367249213E103910070F47A /* LineCapDemo.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5891BC9B1C1009270A0 /* OHLCPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1C513B18AAF007994B6 /* OHLCPlot.m */; settings = {ASSET_TAGS = (); }; }; - C34CB58A1BC9B1C1009270A0 /* PlotSpaceDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */; settings = {ASSET_TAGS = (); }; }; - C34CB58B1BC9B1C1009270A0 /* RangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A14BEB13AEB7E700D103EA /* RangePlot.m */; settings = {ASSET_TAGS = (); }; }; - C34CB58C1BC9B1C1009270A0 /* RealTimePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */; settings = {ASSET_TAGS = (); }; }; - C34CB58D1BC9B1C1009270A0 /* SteppedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C85129083B000D2035F /* SteppedScatterPlot.m */; settings = {ASSET_TAGS = (); }; }; - C34CB58E1BC9B1C1009270A0 /* SimplePieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */; settings = {ASSET_TAGS = (); }; }; - C34CB58F1BC9B1C1009270A0 /* SimpleScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA112342D7C006BF615 /* SimpleScatterPlot.m */; settings = {ASSET_TAGS = (); }; }; - C34CB5901BC9B1C1009270A0 /* VerticalBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA312342D7C006BF615 /* VerticalBarChart.m */; settings = {ASSET_TAGS = (); }; }; + C34CB57C1BC9B1C1009270A0 /* AxisDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1CC112908B0000D2035F /* AxisDemo.m */; }; + C34CB57D1BC9B1C1009270A0 /* CandlestickPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */; }; + C34CB57E1BC9B1C1009270A0 /* ColoredBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */; }; + C34CB57F1BC9B1C1009270A0 /* CompositePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9B12342D7C006BF615 /* CompositePlot.m */; }; + C34CB5801BC9B1C1009270A0 /* ControlChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C35597951437E07800B41DA7 /* ControlChart.m */; }; + C34CB5811BC9B1C1009270A0 /* CurvedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */; }; + C34CB5821BC9B1C1009270A0 /* DatePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C13129077C200D2035F /* DatePlot.m */; }; + C34CB5831BC9B1C1009270A0 /* DonutChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F34F1412AB2598008FBDC3 /* DonutChart.m */; }; + C34CB5841BC9B1C1009270A0 /* FunctionPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */; }; + C34CB5851BC9B1C1009270A0 /* GradientScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */; }; + C34CB5861BC9B1C1009270A0 /* ImageDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D70BA5175EB29E00F27173 /* ImageDemo.m */; }; + C34CB5871BC9B1C1009270A0 /* LabelingPolicyDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */; }; + C34CB5881BC9B1C1009270A0 /* LineCapDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C367249213E103910070F47A /* LineCapDemo.m */; }; + C34CB5891BC9B1C1009270A0 /* OHLCPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1C513B18AAF007994B6 /* OHLCPlot.m */; }; + C34CB58A1BC9B1C1009270A0 /* PlotSpaceDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */; }; + C34CB58B1BC9B1C1009270A0 /* RangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A14BEB13AEB7E700D103EA /* RangePlot.m */; }; + C34CB58C1BC9B1C1009270A0 /* RealTimePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */; }; + C34CB58D1BC9B1C1009270A0 /* SteppedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C85129083B000D2035F /* SteppedScatterPlot.m */; }; + C34CB58E1BC9B1C1009270A0 /* SimplePieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */; }; + C34CB58F1BC9B1C1009270A0 /* SimpleScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA112342D7C006BF615 /* SimpleScatterPlot.m */; }; + C34CB5901BC9B1C1009270A0 /* VerticalBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA312342D7C006BF615 /* VerticalBarChart.m */; }; C354C0D713C7CDBE00DA8822 /* RealTimePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */; }; C35597961437E07800B41DA7 /* ControlChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C35597951437E07800B41DA7 /* ControlChart.m */; }; + C357EA9D1F708E870060CF48 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C30D8B181BCAF99D0003BB70 /* CorePlot.framework */; }; C360E1C613B18AAF007994B6 /* OHLCPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1C513B18AAF007994B6 /* OHLCPlot.m */; }; C360E1E013B18CAF007994B6 /* CandlestickPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */; }; C367249313E103910070F47A /* LineCapDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C367249213E103910070F47A /* LineCapDemo.m */; }; - C367EEE21BCAEA9E00A21FE7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */; settings = {ASSET_TAGS = (); }; }; + C367EEE21BCAEA9E00A21FE7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */; }; C39C4E4113BFE1A900CD9194 /* LabelingPolicyDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */; }; C39C4E4413BFE1B400CD9194 /* PlotSpaceDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */; }; C3A14BEC13AEB7E700D103EA /* RangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A14BEB13AEB7E700D103EA /* RangePlot.m */; }; C3A31A5614DF782A00734AB7 /* ColoredBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */; }; C3AC1410150EDE5C00631001 /* CurvedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */; }; + C3B9C26F1BCB237000BD560B /* DetailViewControllerTV.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B9C26A1BCB237000BD560B /* DetailViewControllerTV.m */; }; + C3B9C2701BCB237000BD560B /* RootViewControllerTV.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B9C26C1BCB237000BD560B /* RootViewControllerTV.m */; }; + C3B9C2711BCB237000BD560B /* ThemeTableViewControllerTV.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B9C26E1BCB237000BD560B /* ThemeTableViewControllerTV.m */; }; + C3D0A1B720E0187600BA2921 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1B920E0187600BA2921 /* Main.storyboard */; }; + C3D0A1C420E0188800BA2921 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1C620E0188800BA2921 /* Launch Screen.xib */; }; + C3D0A1C820E018DE00BA2921 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1CA20E018DE00BA2921 /* Main.storyboard */; }; C3D2FE6319FF1D03002CD4D6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */; }; C3D70BA6175EB29E00F27173 /* ImageDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D70BA5175EB29E00F27173 /* ImageDemo.m */; }; C3EF42FD19FC75810060791A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3EF42FC19FC75810060791A /* Images.xcassets */; }; C3F34F1512AB2598008FBDC3 /* DonutChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F34F1412AB2598008FBDC3 /* DonutChart.m */; }; + C3F6216C1C9F365100301061 /* CurvedInterpolationDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = E9595DFB1C9973B9004129DA /* CurvedInterpolationDemo.m */; }; C3F97F1917A9DE2000A52FF2 /* FunctionPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */; }; + E9595DFC1C9973B9004129DA /* CurvedInterpolationDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = E9595DFB1C9973B9004129DA /* CurvedInterpolationDemo.m */; }; + E9AB989C1C9A903700D23875 /* CurvedInterpolationDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = E9595DFB1C9973B9004129DA /* CurvedInterpolationDemo.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -115,6 +155,27 @@ remoteGlobalIDString = C38A09771A46185200D45436; remoteInfo = "CorePlot iOS"; }; + C30D8B171BCAF99D0003BB70 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C30D8B191BCAF99D0003BB70 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; + C30D8B1E1BCAFC080003BB70 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = C37EA5C91BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; C34CB5791BC9B0D4009270A0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; @@ -184,10 +245,7 @@ 4F22FF4712342978006BF615 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/mac/main.m; sourceTree = ""; }; 4F22FF4A1234298E006BF615 /* Plot_Gallery_MacAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Plot_Gallery_MacAppDelegate.h; path = src/mac/Plot_Gallery_MacAppDelegate.h; sourceTree = ""; }; 4F22FF4B1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Plot_Gallery_MacAppDelegate.m; path = src/mac/Plot_Gallery_MacAppDelegate.m; sourceTree = ""; }; - 4F22FF5812342A21006BF615 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = InfoPlist.strings; sourceTree = ""; }; - 4F22FF5A12342A21006BF615 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = MainMenu.xib; sourceTree = ""; }; 4F22FF7B12342B5A006BF615 /* Plot_Gallery_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Plot_Gallery_Prefix.pch; sourceTree = ""; }; - 4F22FF7C12342B6E006BF615 /* Plot_Gallery_Mac-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Plot_Gallery_Mac-Info.plist"; sourceTree = ""; }; 4F22FF9A12342D7C006BF615 /* CompositePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = CompositePlot.h; path = src/plots/CompositePlot.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 4F22FF9B12342D7C006BF615 /* CompositePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CompositePlot.m; path = src/plots/CompositePlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 4F22FF9C12342D7C006BF615 /* GradientScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GradientScatterPlot.h; path = src/plots/GradientScatterPlot.h; sourceTree = ""; }; @@ -203,7 +261,6 @@ 4F22FFAD12342DB1006BF615 /* PlotItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = PlotItem.h; path = src/shared/PlotItem.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 4F22FFAE12342DB1006BF615 /* PlotItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotItem.m; path = src/shared/PlotItem.m; sourceTree = ""; }; 4F22FFE7123431D2006BF615 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; - 4F35EBBC12360D89007C3389 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Icon.icns; path = src/mac/Icon.icns; sourceTree = ""; }; 4F35EBF3123611E3007C3389 /* PlotGalleryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotGalleryController.h; path = src/mac/PlotGalleryController.h; sourceTree = ""; }; 4F35EBF4123611E3007C3389 /* PlotGalleryController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotGalleryController.m; path = src/mac/PlotGalleryController.m; sourceTree = ""; }; 4F35EBF5123611E3007C3389 /* PlotView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotView.h; path = src/mac/PlotView.h; sourceTree = ""; }; @@ -216,22 +273,37 @@ 4F8E1CC012908B0000D2035F /* AxisDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AxisDemo.h; path = src/plots/AxisDemo.h; sourceTree = ""; }; 4F8E1CC112908B0000D2035F /* AxisDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = AxisDemo.m; path = src/plots/AxisDemo.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 8D1107320486CEB800E47090 /* Plot Gallery.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Plot Gallery.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + C309C23323B3E12500DEDE9D /* PlotViewItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = PlotViewItem.xib; path = "Plot Gallery-Mac/PlotViewItem.xib"; sourceTree = ""; }; + C309C23523B3E21500DEDE9D /* PlotViewItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PlotViewItem.m; path = src/mac/PlotViewItem.m; sourceTree = ""; }; + C309C23723B3E29F00DEDE9D /* PlotViewItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PlotViewItem.h; path = src/mac/PlotViewItem.h; sourceTree = ""; }; + C30D8AF61BCAF99D0003BB70 /* Plot Gallery tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Plot Gallery tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + C30D8AF91BCAF99D0003BB70 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/tvOS/main.m; sourceTree = ""; }; + C30D8AFB1BCAF99D0003BB70 /* AppDelegateTV.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppDelegateTV.h; path = src/tvOS/AppDelegateTV.h; sourceTree = ""; }; + C30D8AFC1BCAF99D0003BB70 /* AppDelegateTV.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AppDelegateTV.m; path = src/tvOS/AppDelegateTV.m; sourceTree = ""; }; + C30D8B071BCAF99D0003BB70 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = "Plot Gallery-tvOS/Assets.xcassets"; sourceTree = ""; }; + C30D8B3A1BCAFFAE0003BB70 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/Accelerate.framework; sourceTree = DEVELOPER_DIR; }; + C30D8B3C1BCAFFB50003BB70 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; + C30D8B3E1BCAFFBB0003BB70 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + C30D8B401BCAFFC10003BB70 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + C30D8B421BCAFFCB0003BB70 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + C32D229D23B1086600043720 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = src/mac/Base.lproj/MainMenu.xib; sourceTree = ""; }; C3457A4B17AD7C5D000880F3 /* PiNumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PiNumberFormatter.h; path = src/shared/PiNumberFormatter.h; sourceTree = ""; }; C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PiNumberFormatter.m; path = src/shared/PiNumberFormatter.m; sourceTree = ""; }; + C3490DCC20E025660089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/Plot_Gallery_Mac-Info.plist"; sourceTree = ""; }; + C3490DD920E025760089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Base; path = Base.lproj/Icon.icns; sourceTree = ""; }; + C3490DDB20E025B60089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/Plot_Gallery_iOS-Info.plist"; sourceTree = ""; }; + C3490DDF20E026410089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/Plot_Gallery_tvOS-Info.plist"; sourceTree = ""; }; C34CB52E1BC9A76A009270A0 /* Plot Gallery-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Plot Gallery-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; C34CB5451BC9A83C009270A0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "Plot Gallery-iOS/Images.xcassets"; sourceTree = ""; }; C34CB5471BC9A889009270A0 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = src/ios/AppDelegate.h; sourceTree = ""; }; C34CB5481BC9A889009270A0 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = src/ios/AppDelegate.m; sourceTree = ""; }; C34CB5491BC9A889009270A0 /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailViewController.h; path = src/ios/DetailViewController.h; sourceTree = ""; }; C34CB54A1BC9A889009270A0 /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DetailViewController.m; path = src/ios/DetailViewController.m; sourceTree = ""; }; - C34CB54B1BC9A889009270A0 /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = "Launch Screen.xib"; path = "src/ios/Launch Screen.xib"; sourceTree = ""; }; C34CB54C1BC9A889009270A0 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/ios/main.m; sourceTree = ""; }; - C34CB54D1BC9A889009270A0 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = src/ios/Main.storyboard; sourceTree = ""; }; C34CB5501BC9A889009270A0 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RootViewController.h; path = src/ios/RootViewController.h; sourceTree = ""; }; C34CB5511BC9A889009270A0 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RootViewController.m; path = src/ios/RootViewController.m; sourceTree = ""; }; C34CB5521BC9A889009270A0 /* ThemeTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThemeTableViewController.h; path = src/ios/ThemeTableViewController.h; sourceTree = ""; }; C34CB5531BC9A889009270A0 /* ThemeTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ThemeTableViewController.m; path = src/ios/ThemeTableViewController.m; sourceTree = ""; }; - C34CB55D1BC9A936009270A0 /* Plot_Gallery_iOS-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Plot_Gallery_iOS-Info.plist"; sourceTree = ""; }; C34CB55F1BC9AB7B009270A0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; C34CB5611BC9AB85009270A0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; C34CB5631BC9AB8C009270A0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; @@ -255,7 +327,16 @@ C3A14BEB13AEB7E700D103EA /* RangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RangePlot.m; path = src/plots/RangePlot.m; sourceTree = ""; }; C3A31A5414DF782A00734AB7 /* ColoredBarChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ColoredBarChart.h; path = src/plots/ColoredBarChart.h; sourceTree = ""; }; C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ColoredBarChart.m; path = src/plots/ColoredBarChart.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C3B9C2691BCB237000BD560B /* DetailViewControllerTV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailViewControllerTV.h; path = src/tvOS/DetailViewControllerTV.h; sourceTree = ""; }; + C3B9C26A1BCB237000BD560B /* DetailViewControllerTV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DetailViewControllerTV.m; path = src/tvOS/DetailViewControllerTV.m; sourceTree = ""; }; + C3B9C26B1BCB237000BD560B /* RootViewControllerTV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RootViewControllerTV.h; path = src/tvOS/RootViewControllerTV.h; sourceTree = ""; }; + C3B9C26C1BCB237000BD560B /* RootViewControllerTV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RootViewControllerTV.m; path = src/tvOS/RootViewControllerTV.m; sourceTree = ""; }; + C3B9C26D1BCB237000BD560B /* ThemeTableViewControllerTV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThemeTableViewControllerTV.h; path = src/tvOS/ThemeTableViewControllerTV.h; sourceTree = ""; }; + C3B9C26E1BCB237000BD560B /* ThemeTableViewControllerTV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ThemeTableViewControllerTV.m; path = src/tvOS/ThemeTableViewControllerTV.m; sourceTree = ""; }; C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3D0A1B820E0187600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + C3D0A1C520E0188800BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Base.lproj/Launch Screen.xib"; sourceTree = ""; }; + C3D0A1C920E018DE00BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = img/Images.xcassets; sourceTree = ""; }; C3D70BA4175EB29E00F27173 /* ImageDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageDemo.h; path = src/plots/ImageDemo.h; sourceTree = ""; }; C3D70BA5175EB29E00F27173 /* ImageDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ImageDemo.m; path = src/plots/ImageDemo.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; @@ -266,6 +347,8 @@ C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 2; name = CurvedScatterPlot.m; path = src/plots/CurvedScatterPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3F97F1717A9DE2000A52FF2 /* FunctionPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionPlot.h; path = src/plots/FunctionPlot.h; sourceTree = ""; }; C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = FunctionPlot.m; path = src/plots/FunctionPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + E9595DFA1C9973B9004129DA /* CurvedInterpolationDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CurvedInterpolationDemo.h; path = src/plots/CurvedInterpolationDemo.h; sourceTree = ""; }; + E9595DFB1C9973B9004129DA /* CurvedInterpolationDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CurvedInterpolationDemo.m; path = src/plots/CurvedInterpolationDemo.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -279,12 +362,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C30D8AF31BCAF99D0003BB70 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C30D8B3D1BCAFFB50003BB70 /* CoreGraphics.framework in Frameworks */, + C30D8B411BCAFFC10003BB70 /* Foundation.framework in Frameworks */, + C30D8B3F1BCAFFBB0003BB70 /* QuartzCore.framework in Frameworks */, + C30D8B431BCAFFCB0003BB70 /* UIKit.framework in Frameworks */, + C357EA9D1F708E870060CF48 /* CorePlot.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C34CB52B1BC9A76A009270A0 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( C30B12431BCADD300084C567 /* CorePlot.framework in Frameworks */, - C34CB5681BC9AB9E009270A0 /* Accelerate.framework in Frameworks */, C34CB5641BC9AB8C009270A0 /* CoreGraphics.framework in Frameworks */, C34CB5601BC9AB7B009270A0 /* Foundation.framework in Frameworks */, C34CB5661BC9AB93009270A0 /* QuartzCore.framework in Frameworks */, @@ -303,6 +397,8 @@ 4F35EBF4123611E3007C3389 /* PlotGalleryController.m */, 4F35EBF5123611E3007C3389 /* PlotView.h */, 4F35EBF6123611E3007C3389 /* PlotView.m */, + C309C23723B3E29F00DEDE9D /* PlotViewItem.h */, + C309C23523B3E21500DEDE9D /* PlotViewItem.m */, 4F22FF4712342978006BF615 /* main.m */, 4F22FF4A1234298E006BF615 /* Plot_Gallery_MacAppDelegate.h */, 4F22FF4B1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m */, @@ -315,6 +411,7 @@ children = ( 8D1107320486CEB800E47090 /* Plot Gallery.app */, C34CB52E1BC9A76A009270A0 /* Plot Gallery-iOS.app */, + C30D8AF61BCAF99D0003BB70 /* Plot Gallery tvOS.app */, ); name = Products; sourceTree = ""; @@ -326,6 +423,7 @@ 4F22FF9812342D54006BF615 /* Shared */, 080E96DDFE201D6D7F000001 /* Mac */, C33821B11BC9A54100CF8FF6 /* iOS */, + C30D8B1C1BCAF9D10003BB70 /* tvOS */, 4F22FF9912342D5F006BF615 /* Plots */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, @@ -349,10 +447,10 @@ isa = PBXGroup; children = ( C3EF42FC19FC75810060791A /* Images.xcassets */, - 4F35EBBC12360D89007C3389 /* Icon.icns */, - 4F22FF7C12342B6E006BF615 /* Plot_Gallery_Mac-Info.plist */, - 4F22FF5912342A21006BF615 /* MainMenu.xib */, - 4F22FF5712342A21006BF615 /* InfoPlist.strings */, + C3490DDA20E025760089F309 /* Icon.icns */, + C32D229C23B1086600043720 /* MainMenu.xib */, + C309C23323B3E12500DEDE9D /* PlotViewItem.xib */, + C3490DCD20E025660089F309 /* Plot_Gallery_Mac-Info.plist */, ); name = Resources; sourceTree = ""; @@ -360,6 +458,11 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + C30D8B421BCAFFCB0003BB70 /* UIKit.framework */, + C30D8B401BCAFFC10003BB70 /* Foundation.framework */, + C30D8B3E1BCAFFBB0003BB70 /* QuartzCore.framework */, + C30D8B3C1BCAFFB50003BB70 /* CoreGraphics.framework */, + C30D8B3A1BCAFFAE0003BB70 /* Accelerate.framework */, C34CB5911BC9B21F009270A0 /* Mac */, C34CB5921BC9B224009270A0 /* iOS */, ); @@ -396,6 +499,8 @@ C35597951437E07800B41DA7 /* ControlChart.m */, C3F42A2614D3A75F0044B323 /* CurvedScatterPlot.h */, C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */, + E9595DFA1C9973B9004129DA /* CurvedInterpolationDemo.h */, + E9595DFB1C9973B9004129DA /* CurvedInterpolationDemo.m */, 4F8E1C12129077C200D2035F /* DatePlot.h */, 4F8E1C13129077C200D2035F /* DatePlot.m */, C3F34F1312AB2598008FBDC3 /* DonutChart.h */, @@ -439,10 +544,39 @@ C3D414711A7D824700B6F5D6 /* UnitTests iOS.xctest */, C3D414731A7D824700B6F5D6 /* libCorePlot-CocoaTouch.a */, C3D414751A7D824700B6F5D6 /* CorePlot-CocoaTouchTests.xctest */, + C30D8B181BCAF99D0003BB70 /* CorePlot.framework */, + C30D8B1A1BCAF99D0003BB70 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; }; + C30D8B1C1BCAF9D10003BB70 /* tvOS */ = { + isa = PBXGroup; + children = ( + C30D8B1D1BCAF9E80003BB70 /* Resources */, + C30D8AF91BCAF99D0003BB70 /* main.m */, + C30D8AFB1BCAF99D0003BB70 /* AppDelegateTV.h */, + C30D8AFC1BCAF99D0003BB70 /* AppDelegateTV.m */, + C3B9C2691BCB237000BD560B /* DetailViewControllerTV.h */, + C3B9C26A1BCB237000BD560B /* DetailViewControllerTV.m */, + C3B9C26B1BCB237000BD560B /* RootViewControllerTV.h */, + C3B9C26C1BCB237000BD560B /* RootViewControllerTV.m */, + C3B9C26D1BCB237000BD560B /* ThemeTableViewControllerTV.h */, + C3B9C26E1BCB237000BD560B /* ThemeTableViewControllerTV.m */, + ); + name = tvOS; + sourceTree = ""; + }; + C30D8B1D1BCAF9E80003BB70 /* Resources */ = { + isa = PBXGroup; + children = ( + C30D8B071BCAF99D0003BB70 /* Assets.xcassets */, + C3490DE020E026410089F309 /* Plot_Gallery_tvOS-Info.plist */, + C3D0A1CA20E018DE00BA2921 /* Main.storyboard */, + ); + name = Resources; + sourceTree = ""; + }; C33821B11BC9A54100CF8FF6 /* iOS */ = { isa = PBXGroup; children = ( @@ -464,9 +598,9 @@ isa = PBXGroup; children = ( C34CB5451BC9A83C009270A0 /* Images.xcassets */, - C34CB55D1BC9A936009270A0 /* Plot_Gallery_iOS-Info.plist */, - C34CB54D1BC9A889009270A0 /* Main.storyboard */, - C34CB54B1BC9A889009270A0 /* Launch Screen.xib */, + C3490DDC20E025B60089F309 /* Plot_Gallery_iOS-Info.plist */, + C3D0A1B920E0187600BA2921 /* Main.storyboard */, + C3D0A1C620E0188800BA2921 /* Launch Screen.xib */, ); name = Resources; sourceTree = ""; @@ -517,6 +651,24 @@ productReference = 8D1107320486CEB800E47090 /* Plot Gallery.app */; productType = "com.apple.product-type.application"; }; + C30D8AF51BCAF99D0003BB70 /* Plot Gallery tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C30D8B1B1BCAF99D0003BB70 /* Build configuration list for PBXNativeTarget "Plot Gallery tvOS" */; + buildPhases = ( + C30D8AF21BCAF99D0003BB70 /* Sources */, + C30D8AF31BCAF99D0003BB70 /* Frameworks */, + C30D8AF41BCAF99D0003BB70 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C30D8B1F1BCAFC080003BB70 /* PBXTargetDependency */, + ); + name = "Plot Gallery tvOS"; + productName = "Plot Gallery tvOS"; + productReference = C30D8AF61BCAF99D0003BB70 /* Plot Gallery tvOS.app */; + productType = "com.apple.product-type.application"; + }; C34CB52D1BC9A76A009270A0 /* Plot Gallery-iOS */ = { isa = PBXNativeTarget; buildConfigurationList = C34CB5421BC9A76A009270A0 /* Build configuration list for PBXNativeTarget "Plot Gallery-iOS" */; @@ -543,8 +695,12 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; + LastUpgradeCheck = 1100; TargetAttributes = { + C30D8AF51BCAF99D0003BB70 = { + CreatedOnToolsVersion = 7.1; + DevelopmentTeam = 28ZA45DE7D; + }; C34CB52D1BC9A76A009270A0 = { CreatedOnToolsVersion = 7.0.1; DevelopmentTeam = 28ZA45DE7D; @@ -553,14 +709,14 @@ }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Plot_Gallery" */; compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, Base, + en, + fr, + ja, + de, ); mainGroup = 29B97314FDCFA39411CA2CEA /* Plot Gallery-Mac */; projectDirPath = ""; @@ -574,6 +730,7 @@ targets = ( 8D1107260486CEB800E47090 /* Plot Gallery-Mac */, C34CB52D1BC9A76A009270A0 /* Plot Gallery-iOS */, + C30D8AF51BCAF99D0003BB70 /* Plot Gallery tvOS */, ); }; /* End PBXProject section */ @@ -593,6 +750,20 @@ remoteRef = 4F48928A1290FFCD00EDB93F /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C30D8B181BCAF99D0003BB70 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C30D8B171BCAF99D0003BB70 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C30D8B1A1BCAF99D0003BB70 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C30D8B191BCAF99D0003BB70 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; C3D4146F1A7D824700B6F5D6 /* CorePlot.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -629,10 +800,20 @@ buildActionMask = 2147483647; files = ( C3D2FE6319FF1D03002CD4D6 /* Images.xcassets in Resources */, - 4F22FF5B12342A21006BF615 /* InfoPlist.strings in Resources */, + C32D229E23B1086600043720 /* MainMenu.xib in Resources */, C3EF42FD19FC75810060791A /* Images.xcassets in Resources */, - 4F22FF5C12342A21006BF615 /* MainMenu.xib in Resources */, - 4F35EBBD12360D89007C3389 /* Icon.icns in Resources */, + C3490DD820E025760089F309 /* Icon.icns in Resources */, + C309C23423B3E12500DEDE9D /* PlotViewItem.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C30D8AF41BCAF99D0003BB70 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C30D8B211BCAFD3E0003BB70 /* Images.xcassets in Resources */, + C30D8B081BCAF99D0003BB70 /* Assets.xcassets in Resources */, + C3D0A1C820E018DE00BA2921 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -642,8 +823,8 @@ files = ( C34CB5461BC9A83C009270A0 /* Images.xcassets in Resources */, C367EEE21BCAEA9E00A21FE7 /* Images.xcassets in Resources */, - C34CB5581BC9A889009270A0 /* Main.storyboard in Resources */, - C34CB5561BC9A889009270A0 /* Launch Screen.xib in Resources */, + C3D0A1B720E0187600BA2921 /* Main.storyboard in Resources */, + C3D0A1C420E0188800BA2921 /* Launch Screen.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -654,6 +835,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + C309C23623B3E21500DEDE9D /* PlotViewItem.m in Sources */, 4F22FF4912342978006BF615 /* main.m in Sources */, 4F22FF4C1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m in Sources */, 4F22FFA412342D7C006BF615 /* CompositePlot.m in Sources */, @@ -675,6 +857,7 @@ C39C4E4113BFE1A900CD9194 /* LabelingPolicyDemo.m in Sources */, C39C4E4413BFE1B400CD9194 /* PlotSpaceDemo.m in Sources */, C354C0D713C7CDBE00DA8822 /* RealTimePlot.m in Sources */, + E9595DFC1C9973B9004129DA /* CurvedInterpolationDemo.m in Sources */, C367249313E103910070F47A /* LineCapDemo.m in Sources */, C35597961437E07800B41DA7 /* ControlChart.m in Sources */, C3A31A5614DF782A00734AB7 /* ColoredBarChart.m in Sources */, @@ -685,6 +868,43 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C30D8AF21BCAF99D0003BB70 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C3F6216C1C9F365100301061 /* CurvedInterpolationDemo.m in Sources */, + C30D8B301BCAFDE20003BB70 /* LabelingPolicyDemo.m in Sources */, + C30D8B291BCAFDE20003BB70 /* ControlChart.m in Sources */, + C30D8B2B1BCAFDE20003BB70 /* DatePlot.m in Sources */, + C30D8B2E1BCAFDE20003BB70 /* GradientScatterPlot.m in Sources */, + C30D8B2F1BCAFDE20003BB70 /* ImageDemo.m in Sources */, + C30D8B261BCAFDE20003BB70 /* CandlestickPlot.m in Sources */, + C30D8B361BCAFDE20003BB70 /* SteppedScatterPlot.m in Sources */, + C30D8AFD1BCAF99D0003BB70 /* AppDelegateTV.m in Sources */, + C30D8B391BCAFDE20003BB70 /* VerticalBarChart.m in Sources */, + C3B9C26F1BCB237000BD560B /* DetailViewControllerTV.m in Sources */, + C30D8B231BCAFD3E0003BB70 /* PlotGallery.m in Sources */, + C30D8B221BCAFD3E0003BB70 /* PlotItem.m in Sources */, + C30D8B351BCAFDE20003BB70 /* RealTimePlot.m in Sources */, + C30D8B2C1BCAFDE20003BB70 /* DonutChart.m in Sources */, + C30D8B281BCAFDE20003BB70 /* CompositePlot.m in Sources */, + C30D8B311BCAFDE20003BB70 /* LineCapDemo.m in Sources */, + C30D8AFA1BCAF99D0003BB70 /* main.m in Sources */, + C30D8B371BCAFDE20003BB70 /* SimplePieChart.m in Sources */, + C30D8B241BCAFD3E0003BB70 /* PiNumberFormatter.m in Sources */, + C30D8B331BCAFDE20003BB70 /* PlotSpaceDemo.m in Sources */, + C30D8B321BCAFDE20003BB70 /* OHLCPlot.m in Sources */, + C30D8B341BCAFDE20003BB70 /* RangePlot.m in Sources */, + C30D8B251BCAFDE20003BB70 /* AxisDemo.m in Sources */, + C30D8B271BCAFDE20003BB70 /* ColoredBarChart.m in Sources */, + C3B9C2711BCB237000BD560B /* ThemeTableViewControllerTV.m in Sources */, + C30D8B2D1BCAFDE20003BB70 /* FunctionPlot.m in Sources */, + C30D8B2A1BCAFDE20003BB70 /* CurvedScatterPlot.m in Sources */, + C30D8B381BCAFDE20003BB70 /* SimpleScatterPlot.m in Sources */, + C3B9C2701BCB237000BD560B /* RootViewControllerTV.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C34CB52A1BC9A76A009270A0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -696,6 +916,7 @@ C34CB5871BC9B1C1009270A0 /* LabelingPolicyDemo.m in Sources */, C34CB5801BC9B1C1009270A0 /* ControlChart.m in Sources */, C34CB5831BC9B1C1009270A0 /* DonutChart.m in Sources */, + E9AB989C1C9A903700D23875 /* CurvedInterpolationDemo.m in Sources */, C34CB5811BC9B1C1009270A0 /* CurvedScatterPlot.m in Sources */, C34CB5861BC9B1C1009270A0 /* ImageDemo.m in Sources */, C34CB5541BC9A889009270A0 /* AppDelegate.m in Sources */, @@ -734,6 +955,11 @@ name = "CorePlot iOS"; targetProxy = C30B12451BCADD300084C567 /* PBXContainerItemProxy */; }; + C30D8B1F1BCAFC080003BB70 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CorePlot tvOS"; + targetProxy = C30D8B1E1BCAFC080003BB70 /* PBXContainerItemProxy */; + }; C34CB57A1BC9B0D4009270A0 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "CorePlot iOS"; @@ -742,22 +968,72 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - 4F22FF5712342A21006BF615 /* InfoPlist.strings */ = { + C32D229C23B1086600043720 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( - 4F22FF5812342A21006BF615 /* English */, + C32D229D23B1086600043720 /* Base */, ); - name = InfoPlist.strings; - path = src/mac/English.lproj; + name = MainMenu.xib; sourceTree = ""; }; - 4F22FF5912342A21006BF615 /* MainMenu.xib */ = { + C3490DCD20E025660089F309 /* Plot_Gallery_Mac-Info.plist */ = { isa = PBXVariantGroup; children = ( - 4F22FF5A12342A21006BF615 /* English */, + C3490DCC20E025660089F309 /* Base */, ); - name = MainMenu.xib; - path = src/mac/English.lproj; + name = "Plot_Gallery_Mac-Info.plist"; + sourceTree = ""; + }; + C3490DDA20E025760089F309 /* Icon.icns */ = { + isa = PBXVariantGroup; + children = ( + C3490DD920E025760089F309 /* Base */, + ); + name = Icon.icns; + path = src/mac; + sourceTree = ""; + }; + C3490DDC20E025B60089F309 /* Plot_Gallery_iOS-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DDB20E025B60089F309 /* Base */, + ); + name = "Plot_Gallery_iOS-Info.plist"; + sourceTree = ""; + }; + C3490DE020E026410089F309 /* Plot_Gallery_tvOS-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DDF20E026410089F309 /* Base */, + ); + name = "Plot_Gallery_tvOS-Info.plist"; + sourceTree = ""; + }; + C3D0A1B920E0187600BA2921 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1B820E0187600BA2921 /* Base */, + ); + name = Main.storyboard; + path = src/ios; + sourceTree = ""; + }; + C3D0A1C620E0188800BA2921 /* Launch Screen.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1C520E0188800BA2921 /* Base */, + ); + name = "Launch Screen.xib"; + path = src/ios; + sourceTree = ""; + }; + C3D0A1CA20E018DE00BA2921 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1C920E018DE00BA2921 /* Base */, + ); + name = Main.storyboard; + path = src/tvOS; sourceTree = ""; }; /* End PBXVariantGroup section */ @@ -767,20 +1043,17 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Plot_Gallery_Prefix.pch; - INFOPLIST_FILE = "Plot_Gallery_Mac-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_Mac-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.11; OTHER_LDFLAGS = ( "-ObjC", "-all_load", @@ -788,6 +1061,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.Plot-Gallery-Mac"; PRODUCT_NAME = "Plot Gallery"; RUN_CLANG_STATIC_ANALYZER = YES; + SDKROOT = macosx; VALID_ARCHS = "i386 x86_64"; }; name = Debug; @@ -796,19 +1070,16 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = s; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Plot_Gallery_Prefix.pch; - INFOPLIST_FILE = "Plot_Gallery_Mac-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_Mac-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.11; OTHER_LDFLAGS = ( "-ObjC", "-all_load", @@ -816,80 +1087,122 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.Plot-Gallery-Mac"; PRODUCT_NAME = "Plot Gallery"; RUN_CLANG_STATIC_ANALYZER = YES; + SDKROOT = macosx; VALID_ARCHS = "i386 x86_64"; }; name = Release; }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Plot_Gallery_Prefix.pch; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", "-all_load", ); - SDKROOT = macosx; SYMROOT = "$(PROJECT_DIR)/../../build"; }; name = Debug; }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Plot_Gallery_Prefix.pch; OTHER_LDFLAGS = ( "-ObjC", "-all_load", ); - SDKROOT = macosx; SYMROOT = "$(PROJECT_DIR)/../../build"; }; name = Release; }; + C30D8B0A1BCAF99D0003BB70 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_tvOS-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.Plot-Gallery-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; + }; + name = Debug; + }; + C30D8B0B1BCAF99D0003BB70 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_tvOS-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.Plot-Gallery-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; C34CB5431BC9A76A009270A0 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 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_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; DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Plot_Gallery_Prefix.pch; 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; - INFOPLIST_FILE = "Plot_Gallery_iOS-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_iOS-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; @@ -904,34 +1217,16 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 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_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 Distribution"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Plot_Gallery_Prefix.pch; - 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; - INFOPLIST_FILE = "Plot_Gallery_iOS-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_iOS-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; @@ -964,6 +1259,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + C30D8B1B1BCAF99D0003BB70 /* Build configuration list for PBXNativeTarget "Plot Gallery tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C30D8B0A1BCAF99D0003BB70 /* Debug */, + C30D8B0B1BCAF99D0003BB70 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; C34CB5421BC9A76A009270A0 /* Build configuration list for PBXNativeTarget "Plot Gallery-iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-Mac.xcscheme b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-Mac.xcscheme index 7c6c37ab4..d03877413 100644 --- a/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-Mac.xcscheme +++ b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-Mac.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "YES"> - - - - + + - - - + - + diff --git a/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-iOS.xcscheme b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-iOS.xcscheme index 4f7cd0c7a..a45febfc8 100644 --- a/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-iOS.xcscheme +++ b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-iOS.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "YES"> - - - - + + - - + buildForAnalyzing = "YES"> + BlueprintIdentifier = "C30D8AF51BCAF99D0003BB70" + BuildableName = "Plot Gallery tvOS.app" + BlueprintName = "Plot Gallery tvOS" + ReferencedContainer = "container:Plot_Gallery.xcodeproj"> @@ -27,20 +26,19 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> - - + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> + BlueprintIdentifier = "C30D8AF51BCAF99D0003BB70" + BuildableName = "Plot Gallery tvOS.app" + BlueprintName = "Plot Gallery tvOS" + ReferencedContainer = "container:Plot_Gallery.xcodeproj"> - - + + + BlueprintIdentifier = "C30D8AF51BCAF99D0003BB70" + BuildableName = "Plot Gallery tvOS.app" + BlueprintName = "Plot Gallery tvOS" + ReferencedContainer = "container:Plot_Gallery.xcodeproj"> - - + BlueprintIdentifier = "C30D8AF51BCAF99D0003BB70" + BuildableName = "Plot Gallery tvOS.app" + BlueprintName = "Plot Gallery tvOS" + ReferencedContainer = "container:Plot_Gallery.xcodeproj"> diff --git a/examples/CorePlotGallery/Plot_Gallery_Prefix.pch b/examples/CorePlotGallery/Plot_Gallery_Prefix.pch index 919ef2bfe..e76705a48 100644 --- a/examples/CorePlotGallery/Plot_Gallery_Prefix.pch +++ b/examples/CorePlotGallery/Plot_Gallery_Prefix.pch @@ -4,7 +4,7 @@ #ifdef __OBJC__ #import - #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE + #if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV #import #import #else diff --git a/examples/CorePlotGallery/src/ios/AppDelegate.m b/examples/CorePlotGallery/src/ios/AppDelegate.m index 00b0b425e..e3bafe91b 100644 --- a/examples/CorePlotGallery/src/ios/AppDelegate.m +++ b/examples/CorePlotGallery/src/ios/AppDelegate.m @@ -18,7 +18,7 @@ @implementation AppDelegate @synthesize window; --(BOOL)application:(nonnull UIApplication *)application didFinishLaunchingWithOptions:(nullable CPTDictionary)launchOptions +-(BOOL)application:(nonnull UIApplication *__unused)application didFinishLaunchingWithOptions:(nullable CPTDictionary *__unused)launchOptions { [[PlotGallery sharedPlotGallery] sortByTitle]; @@ -33,9 +33,9 @@ -(BOOL)application:(nonnull UIApplication *)application didFinishLaunchingWithOp #pragma mark - Split view --(BOOL)splitViewController:(UISplitViewController *)splitViewController collapseSecondaryViewController:(UIViewController *)secondaryViewController ontoPrimaryViewController:(UIViewController *)primaryViewController +-(BOOL)splitViewController:(UISplitViewController *__unused)splitViewController collapseSecondaryViewController:(UIViewController *)secondaryViewController ontoPrimaryViewController:(UIViewController *__unused)primaryViewController { - if ( [secondaryViewController isKindOfClass:[UINavigationController class]] && [( (UINavigationController *)secondaryViewController ).topViewController isKindOfClass:[DetailViewController class]] && ( ( (DetailViewController *)( (UINavigationController *)secondaryViewController ).topViewController ).detailItem == nil ) ) { + if ( [secondaryViewController isKindOfClass:[UINavigationController class]] && [((UINavigationController *)secondaryViewController).topViewController isKindOfClass:[DetailViewController class]] && (((DetailViewController *)((UINavigationController *)secondaryViewController).topViewController).detailItem == nil)) { // Return YES to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. return YES; } diff --git a/examples/CorePlotGallery/src/ios/Launch Screen.xib b/examples/CorePlotGallery/src/ios/Base.lproj/Launch Screen.xib similarity index 59% rename from examples/CorePlotGallery/src/ios/Launch Screen.xib rename to examples/CorePlotGallery/src/ios/Base.lproj/Launch Screen.xib index 3f2f3dbc8..8a42da815 100644 --- a/examples/CorePlotGallery/src/ios/Launch Screen.xib +++ b/examples/CorePlotGallery/src/ios/Base.lproj/Launch Screen.xib @@ -1,27 +1,28 @@ - - + + + + + - - + + - + - - - + diff --git a/examples/CorePlotGallery/src/ios/Main.storyboard b/examples/CorePlotGallery/src/ios/Base.lproj/Main.storyboard similarity index 84% rename from examples/CorePlotGallery/src/ios/Main.storyboard rename to examples/CorePlotGallery/src/ios/Base.lproj/Main.storyboard index 391428c19..949e2f780 100644 --- a/examples/CorePlotGallery/src/ios/Main.storyboard +++ b/examples/CorePlotGallery/src/ios/Base.lproj/Main.storyboard @@ -1,9 +1,12 @@ - - + + + + + - - + + @@ -11,8 +14,8 @@ + - @@ -31,17 +34,15 @@ - + - - - + + - - + @@ -66,37 +67,33 @@ - + - + - - + - + - + - - @@ -129,31 +126,27 @@ - + - - + - + - + - - - + @@ -171,13 +164,13 @@ - + - + + - diff --git a/examples/CorePlotGallery/src/ios/DetailViewController.m b/examples/CorePlotGallery/src/ios/DetailViewController.m index a50fe4923..9d787a9fa 100644 --- a/examples/CorePlotGallery/src/ios/DetailViewController.m +++ b/examples/CorePlotGallery/src/ios/DetailViewController.m @@ -44,12 +44,14 @@ -(void)setupView -(void)awakeFromNib { + [super awakeFromNib]; + [self setupView]; } -(nonnull instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil { - if ( (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) ) { + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { [self setupView]; } @@ -132,6 +134,7 @@ -(void)themeChanged:(nonnull NSNotification *)notification NSDictionary *themeInfo = notification.userInfo; NSString *themeName = themeInfo[PlotGalleryThemeNameKey]; + if ( themeName ) { [self themeSelectedWithName:themeName]; } diff --git a/examples/CorePlotGallery/src/ios/RootViewController.m b/examples/CorePlotGallery/src/ios/RootViewController.m index 0e61ad1f3..9d81892b5 100644 --- a/examples/CorePlotGallery/src/ios/RootViewController.m +++ b/examples/CorePlotGallery/src/ios/RootViewController.m @@ -47,10 +47,10 @@ -(void)dealloc #pragma mark - #pragma mark Segues --(void)prepareForSegue:(nonnull UIStoryboardSegue *)segue sender:(nullable id)sender +-(void)prepareForSegue:(nonnull UIStoryboardSegue *)segue sender:(nullable id __unused)sender { if ( [segue.identifier isEqualToString:@"showDetail"] ) { - DetailViewController *controller = (DetailViewController *)( (UINavigationController *)segue.destinationViewController ).topViewController; + DetailViewController *controller = (DetailViewController *)((UINavigationController *)segue.destinationViewController).topViewController; controller.navigationItem.leftBarButtonItem = self.splitViewController.displayModeButtonItem; controller.navigationItem.leftItemsSupplementBackButton = YES; @@ -74,6 +74,7 @@ -(void)themeChanged:(nonnull NSNotification *)notification NSDictionary *themeInfo = notification.userInfo; NSString *themeName = themeInfo[PlotGalleryThemeNameKey]; + if ( themeName ) { self.currentThemeName = themeName; } @@ -82,12 +83,12 @@ -(void)themeChanged:(nonnull NSNotification *)notification #pragma mark - #pragma mark Table view data source --(NSInteger)numberOfSectionsInTableView:(nonnull UITableView *)tv +-(NSInteger)numberOfSectionsInTableView:(nonnull UITableView *__unused)tv { return (NSInteger)[PlotGallery sharedPlotGallery].numberOfSections; } --(NSInteger)tableView:(nonnull UITableView *)tv numberOfRowsInSection:(NSInteger)section +-(NSInteger)tableView:(nonnull UITableView *__unused)tv numberOfRowsInSection:(NSInteger)section { return (NSInteger)[[PlotGallery sharedPlotGallery] numberOfRowsInSection:(NSUInteger)section]; } @@ -111,7 +112,7 @@ -(nonnull UITableViewCell *)tableView:(nonnull UITableView *)tv cellForRowAtInde return cell; } --(nullable NSString *)tableView:(nonnull UITableView *)tableView titleForHeaderInSection:(NSInteger)section +-(nullable NSString *)tableView:(nonnull UITableView *__unused)tableView titleForHeaderInSection:(NSInteger)section { return [PlotGallery sharedPlotGallery].sectionTitles[(NSUInteger)section]; } diff --git a/examples/CorePlotGallery/src/ios/ThemeTableViewController.m b/examples/CorePlotGallery/src/ios/ThemeTableViewController.m index 10b51976a..a705f18cf 100644 --- a/examples/CorePlotGallery/src/ios/ThemeTableViewController.m +++ b/examples/CorePlotGallery/src/ios/ThemeTableViewController.m @@ -15,7 +15,7 @@ @interface ThemeTableViewController() -@property (nonatomic, readwrite, strong, nonnull) CPTMutableStringArray themes; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableStringArray *themes; @end @@ -27,7 +27,7 @@ @implementation ThemeTableViewController -(void)setupThemes { - CPTMutableStringArray themeList = [[NSMutableArray alloc] init]; + CPTMutableStringArray *themeList = [[NSMutableArray alloc] init]; [themeList addObject:kThemeTableViewControllerDefaultTheme]; [themeList addObject:kThemeTableViewControllerNoTheme]; @@ -41,12 +41,14 @@ -(void)setupThemes -(void)awakeFromNib { + [super awakeFromNib]; + [self setupThemes]; } -(nonnull instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil { - if ( (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) ) { + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { [self setupThemes]; } @@ -56,12 +58,12 @@ -(nonnull instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle: #pragma mark - #pragma mark Table view data source --(NSInteger)numberOfSectionsInTableView:(nonnull UITableView *)tableView +-(NSInteger)numberOfSectionsInTableView:(nonnull UITableView *__unused)tableView { return 1; } --(NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section +-(NSInteger)tableView:(nonnull UITableView *__unused)tableView numberOfRowsInSection:(NSInteger __unused)section { return (NSInteger)self.themes.count; } @@ -84,10 +86,10 @@ -(nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRo #pragma mark - #pragma mark Table view delegate --(void)tableView:(nonnull UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath +-(void)tableView:(nonnull UITableView *__unused)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath { NSDictionary *themeInfo = @{ - PlotGalleryThemeNameKey: self.themes[(NSUInteger)indexPath.row] + PlotGalleryThemeNameKey: self.themes[(NSUInteger)indexPath.row] }; [[NSNotificationCenter defaultCenter] postNotificationName:PlotGalleryThemeDidChangeNotification diff --git a/examples/CorePlotGallery/src/ios/main.m b/examples/CorePlotGallery/src/ios/main.m index da456e0b4..7f96dbbda 100644 --- a/examples/CorePlotGallery/src/ios/main.m +++ b/examples/CorePlotGallery/src/ios/main.m @@ -8,6 +8,6 @@ int main(int argc, char *argv[]) { @autoreleasepool { - return UIApplicationMain( argc, argv, nil, NSStringFromClass([AppDelegate class]) ); + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } } diff --git a/examples/CorePlotGallery/src/mac/Icon.icns b/examples/CorePlotGallery/src/mac/Base.lproj/Icon.icns similarity index 100% rename from examples/CorePlotGallery/src/mac/Icon.icns rename to examples/CorePlotGallery/src/mac/Base.lproj/Icon.icns diff --git a/examples/CorePlotGallery/src/mac/English.lproj/MainMenu.xib b/examples/CorePlotGallery/src/mac/Base.lproj/MainMenu.xib similarity index 77% rename from examples/CorePlotGallery/src/mac/English.lproj/MainMenu.xib rename to examples/CorePlotGallery/src/mac/Base.lproj/MainMenu.xib index 07afc80f5..349c7533b 100644 --- a/examples/CorePlotGallery/src/mac/English.lproj/MainMenu.xib +++ b/examples/CorePlotGallery/src/mac/Base.lproj/MainMenu.xib @@ -1,9 +1,9 @@ - - + + - - + + @@ -12,7 +12,7 @@ - + @@ -75,6 +75,13 @@ + + + + + + + @@ -194,51 +201,49 @@ + - + - + - + - - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -249,6 +254,12 @@ + + + + + + @@ -263,7 +274,7 @@ - + @@ -280,6 +291,7 @@ + @@ -290,11 +302,12 @@ - - + + + diff --git a/examples/CorePlotGallery/src/mac/PlotGalleryController.h b/examples/CorePlotGallery/src/mac/PlotGalleryController.h index 04bd17bcf..c8418c4a6 100644 --- a/examples/CorePlotGallery/src/mac/PlotGalleryController.h +++ b/examples/CorePlotGallery/src/mac/PlotGalleryController.h @@ -11,6 +11,8 @@ #import "PlotView.h" @interface PlotGalleryController : NSObject @property (nonatomic, strong, nullable) PlotItem *plotItem; diff --git a/examples/CorePlotGallery/src/mac/PlotGalleryController.m b/examples/CorePlotGallery/src/mac/PlotGalleryController.m index daabd4836..be4239e94 100644 --- a/examples/CorePlotGallery/src/mac/PlotGalleryController.m +++ b/examples/CorePlotGallery/src/mac/PlotGalleryController.m @@ -6,24 +6,29 @@ #import "PlotGalleryController.h" #import "dlfcn.h" -// #define EMBED_NU 1 +#import "PlotViewItem.h" static const CGFloat CPT_SPLIT_VIEW_MIN_LHS_WIDTH = 150.0; static NSString *const kThemeTableViewControllerNoTheme = @"None"; static NSString *const kThemeTableViewControllerDefaultTheme = @"Default"; +static NSString *const kCollectionHeader = @"CPTCollectionHeader"; +static NSString *const kCollectionItem = @"PlotViewItem"; + @interface PlotGalleryController() @property (nonatomic, readwrite, strong, nullable) IBOutlet NSSplitView *splitView; @property (nonatomic, readwrite, strong, nullable) IBOutlet NSScrollView *scrollView; -@property (nonatomic, readwrite, strong, nullable) IBOutlet IKImageBrowserView *imageBrowser; +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSCollectionView *imageBrowser; @property (nonatomic, readwrite, strong, nullable) IBOutlet NSPopUpButton *themePopUpButton; @property (nonatomic, readwrite, strong, nullable) IBOutlet PlotView *hostingView; @end +#pragma mark - + @implementation PlotGalleryController @synthesize splitView; @@ -51,53 +56,36 @@ -(void)setupThemes -(void)awakeFromNib { + [super awakeFromNib]; + [[PlotGallery sharedPlotGallery] sortByTitle]; - (self.splitView).delegate = self; + self.splitView.delegate = self; - [self.imageBrowser setDelegate:self]; - [self.imageBrowser setDataSource:self]; - [self.imageBrowser setCellsStyleMask:IKCellsStyleShadowed | IKCellsStyleTitled]; // | IKCellsStyleSubtitled]; + NSCollectionView *browser = self.imageBrowser; - [self.imageBrowser reloadData]; + browser.delegate = self; + browser.dataSource = self; - (self.hostingView).delegate = self; + [browser registerClass:[NSTextField class] + forSupplementaryViewOfKind:NSCollectionElementKindSectionHeader + withIdentifier:kCollectionHeader]; - [self setupThemes]; + [browser reloadData]; -#ifdef EMBED_NU - // Setup a Nu console without the help of the Nu include files or - // an explicit link of the Nu framework, which may not be installed - nuHandle = dlopen("/Library/Frameworks/Nu.framework/Nu", RTLD_LAZY); - - if ( nuHandle ) { - NSString *consoleStartup = - @"(progn \ - (load \"console\") \ - (set $console ((NuConsoleWindowController alloc) init)))"; - - Class nuClass = NSClassFromString(@"Nu"); - id parser = [nuClass performSelector:@selector(parser)]; - id code = [parser performSelector:@selector(parse:) withObject:consoleStartup]; - [parser performSelector:@selector(eval:) withObject:code]; - } -#endif + self.hostingView.delegate = self; + + [self setupThemes]; } -(void)dealloc { [self setPlotItem:nil]; - [splitView setDelegate:nil]; - [imageBrowser setDataSource:nil]; - [imageBrowser setDelegate:nil]; - [hostingView setDelegate:nil]; - -#ifdef EMBED_NU - if ( nuHandle ) { - dlclose(nuHandle); - } -#endif + splitView.delegate = nil; + imageBrowser.dataSource = nil; + imageBrowser.delegate = nil; + hostingView.delegate = nil; } -(void)setFrameSize:(NSSize)newSize @@ -137,6 +125,114 @@ -(IBAction)themeSelectionDidChange:(nonnull id)sender } } +#pragma mark - +#pragma mark Export Images + +-(void)exportTVImageWithSize:(CGSize)size toURL:(NSURL *)url showPlots:(BOOL)showPlots showBackground:(BOOL)showBackground +{ + if ( url ) { + CGRect imageFrame = CGRectMake(0.0, 0.0, size.width, size.height); + + NSView *imageView = [[NSView alloc] initWithFrame:NSRectFromCGRect(imageFrame)]; + [imageView setWantsLayer:YES]; + + [self.plotItem renderInView:imageView withTheme:nil animated:NO]; + + if ( !showBackground ) { + for ( CPTGraphHostingView *view in imageView.subviews ) { + CPTGraph *graph = view.hostedGraph; + + graph.fill = [CPTFill fillWithColor:[CPTColor clearColor]]; + graph.axisSet = nil; + + graph.plotAreaFrame.fill = [CPTFill fillWithColor:[CPTColor clearColor]]; + graph.plotAreaFrame.borderLineStyle = nil; + + graph.plotAreaFrame.plotArea.fill = [CPTFill fillWithColor:[CPTColor clearColor]]; + graph.plotAreaFrame.plotArea.borderLineStyle = nil; + } + } + + if ( !showPlots ) { + for ( CPTGraphHostingView *view in imageView.subviews ) { + for ( CPTPlot *plot in view.hostedGraph.allPlots ) { + plot.hidden = YES; + } + } + } + + CGSize boundsSize = imageFrame.size; + + NSBitmapImageRep *layerImage = [[NSBitmapImageRep alloc] + initWithBitmapDataPlanes:NULL + pixelsWide:(NSInteger)boundsSize.width + pixelsHigh:(NSInteger)boundsSize.height + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpaceName:NSCalibratedRGBColorSpace + bytesPerRow:(NSInteger)boundsSize.width * 4 + bitsPerPixel:32]; + + NSGraphicsContext *bitmapContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:layerImage]; + CGContextRef context = (CGContextRef)bitmapContext.graphicsPort; + + CGContextClearRect(context, CGRectMake(0.0, 0.0, boundsSize.width, boundsSize.height)); + CGContextSetAllowsAntialiasing(context, true); + CGContextSetShouldSmoothFonts(context, false); + [imageView.layer renderInContext:context]; + CGContextFlush(context); + + NSImage *image = [[NSImage alloc] initWithSize:NSSizeFromCGSize(boundsSize)]; + [image addRepresentation:layerImage]; + + NSData *tiffData = image.TIFFRepresentation; + NSBitmapImageRep *tiffRep = [NSBitmapImageRep imageRepWithData:tiffData]; + NSData *pngData = [tiffRep representationUsingType:NSPNGFileType properties:@{}]; + + [pngData writeToURL:url atomically:NO]; + } +} + +-(IBAction)exportTVImagesToPNG:(id __unused)sender +{ + NSOpenPanel *pngSavingDialog = [NSOpenPanel openPanel]; + + pngSavingDialog.canChooseFiles = NO; + pngSavingDialog.canChooseDirectories = YES; + pngSavingDialog.allowsMultipleSelection = NO; + + if ( [pngSavingDialog runModal] == NSModalResponseOK ) { + NSURL *url = pngSavingDialog.URL; + if ( url ) { +// top image + CGSize topShelfSize = CGSizeMake(1920.0, 720.0); + + NSURL *topURL = [NSURL URLWithString:@"PlotGalleryTopShelf.png" relativeToURL:url]; + [self exportTVImageWithSize:topShelfSize toURL:topURL showPlots:YES showBackground:YES]; + +// large icon image + CGSize largeIconSize = CGSizeMake(1280.0, 768.0); + + NSURL *largeBackURL = [NSURL URLWithString:@"PlotGalleryLargeIconBack.png" relativeToURL:url]; + [self exportTVImageWithSize:largeIconSize toURL:largeBackURL showPlots:NO showBackground:YES]; + + NSURL *largeFrontURL = [NSURL URLWithString:@"PlotGalleryLargeIconFront.png" relativeToURL:url]; + [self exportTVImageWithSize:largeIconSize toURL:largeFrontURL showPlots:YES showBackground:NO]; + +// small icon image + CGSize smallIconSize = CGSizeMake(400.0, 240.0); + + NSURL *smallBackURL = [NSURL URLWithString:@"PlotGallerySmallIconBack.png" relativeToURL:url]; + [self exportTVImageWithSize:smallIconSize toURL:smallBackURL showPlots:NO showBackground:YES]; + + NSURL *smallFrontURL = [NSURL URLWithString:@"PlotGallerySmallIconFront.png" relativeToURL:url]; + [self exportTVImageWithSize:smallIconSize toURL:smallFrontURL showPlots:YES showBackground:NO]; + } + } +} + #pragma mark - #pragma mark PlotItem Property @@ -155,71 +251,106 @@ -(void)setPlotItem:(nullable PlotItem *)item } #pragma mark - -#pragma mark IKImageBrowserViewDataSource methods +#pragma mark NSCollectionViewDataSource methods --(NSUInteger)numberOfItemsInImageBrowser:(nonnull IKImageBrowserView *)browser +-(NSInteger)numberOfSectionsInCollectionView:(nonnull NSCollectionView *__unused)collectionView { - return [PlotGallery sharedPlotGallery].count; + return (NSInteger)[PlotGallery sharedPlotGallery].numberOfSections; } --(nonnull id)imageBrowser:(nonnull IKImageBrowserView *)browser itemAtIndex:(NSUInteger)index +-(NSInteger)collectionView:(nonnull NSCollectionView *__unused)collectionView + numberOfItemsInSection:(NSInteger)section { - return [[PlotGallery sharedPlotGallery] objectInSection:0 atIndex:index]; + return (NSInteger)[[PlotGallery sharedPlotGallery] numberOfRowsInSection:(NSUInteger)section]; } --(NSUInteger)numberOfGroupsInImageBrowser:(nonnull IKImageBrowserView *)aBrowser +-(nonnull NSCollectionViewItem *)collectionView:(nonnull NSCollectionView *)collectionView + itemForRepresentedObjectAtIndexPath:(nonnull NSIndexPath *)indexPath { - return [PlotGallery sharedPlotGallery].numberOfSections; + PlotViewItem *item = [collectionView makeItemWithIdentifier:kCollectionItem + forIndexPath:indexPath]; + + PlotItem *thePlotItem = [[PlotGallery sharedPlotGallery] objectInSection:(NSUInteger)indexPath.section + atIndex:(NSUInteger)indexPath.item]; + + item.plotItemTitle.stringValue = thePlotItem.title; + item.plotItemImage.image = thePlotItem.image; + + return item; } --(nonnull CPTDictionary)imageBrowser:(nonnull IKImageBrowserView *)aBrowser groupAtIndex:(NSUInteger)index +-(nonnull NSView *) collectionView:(nonnull NSCollectionView *)collectionView + viewForSupplementaryElementOfKind:(nonnull NSCollectionViewSupplementaryElementKind)kind + atIndexPath:(nonnull NSIndexPath *)indexPath { - NSString *groupTitle = [PlotGallery sharedPlotGallery].sectionTitles[index]; - - NSUInteger offset = 0; + NSString *identifier = nil; - for ( NSUInteger i = 0; i < index; i++ ) { - offset += [[PlotGallery sharedPlotGallery] numberOfRowsInSection:i]; + if ( [kind isEqual:NSCollectionElementKindSectionHeader] ) { + identifier = kCollectionHeader; + } + else { + identifier = @""; } - NSValue *groupRange = [NSValue valueWithRange:NSMakeRange(offset, [[PlotGallery sharedPlotGallery] numberOfRowsInSection:index])]; + NSString *content = [PlotGallery sharedPlotGallery].sectionTitles[(NSUInteger)indexPath.section]; + + NSView *view = [collectionView makeSupplementaryViewOfKind:kind withIdentifier:identifier forIndexPath:indexPath]; + if ( content && [view isKindOfClass:[NSTextField class]] ) { + NSTextField *titleTextField = (NSTextField *)view; + + titleTextField.editable = NO; + titleTextField.selectable = NO; + titleTextField.backgroundColor = [NSColor controlAccentColor]; + titleTextField.textColor = [NSColor headerTextColor]; + titleTextField.font = [NSFont boldSystemFontOfSize:14.0]; + titleTextField.bordered = YES; + titleTextField.stringValue = content; + } - return @{ - IKImageBrowserGroupStyleKey: @(IKGroupDisclosureStyle), - IKImageBrowserGroupTitleKey: groupTitle, - IKImageBrowserGroupRangeKey: groupRange - }; + return view; } #pragma mark - -#pragma mark IKImageBrowserViewDelegate methods +#pragma mark NSCollectionViewDelegate methods --(void)imageBrowserSelectionDidChange:(nonnull IKImageBrowserView *)browser +-(void) collectionView:(nonnull NSCollectionView *__unused)collectionView + didSelectItemsAtIndexPaths:(nonnull NSSet *)indexPaths { - NSUInteger index = [browser selectionIndexes].firstIndex; + NSUInteger section = NSNotFound; + NSUInteger index = NSNotFound; + NSIndexPath *path = indexPaths.allObjects.firstObject; + + if ( path ) { + section = (NSUInteger)path.section; + index = (NSUInteger)path.item; + } if ( index != NSNotFound ) { - PlotItem *item = [[PlotGallery sharedPlotGallery] objectInSection:0 atIndex:index]; - self.plotItem = item; + self.plotItem = [[PlotGallery sharedPlotGallery] objectInSection:section atIndex:index]; } } #pragma mark - #pragma mark NSSplitViewDelegate methods --(CGFloat)splitView:(nonnull NSSplitView *)sv constrainMinCoordinate:(CGFloat)coord ofSubviewAt:(NSInteger)index +-(CGFloat) splitView:(nonnull NSSplitView *__unused)sv + constrainMinCoordinate:(CGFloat)coord + ofSubviewAt:(NSInteger __unused)index { return coord + CPT_SPLIT_VIEW_MIN_LHS_WIDTH; } --(CGFloat)splitView:(nonnull NSSplitView *)sv constrainMaxCoordinate:(CGFloat)coord ofSubviewAt:(NSInteger)index +-(CGFloat) splitView:(nonnull NSSplitView *__unused)sv + constrainMaxCoordinate:(CGFloat)coord + ofSubviewAt:(NSInteger __unused)index { return coord - CPT_SPLIT_VIEW_MIN_LHS_WIDTH; } --(void)splitView:(nonnull NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize +-(void) splitView:(nonnull NSSplitView *)sender + resizeSubviewsWithOldSize:(NSSize __unused)oldSize { - // Lock the LHS width +// Lock the LHS width NSRect frame = sender.frame; NSView *lhs = sender.subviews[0]; NSRect lhsRect = lhs.frame; diff --git a/examples/CorePlotGallery/src/mac/PlotView.m b/examples/CorePlotGallery/src/mac/PlotView.m index 2df73ae70..b769c4a9e 100644 --- a/examples/CorePlotGallery/src/mac/PlotView.m +++ b/examples/CorePlotGallery/src/mac/PlotView.m @@ -11,13 +11,13 @@ @implementation PlotView -(nonnull instancetype)initWithFrame:(NSRect)frame { - if ( (self = [super initWithFrame:frame]) ) { + if ((self = [super initWithFrame:frame])) { } return self; } --(void)drawRect:(NSRect)dirtyRect +-(void)drawRect:(NSRect __unused)dirtyRect { } diff --git a/examples/CorePlotGallery/src/mac/PlotViewItem.h b/examples/CorePlotGallery/src/mac/PlotViewItem.h new file mode 100644 index 000000000..c908c2f82 --- /dev/null +++ b/examples/CorePlotGallery/src/mac/PlotViewItem.h @@ -0,0 +1,13 @@ +// +// PlotViewItem.h +// CorePlotGallery +// + +#import + +@interface PlotViewItem : NSCollectionViewItem + +@property (nonatomic, readwrite, strong) IBOutlet NSImageView *plotItemImage; +@property (nonatomic, readwrite, strong) IBOutlet NSTextField *plotItemTitle; + +@end diff --git a/examples/CorePlotGallery/src/mac/PlotViewItem.m b/examples/CorePlotGallery/src/mac/PlotViewItem.m new file mode 100644 index 000000000..300f5e158 --- /dev/null +++ b/examples/CorePlotGallery/src/mac/PlotViewItem.m @@ -0,0 +1,13 @@ +// +// PlotViewItem.m +// CorePlotGallery +// + +#import "PlotViewItem.h" + +@implementation PlotViewItem + +@synthesize plotItemImage; +@synthesize plotItemTitle; + +@end diff --git a/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.m b/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.m index 3a5f91189..b5c8479b6 100644 --- a/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.m +++ b/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.m @@ -9,11 +9,11 @@ @implementation Plot_Gallery_MacAppDelegate @synthesize window; --(void)applicationDidFinishLaunching:(nonnull NSNotification *)aNotification +-(void)applicationDidFinishLaunching:(nonnull NSNotification *__unused)aNotification { } --(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender +-(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *__unused)sender { return YES; } diff --git a/examples/CorePlotGallery/src/mac/English.lproj/InfoPlist.strings b/examples/CorePlotGallery/src/mac/en.lproj/InfoPlist.strings similarity index 100% rename from examples/CorePlotGallery/src/mac/English.lproj/InfoPlist.strings rename to examples/CorePlotGallery/src/mac/en.lproj/InfoPlist.strings diff --git a/examples/CorePlotGallery/src/mac/en.lproj/MainMenu.strings b/examples/CorePlotGallery/src/mac/en.lproj/MainMenu.strings new file mode 100644 index 000000000..e11842f48 --- /dev/null +++ b/examples/CorePlotGallery/src/mac/en.lproj/MainMenu.strings @@ -0,0 +1,129 @@ + +/* Class = "NSMenuItem"; title = "Bring All to Front"; ObjectID = "5"; */ +"5.title" = "Bring All to Front"; + +/* Class = "NSMenuItem"; title = "Window"; ObjectID = "19"; */ +"19.title" = "Window"; + +/* Class = "NSMenuItem"; title = "Minimize"; ObjectID = "23"; */ +"23.title" = "Minimize"; + +/* Class = "NSMenu"; title = "Window"; ObjectID = "24"; */ +"24.title" = "Window"; + +/* Class = "NSMenu"; title = "AMainMenu"; ObjectID = "29"; */ +"29.title" = "AMainMenu"; + +/* Class = "NSMenuItem"; title = "Plot Gallery"; ObjectID = "56"; */ +"56.title" = "Plot Gallery"; + +/* Class = "NSMenu"; title = "Plot Gallery"; ObjectID = "57"; */ +"57.title" = "Plot Gallery"; + +/* Class = "NSMenuItem"; title = "About Plot Gallery"; ObjectID = "58"; */ +"58.title" = "About Plot Gallery"; + +/* Class = "NSMenuItem"; title = "Close"; ObjectID = "73"; */ +"73.title" = "Close"; + +/* Class = "NSMenuItem"; title = "Page Setup..."; ObjectID = "77"; */ +"77.title" = "Page Setup..."; + +/* Class = "NSMenuItem"; title = "Print…"; ObjectID = "78"; */ +"78.title" = "Print…"; + +/* Class = "NSMenu"; title = "File"; ObjectID = "81"; */ +"81.title" = "File"; + +/* Class = "NSMenuItem"; title = "File"; ObjectID = "83"; */ +"83.title" = "File"; + +/* Class = "NSMenuItem"; title = "Preferences…"; ObjectID = "129"; */ +"129.title" = "Preferences…"; + +/* Class = "NSMenu"; title = "Services"; ObjectID = "130"; */ +"130.title" = "Services"; + +/* Class = "NSMenuItem"; title = "Services"; ObjectID = "131"; */ +"131.title" = "Services"; + +/* Class = "NSMenuItem"; title = "Hide Plot Gallery"; ObjectID = "134"; */ +"134.title" = "Hide Plot Gallery"; + +/* Class = "NSMenuItem"; title = "Quit Plot Gallery"; ObjectID = "136"; */ +"136.title" = "Quit Plot Gallery"; + +/* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "145"; */ +"145.title" = "Hide Others"; + +/* Class = "NSMenuItem"; title = "Show All"; ObjectID = "150"; */ +"150.title" = "Show All"; + +/* Class = "NSMenuItem"; title = "Copy"; ObjectID = "197"; */ +"197.title" = "Copy"; + +/* Class = "NSMenuItem"; title = "Select All"; ObjectID = "198"; */ +"198.title" = "Select All"; + +/* Class = "NSMenuItem"; title = "Cut"; ObjectID = "199"; */ +"199.title" = "Cut"; + +/* Class = "NSMenuItem"; title = "Delete"; ObjectID = "202"; */ +"202.title" = "Delete"; + +/* Class = "NSMenuItem"; title = "Paste"; ObjectID = "203"; */ +"203.title" = "Paste"; + +/* Class = "NSMenu"; title = "Edit"; ObjectID = "205"; */ +"205.title" = "Edit"; + +/* Class = "NSMenuItem"; title = "Undo"; ObjectID = "207"; */ +"207.title" = "Undo"; + +/* Class = "NSMenuItem"; title = "Redo"; ObjectID = "215"; */ +"215.title" = "Redo"; + +/* Class = "NSMenuItem"; title = "Edit"; ObjectID = "217"; */ +"217.title" = "Edit"; + +/* Class = "NSMenuItem"; title = "Zoom"; ObjectID = "239"; */ +"239.title" = "Zoom"; + +/* Class = "NSMenuItem"; title = "View"; ObjectID = "295"; */ +"295.title" = "View"; + +/* Class = "NSMenu"; title = "View"; ObjectID = "296"; */ +"296.title" = "View"; + +/* Class = "NSMenuItem"; title = "Show Toolbar"; ObjectID = "297"; */ +"297.title" = "Show Toolbar"; + +/* Class = "NSMenuItem"; title = "Customize Toolbar…"; ObjectID = "298"; */ +"298.title" = "Customize Toolbar…"; + +/* Class = "NSWindow"; title = "Plot Gallery-Mac"; ObjectID = "371"; */ +"371.title" = "Plot Gallery-Mac"; + +/* Class = "NSMenuItem"; title = "Paste and Match Style"; ObjectID = "485"; */ +"485.title" = "Paste and Match Style"; + +/* Class = "NSMenuItem"; title = "Help"; ObjectID = "490"; */ +"490.title" = "Help"; + +/* Class = "NSMenu"; title = "Help"; ObjectID = "491"; */ +"491.title" = "Help"; + +/* Class = "NSMenuItem"; title = "Plot Gallery Help"; ObjectID = "492"; */ +"492.title" = "Plot Gallery Help"; + +/* Class = "NSMenu"; title = "OtherViews"; ObjectID = "558"; */ +"558.title" = "OtherViews"; + +/* Class = "NSToolbarItem"; label = "Theme"; ObjectID = "562"; */ +"562.label" = "Theme"; + +/* Class = "NSToolbarItem"; paletteLabel = "Theme"; ObjectID = "562"; */ +"562.paletteLabel" = "Theme"; + +/* Class = "NSMenuItem"; title = "Save TV Images…"; ObjectID = "JRn-xt-TSn"; */ +"JRn-xt-TSn.title" = "Save TV Images…"; diff --git a/examples/CorePlotGallery/src/plots/AxisDemo.m b/examples/CorePlotGallery/src/plots/AxisDemo.m index 0cac6ac1a..07730cda7 100644 --- a/examples/CorePlotGallery/src/plots/AxisDemo.m +++ b/examples/CorePlotGallery/src/plots/AxisDemo.m @@ -14,7 +14,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Axis Demo"; self.section = kDemoPlots; } @@ -22,7 +22,7 @@ -(nonnull instancetype)init return self; } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { #if TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; diff --git a/examples/CorePlotGallery/src/plots/CandlestickPlot.m b/examples/CorePlotGallery/src/plots/CandlestickPlot.m index cd56e1242..961ddc972 100644 --- a/examples/CorePlotGallery/src/plots/CandlestickPlot.m +++ b/examples/CorePlotGallery/src/plots/CandlestickPlot.m @@ -9,7 +9,7 @@ @interface CandlestickPlot() -@property (nonatomic, readwrite, strong, nonnull) CPTGraph *graph; +@property (nonatomic, readwrite, strong, nullable) CPTGraph *graph; @property (nonatomic, readwrite, strong, nonnull) NSArray *plotData; @end @@ -26,9 +26,9 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { graph = nil; - plotData = nil; + plotData = @[]; self.title = @"Candlestick Plot"; self.section = kFinancialPlots; @@ -39,15 +39,15 @@ -(nonnull instancetype)init -(void)generateData { - if ( !self.plotData ) { + if ( self.plotData.count == 0 ) { NSMutableArray *newData = [NSMutableArray array]; for ( NSUInteger i = 0; i < 8; i++ ) { NSTimeInterval x = oneDay * i; double rOpen = 3.0 * arc4random() / (double)UINT32_MAX + 1.0; double rClose = (arc4random() / (double)UINT32_MAX - 0.5) * 0.125 + rOpen; - double rHigh = MAX( rOpen, MAX(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen) ); - double rLow = MIN( rOpen, MIN(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen) ); + double rHigh = MAX(rOpen, MAX(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen)); + double rLow = MIN(rOpen, MIN(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen)); [newData addObject: @{ @(CPTTradingRangePlotFieldX): @(x), @@ -62,14 +62,14 @@ -(void)generateData } } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { // If you make sure your dates are calculated at noon, you shouldn't have to // worry about daylight savings. If you use midnight, you will have to adjust // for daylight savings time. NSDate *refDate = [NSDate dateWithTimeIntervalSinceReferenceDate:oneDay / 2.0]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -105,7 +105,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT CPTLineCap *lineCap = [[CPTLineCap alloc] init]; lineCap.lineStyle = xAxis.axisLineStyle; lineCap.lineCapType = CPTLineCapTypeSweptArrow; - lineCap.size = CGSizeMake( self.titleSize * CPTFloat(0.5), self.titleSize * CPTFloat(0.625) ); + lineCap.size = CGSizeMake(self.titleSize * CPTFloat(0.5), self.titleSize * CPTFloat(0.625)); CPTColor *lineColor = xAxis.axisLineStyle.lineColor; if ( lineColor ) { @@ -172,8 +172,10 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT newGraph.legend.borderLineStyle = newGraph.plotAreaFrame.borderLineStyle; newGraph.legend.cornerRadius = 5.0; newGraph.legend.swatchCornerRadius = 5.0; - newGraph.legendAnchor = CPTRectAnchorBottom; - newGraph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(3.0) ); + newGraph.legend.swatchLayout = CPTLegendSwatchLayoutRight; + + newGraph.legendAnchor = CPTRectAnchorBottom; + newGraph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(3.0)); // Set plot ranges CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; @@ -184,7 +186,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } @@ -213,6 +215,11 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum return num; } +-(nullable NSNumber *)barWidthForTradingRangePlot:(nonnull CPTTradingRangePlot *__unused)plot recordIndex:(NSUInteger __unused)idx +{ + return @(arc4random_uniform(85) + 15); +} + #pragma mark - #pragma mark Plot Delegate Methods diff --git a/examples/CorePlotGallery/src/plots/ColoredBarChart.m b/examples/CorePlotGallery/src/plots/ColoredBarChart.m index 86d22a68f..e2a607c84 100644 --- a/examples/CorePlotGallery/src/plots/ColoredBarChart.m +++ b/examples/CorePlotGallery/src/plots/ColoredBarChart.m @@ -2,7 +2,7 @@ @interface ColoredBarChart() -@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *plotData; @end @@ -17,7 +17,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Colored Bar Chart"; self.section = kBarPlots; } @@ -27,8 +27,8 @@ -(nonnull instancetype)init -(void)generateData { - if ( self.plotData == nil ) { - CPTMutableNumberArray contentArray = [NSMutableArray array]; + if ( self.plotData.count == 0 ) { + CPTMutableNumberArray *contentArray = [NSMutableArray array]; for ( NSUInteger i = 0; i < 8; i++ ) { [contentArray addObject:@(10.0 * arc4random() / (double)UINT32_MAX + 5.0)]; } @@ -36,9 +36,9 @@ -(void)generateData } } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -131,28 +131,29 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT theLegend.textStyle = whiteTextStyle; theLegend.numberOfRows = 1; - graph.legend = theLegend; - graph.legendAnchor = CPTRectAnchorTop; - graph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(-2.625) ); + graph.legend = theLegend; + graph.legend.swatchLayout = CPTLegendSwatchLayoutTop; + graph.legendAnchor = CPTRectAnchorTop; + graph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(-2.625)); } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(nullable NSArray *)numbersForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange +-(nullable NSArray *)numbersForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange { - CPTNumberArray nums = nil; + CPTNumberArray *nums = nil; switch ( fieldEnum ) { case CPTBarPlotFieldBarLocation: nums = [NSMutableArray arrayWithCapacity:indexRange.length]; for ( NSUInteger i = indexRange.location; i < NSMaxRange(indexRange); i++ ) { - [(NSMutableArray < NSNumber * > *) nums addObject:@(i)]; + [(NSMutableArray *) nums addObject:@(i)]; } break; @@ -167,7 +168,7 @@ -(nullable NSArray *)numbersForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fi return nums; } --(nullable CPTFill *)barFillForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndex:(NSUInteger)index +-(nullable CPTFill *)barFillForBarPlot:(nonnull CPTBarPlot *__unused)barPlot recordIndex:(NSUInteger)index { CPTColor *color = nil; @@ -214,7 +215,12 @@ -(nullable CPTFill *)barFillForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndex return [CPTFill fillWithGradient:fillGradient]; } --(nullable NSString *)legendTitleForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndex:(NSUInteger)index +-(nullable NSNumber *)barWidthForBarPlot:(nonnull CPTBarPlot *__unused)barPlot recordIndex:(NSUInteger __unused)idx +{ + return @((double)(arc4random_uniform(50) + 25) / 100.0); +} + +-(nullable NSString *)legendTitleForBarPlot:(nonnull CPTBarPlot *__unused)barPlot recordIndex:(NSUInteger)index { return [NSString stringWithFormat:@"Bar %lu", (unsigned long)(index + 1)]; } diff --git a/examples/CorePlotGallery/src/plots/CompositePlot.h b/examples/CorePlotGallery/src/plots/CompositePlot.h index 6ec67f461..51fdabfe4 100644 --- a/examples/CorePlotGallery/src/plots/CompositePlot.h +++ b/examples/CorePlotGallery/src/plots/CompositePlot.h @@ -10,7 +10,7 @@ CPTScatterPlotDelegate, CPTBarPlotDelegate> -@property (readwrite, strong, nonatomic, nonnull) CPTMutableNumberArray dataForChart; +@property (readwrite, strong, nonatomic, nonnull) CPTMutableNumberArray *dataForChart; @property (readwrite, strong, nonatomic, nonnull) NSMutableArray *dataForPlot; -(void)renderScatterPlotInHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme; diff --git a/examples/CorePlotGallery/src/plots/CompositePlot.m b/examples/CorePlotGallery/src/plots/CompositePlot.m index cde38ee8f..9a3c140b8 100644 --- a/examples/CorePlotGallery/src/plots/CompositePlot.m +++ b/examples/CorePlotGallery/src/plots/CompositePlot.m @@ -40,7 +40,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { selectedIndex = NSNotFound; self.title = @"Composite Plot"; @@ -53,33 +53,34 @@ -(nonnull instancetype)init #pragma mark - #pragma mark Plot construction methods -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else -(void)setFrameSize:(NSSize)newSize { - self.scatterPlotView.frame = NSMakeRect( 0.0, - 0.0, - newSize.width, - newSize.height * CPTFloat(0.5) ); + self.scatterPlotView.frame = NSMakeRect(0.0, + 0.0, + newSize.width, + newSize.height * CPTFloat(0.5)); - self.barChartView.frame = NSMakeRect( 0.0, - newSize.height * CPTFloat(0.5), - newSize.width * CPTFloat(0.5), - newSize.height * CPTFloat(0.5) ); + self.barChartView.frame = NSMakeRect(0.0, + newSize.height * CPTFloat(0.5), + newSize.width * CPTFloat(0.5), + newSize.height * CPTFloat(0.5)); - self.pieChartView.frame = NSMakeRect( newSize.width * CPTFloat(0.5), - newSize.height * CPTFloat(0.5), - newSize.width * CPTFloat(0.5), - newSize.height * CPTFloat(0.5) ); + self.pieChartView.frame = NSMakeRect(newSize.width * CPTFloat(0.5), + newSize.height * CPTFloat(0.5), + newSize.width * CPTFloat(0.5), + newSize.height * CPTFloat(0.5)); [self.scatterPlotView setNeedsDisplay:YES]; [self.barChartView setNeedsDisplay:YES]; [self.pieChartView setNeedsDisplay:YES]; } + #endif --(void)renderInView:(nonnull PlotGalleryNativeView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInView:(nonnull PlotGalleryNativeView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { [self killGraph]; @@ -87,7 +88,7 @@ -(void)renderInView:(nonnull PlotGalleryNativeView *)hostingView withTheme:(null CPTGraphHostingView *barView = [[CPTGraphHostingView alloc] init]; CPTGraphHostingView *pieView = [[CPTGraphHostingView alloc] init]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE for ( UIView *view in @[scatterView, barView, pieView] ) { view.translatesAutoresizingMaskIntoConstraints = NO; [hostingView addSubview:view]; @@ -166,24 +167,23 @@ -(void)renderInView:(nonnull PlotGalleryNativeView *)hostingView withTheme:(null attribute:NSLayoutAttributeTop multiplier:1.0 constant:0.0]]; - #else NSRect viewRect = hostingView.bounds; - scatterView.frame = NSMakeRect( 0.0, - 0.0, - viewRect.size.width, - viewRect.size.height * CPTFloat(0.5) ); + scatterView.frame = NSMakeRect(0.0, + 0.0, + viewRect.size.width, + viewRect.size.height * CPTFloat(0.5)); - barView.frame = NSMakeRect( 0.0, - viewRect.size.height * CPTFloat(0.5), - viewRect.size.width * CPTFloat(0.5), - viewRect.size.height * CPTFloat(0.5) ); + barView.frame = NSMakeRect(0.0, + viewRect.size.height * CPTFloat(0.5), + viewRect.size.width * CPTFloat(0.5), + viewRect.size.height * CPTFloat(0.5)); - pieView.frame = NSMakeRect( viewRect.size.width * CPTFloat(0.5), - viewRect.size.height * CPTFloat(0.5), - viewRect.size.width * CPTFloat(0.5), - viewRect.size.height * CPTFloat(0.5) ); + pieView.frame = NSMakeRect(viewRect.size.width * CPTFloat(0.5), + viewRect.size.height * CPTFloat(0.5), + viewRect.size.width * CPTFloat(0.5), + viewRect.size.height * CPTFloat(0.5)); for ( NSView *view in @[scatterView, barView, pieView] ) { [view setAutoresizesSubviews:YES]; @@ -224,7 +224,7 @@ -(void)killGraph -(void)renderScatterPlotInHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme { // Create graph from theme -#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR +#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR CGRect bounds = self.scatterPlotView.bounds; #else CGRect bounds = NSRectToCGRect(self.scatterPlotView.bounds); @@ -250,9 +250,9 @@ -(void)renderScatterPlotInHostingView:(nonnull CPTGraphHostingView *)hostingView x.majorIntervalLength = @0.5; x.orthogonalPosition = @2.0; x.minorTicksPerInterval = 2; - CPTPlotRangeArray exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], - [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], - [CPTPlotRange plotRangeWithLocation:@2.99 length:@0.02]]; + CPTPlotRangeArray *exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@2.99 length:@0.02]]; x.labelExclusionRanges = exclusionRanges; CPTXYAxis *y = axisSet.yAxis; @@ -331,7 +331,7 @@ -(void)renderScatterPlotInHostingView:(nonnull CPTGraphHostingView *)hostingView -(void)renderBarPlotInHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -361,10 +361,10 @@ -(void)renderBarPlotInHostingView:(nonnull CPTGraphHostingView *)hostingView wit x.labelOffset = 2.0; x.labelRotation = CPTFloat(M_PI_4); x.labelingPolicy = CPTAxisLabelingPolicyNone; - CPTNumberArray customTickLocations = @[@1, @5, @10, @15]; - CPTStringArray xAxisLabels = @[@"Label A", @"Label B", @"Label C", @"Label D"]; - NSUInteger labelLocation = 0; - CPTMutableAxisLabelSet customLabels = [NSMutableSet setWithCapacity:xAxisLabels.count]; + CPTNumberArray *customTickLocations = @[@1, @5, @10, @15]; + CPTStringArray *xAxisLabels = @[@"Label A", @"Label B", @"Label C", @"Label D"]; + NSUInteger labelLocation = 0; + CPTMutableAxisLabelSet *customLabels = [NSMutableSet setWithCapacity:xAxisLabels.count]; for ( NSNumber *tickLocation in customTickLocations ) { CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithText:xAxisLabels[labelLocation++] textStyle:x.labelTextStyle]; newLabel.tickLocation = tickLocation; @@ -401,7 +401,7 @@ -(void)renderBarPlotInHostingView:(nonnull CPTGraphHostingView *)hostingView wit -(void)renderPieChartInHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE [hostingView layoutIfNeeded]; CGRect bounds = hostingView.bounds; @@ -422,8 +422,8 @@ -(void)renderPieChartInHostingView:(nonnull CPTGraphHostingView *)hostingView wi // Add pie chart CPTPieChart *piePlot = [[CPTPieChart alloc] init]; piePlot.dataSource = self; - piePlot.pieRadius = MIN( CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * self.pieChart.paddingLeft) / CPTFloat(2.0), - CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * self.pieChart.paddingTop) / CPTFloat(2.0) ); + piePlot.pieRadius = MIN(CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * self.pieChart.paddingLeft) / CPTFloat(2.0), + CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * self.pieChart.paddingTop) / CPTFloat(2.0)); piePlot.identifier = @"Pie Chart 1"; piePlot.startAngle = CPTFloat(M_PI_4); piePlot.sliceDirection = CPTPieDirectionCounterClockwise; @@ -437,7 +437,7 @@ -(void)renderPieChartInHostingView:(nonnull CPTGraphHostingView *)hostingView wi #pragma mark - #pragma mark CPTBarPlot delegate --(void)barPlot:(nonnull CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index +-(void)barPlot:(nonnull CPTBarPlot *__unused)plot barWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"barWasSelectedAtRecordIndex %d", (int)index); } @@ -503,7 +503,7 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum break; case CPTBarPlotFieldBarTip: - num = @( (index + 1) * (index + 1) ); + num = @((index + 1) * (index + 1)); if ( [plot.identifier isEqual:@"Bar Plot 2"] ) { num = @(num.integerValue - 10); } @@ -534,8 +534,8 @@ -(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUI static dispatch_once_t whiteOnceToken = 0; dispatch_once(&whiteOnceToken, ^{ - whiteText = [[CPTMutableTextStyle alloc] init]; - whiteText.color = [CPTColor whiteColor]; + whiteText = [[CPTMutableTextStyle alloc] init]; + whiteText.color = [CPTColor whiteColor]; whiteText.fontSize = self.titleSize * CPTFloat(0.5); }); @@ -543,8 +543,8 @@ -(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUI static dispatch_once_t blackOnceToken = 0; dispatch_once(&blackOnceToken, ^{ - redText = [[CPTMutableTextStyle alloc] init]; - redText.color = [CPTColor redColor]; + redText = [[CPTMutableTextStyle alloc] init]; + redText.color = [CPTColor redColor]; redText.fontSize = self.titleSize * CPTFloat(0.5); }); @@ -575,13 +575,13 @@ -(nullable CPTPlotSymbol *)symbolForScatterPlot:(nonnull CPTScatterPlot *)plot r CPTPlotSymbol *symbol = nil; // Use the default symbol - if ( [(NSString *) plot.identifier isEqualToString:@"Blue Plot"] && ( (NSInteger)index == self.selectedIndex ) ) { + if ( [(NSString *) plot.identifier isEqualToString:@"Blue Plot"] && ((NSInteger)index == self.selectedIndex)) { dispatch_once(&onceToken, ^{ - redDot = [[CPTPlotSymbol alloc] init]; + redDot = [[CPTPlotSymbol alloc] init]; redDot.symbolType = CPTPlotSymbolTypeEllipse; - redDot.size = CGSizeMake(10.0, 10.0); - redDot.fill = [CPTFill fillWithColor:[CPTColor redColor]]; - redDot.lineStyle = [CPTLineStyle lineStyle]; + redDot.size = CGSizeMake(10.0, 10.0); + redDot.fill = [CPTFill fillWithColor:[CPTColor redColor]]; + redDot.lineStyle = [CPTLineStyle lineStyle]; }); symbol = redDot; @@ -602,10 +602,10 @@ -(void)setSelectedIndex:(NSInteger)newIndex CPTScatterPlot *thePlot = (CPTScatterPlot *)[self.scatterPlot plotWithIdentifier:@"Blue Plot"]; if ( oldIndex != NSNotFound ) { - [thePlot reloadPlotSymbolsInIndexRange:NSMakeRange( (NSUInteger)oldIndex, 1 )]; + [thePlot reloadPlotSymbolsInIndexRange:NSMakeRange((NSUInteger)oldIndex, 1)]; } if ( newIndex != NSNotFound ) { - [thePlot reloadPlotSymbolsInIndexRange:NSMakeRange( (NSUInteger)newIndex, 1 )]; + [thePlot reloadPlotSymbolsInIndexRange:NSMakeRange((NSUInteger)newIndex, 1)]; } } } diff --git a/examples/CorePlotGallery/src/plots/ControlChart.m b/examples/CorePlotGallery/src/plots/ControlChart.m index 50425cd77..cc8682410 100644 --- a/examples/CorePlotGallery/src/plots/ControlChart.m +++ b/examples/CorePlotGallery/src/plots/ControlChart.m @@ -9,7 +9,7 @@ @interface ControlChart() -@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *plotData; @property (nonatomic, readwrite, assign) double meanValue; @property (nonatomic, readwrite, assign) double standardError; @@ -28,7 +28,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Control Chart"; self.section = kLinePlots; } @@ -38,8 +38,8 @@ -(nonnull instancetype)init -(void)generateData { - if ( self.plotData == nil ) { - CPTMutableNumberArray contentArray = [NSMutableArray array]; + if ( self.plotData.count == 0 ) { + CPTMutableNumberArray *contentArray = [NSMutableArray array]; double sum = 0.0; @@ -58,14 +58,14 @@ -(void)generateData double error = value.doubleValue - self.meanValue; sum += error * error; } - double stdDev = sqrt( ( 1.0 / (numberOfPoints - 1) ) * sum ); + double stdDev = sqrt((1.0 / (numberOfPoints - 1)) * sum); self.standardError = stdDev / sqrt(numberOfPoints); } } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -207,7 +207,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT graph.legend.cornerRadius = 5.0; graph.legend.numberOfRows = 1; graph.legendAnchor = CPTRectAnchorBottom; - graph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(4.0) ); + graph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(4.0)); } #pragma mark - diff --git a/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.h b/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.h new file mode 100644 index 000000000..ac63057b9 --- /dev/null +++ b/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.h @@ -0,0 +1,13 @@ +// +// CurvedInterpolationDemo.h +// Plot_Gallery +// +// Created by malte on 16/03/16. +// +// + +#import "PlotItem.h" + +@interface CurvedInterpolationDemo : PlotItem + +@end diff --git a/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.m b/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.m new file mode 100644 index 000000000..d5e6f20e9 --- /dev/null +++ b/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.m @@ -0,0 +1,315 @@ +// +// CurvedInterpolationDemo.m +// Plot_Gallery +// +// Created by malte on 16/03/16. +// +// + +#import "CurvedInterpolationDemo.h" + +static const double bezierYShift = -1.0; +static const double catmullRomUniformPlotYShift = 0.0; +static const double catmullRomCentripetalYShift = 1.0; +static const double catmullRomChordalYShift = 2.0; +static const double hermiteCubicYShift = -2.0; + +static NSString *const bezierCurveIdentifier = @"Bezier"; +static NSString *const catmullRomUniformIdentifier = @"Catmull-Rom Uniform"; +static NSString *const catmullRomCentripetalIdentifier = @"Catmull-Rom Centripetal"; +static NSString *const catmullRomChordalIdentifier = @"Catmull-Rom Chordal"; +static NSString *const hermiteCubicIdentifier = @"Hermite Cubic"; + +@interface CurvedInterpolationDemo() + +@property (nonatomic, readwrite, strong) NSArray *> *plotData; + +@end + +@implementation CurvedInterpolationDemo + +@synthesize plotData = _plotData; + ++(void)load +{ + [super registerPlotItem:self]; +} + +-(instancetype)init +{ + if ((self = [super init])) { + self.title = @"Curved Interpolation Options Demo"; + self.section = kLinePlots; + } + + return self; +} + +-(void)generateData +{ + if ( self.plotData.count == 0 ) { + NSArray *const xValues = @[@0, @0.1, @0.2, @0.5, @0.6, @0.7, @1]; + NSArray *const yValues = @[@(0.5), @0.5, @(-1), @1, @1, @0, @0.1]; + + if ( xValues.count != yValues.count ) { + [[NSException exceptionWithName:NSInternalInconsistencyException reason:@"invalid const data" userInfo:nil] raise]; + } + NSMutableArray *> *generatedData = [NSMutableArray new]; + for ( NSUInteger i = 0; i < xValues.count; i++ ) { + NSNumber *x = xValues[i]; + NSNumber *y = yValues[i]; + if ( x && y ) { + [generatedData addObject:@{ + @"x": x, + @"y": y + }]; + } + } + self.plotData = generatedData; + } +} + +-(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL __unused)animated +{ +#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE + CGRect bounds = hostingView.bounds; +#else + CGRect bounds = NSRectToCGRect(hostingView.bounds); +#endif + + CPTGraph *graph = [[CPTXYGraph alloc] initWithFrame:bounds]; + [self addGraph:graph toHostingView:hostingView]; + [self applyTheme:theme toGraph:graph withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]]; + + graph.plotAreaFrame.paddingLeft += self.titleSize * CPTFloat(2.25); + graph.plotAreaFrame.paddingTop += self.titleSize; + graph.plotAreaFrame.paddingRight += self.titleSize; + graph.plotAreaFrame.paddingBottom += self.titleSize; + graph.plotAreaFrame.masksToBorder = NO; + +// Setup scatter plot space + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; + plotSpace.allowsUserInteraction = YES; + plotSpace.delegate = self; + +// Grid line styles + CPTMutableLineStyle *majorGridLineStyle = [CPTMutableLineStyle lineStyle]; + majorGridLineStyle.lineWidth = 0.75; + majorGridLineStyle.lineColor = [[CPTColor colorWithGenericGray:CPTFloat(0.2)] colorWithAlphaComponent:CPTFloat(0.75)]; + + CPTMutableLineStyle *minorGridLineStyle = [CPTMutableLineStyle lineStyle]; + minorGridLineStyle.lineWidth = 0.25; + minorGridLineStyle.lineColor = [[CPTColor whiteColor] colorWithAlphaComponent:CPTFloat(0.1)]; + + CPTMutableLineStyle *redLineStyle = [CPTMutableLineStyle lineStyle]; + redLineStyle.lineWidth = 10.0; + redLineStyle.lineColor = [[CPTColor redColor] colorWithAlphaComponent:0.5]; + + CPTLineCap *lineCap = [CPTLineCap sweptArrowPlotLineCap]; + lineCap.size = CGSizeMake(self.titleSize * CPTFloat(0.625), self.titleSize * CPTFloat(0.625)); + +// Axes +// Label x axis with a fixed interval policy + CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; + CPTXYAxis *x = axisSet.xAxis; + x.majorIntervalLength = @0.1; + x.minorTicksPerInterval = 4; + x.majorGridLineStyle = majorGridLineStyle; + x.minorGridLineStyle = minorGridLineStyle; + x.axisConstraints = [CPTConstraints constraintWithRelativeOffset:0.5]; + + lineCap.lineStyle = x.axisLineStyle; + CPTColor *lineColor = lineCap.lineStyle.lineColor; + if ( lineColor ) { + lineCap.fill = [CPTFill fillWithColor:lineColor]; + } + x.axisLineCapMax = lineCap; + + x.title = @"X Axis"; + x.titleOffset = self.titleSize * CPTFloat(1.25); + +// Label y with an automatic label policy. + CPTXYAxis *y = axisSet.yAxis; + y.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + y.minorTicksPerInterval = 4; + y.preferredNumberOfMajorTicks = 8; + y.majorGridLineStyle = majorGridLineStyle; + y.minorGridLineStyle = minorGridLineStyle; + y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0]; + y.labelOffset = self.titleSize * CPTFloat(0.25); + + lineCap.lineStyle = y.axisLineStyle; + lineColor = lineCap.lineStyle.lineColor; + if ( lineColor ) { + lineCap.fill = [CPTFill fillWithColor:lineColor]; + } + y.axisLineCapMax = lineCap; + y.axisLineCapMin = lineCap; + + y.title = @"Y Axis"; + y.titleOffset = self.titleSize * CPTFloat(1.25); + +// Set axes + graph.axisSet.axes = @[x, y]; + +// Create the plots +// Bezier + CPTScatterPlot *bezierPlot = [[CPTScatterPlot alloc] initWithFrame:CGRectZero]; + bezierPlot.identifier = bezierCurveIdentifier; +// Catmull-Rom + CPTScatterPlot *cmUniformPlot = [[CPTScatterPlot alloc] initWithFrame:CGRectZero]; + cmUniformPlot.identifier = catmullRomUniformIdentifier; + CPTScatterPlot *cmCentripetalPlot = [[CPTScatterPlot alloc] initWithFrame:CGRectZero]; + cmCentripetalPlot.identifier = catmullRomCentripetalIdentifier; + CPTScatterPlot *cmChordalPlot = [[CPTScatterPlot alloc] initWithFrame:CGRectZero]; + cmChordalPlot.identifier = catmullRomChordalIdentifier; +// Hermite Cubic + CPTScatterPlot *hermitePlot = [[CPTScatterPlot alloc] initWithFrame:CGRectZero]; + hermitePlot.identifier = hermiteCubicIdentifier; + +// set interpolation types + bezierPlot.interpolation = cmUniformPlot.interpolation = cmCentripetalPlot.interpolation = cmChordalPlot.interpolation = hermitePlot.interpolation = CPTScatterPlotInterpolationCurved; + + bezierPlot.curvedInterpolationOption = CPTScatterPlotCurvedInterpolationNormal; + cmUniformPlot.curvedInterpolationOption = CPTScatterPlotCurvedInterpolationCatmullRomUniform; + cmChordalPlot.curvedInterpolationOption = CPTScatterPlotCurvedInterpolationCatmullRomChordal; + cmCentripetalPlot.curvedInterpolationOption = CPTScatterPlotCurvedInterpolationCatmullRomCentripetal; + hermitePlot.curvedInterpolationOption = CPTScatterPlotCurvedInterpolationHermiteCubic; + +// style plots + CPTMutableLineStyle *lineStyle = [bezierPlot.dataLineStyle mutableCopy]; + lineStyle.lineWidth = 2.0; + lineStyle.lineColor = [CPTColor greenColor]; + + bezierPlot.dataLineStyle = lineStyle; + + lineStyle.lineColor = [CPTColor redColor]; + cmUniformPlot.dataLineStyle = lineStyle; + + lineStyle.lineColor = [CPTColor orangeColor]; + cmCentripetalPlot.dataLineStyle = lineStyle; + + lineStyle.lineColor = [CPTColor yellowColor]; + cmChordalPlot.dataLineStyle = lineStyle; + + lineStyle.lineColor = [CPTColor cyanColor]; + hermitePlot.dataLineStyle = lineStyle; + +// set data source and add plots + bezierPlot.dataSource = cmUniformPlot.dataSource = cmCentripetalPlot.dataSource = cmChordalPlot.dataSource = hermitePlot.dataSource = self; + + [graph addPlot:bezierPlot]; + [graph addPlot:cmUniformPlot]; + [graph addPlot:cmCentripetalPlot]; + [graph addPlot:cmChordalPlot]; + [graph addPlot:hermitePlot]; + +// Auto scale the plot space to fit the plot data + [plotSpace scaleToFitPlots:[graph allPlots]]; + CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy]; + CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; + +// Expand the ranges to put some space around the plot + [xRange expandRangeByFactor:@1.2]; + [yRange expandRangeByFactor:@1.2]; + plotSpace.xRange = xRange; + plotSpace.yRange = yRange; + + [xRange expandRangeByFactor:@1.025]; + xRange.location = plotSpace.xRange.location; + [yRange expandRangeByFactor:@1.05]; + x.visibleAxisRange = xRange; + y.visibleAxisRange = yRange; + + [xRange expandRangeByFactor:@3.0]; + [yRange expandRangeByFactor:@3.0]; + plotSpace.globalXRange = xRange; + plotSpace.globalYRange = yRange; + +// Add plot symbols + CPTMutableLineStyle *symbolLineStyle = [CPTMutableLineStyle lineStyle]; + symbolLineStyle.lineColor = [[CPTColor blackColor] colorWithAlphaComponent:0.5]; + CPTPlotSymbol *plotSymbol = [CPTPlotSymbol ellipsePlotSymbol]; + plotSymbol.fill = [CPTFill fillWithColor:[[CPTColor blueColor] colorWithAlphaComponent:0.5]]; + plotSymbol.lineStyle = symbolLineStyle; + plotSymbol.size = CGSizeMake(5.0, 5.0); + bezierPlot.plotSymbol = cmUniformPlot.plotSymbol = cmCentripetalPlot.plotSymbol = cmChordalPlot.plotSymbol = hermitePlot.plotSymbol = plotSymbol; + +// Add legend + graph.legend = [CPTLegend legendWithGraph:graph]; + graph.legend.numberOfRows = 2; + graph.legend.textStyle = x.titleTextStyle; + graph.legend.fill = [CPTFill fillWithColor:[CPTColor darkGrayColor]]; + graph.legend.borderLineStyle = x.axisLineStyle; + graph.legend.cornerRadius = 5.0; + graph.legendAnchor = CPTRectAnchorBottom; + graph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(2.0)); +} + +#pragma mark - +#pragma mark Plot Data Source Methods + +-(NSUInteger)numberOfRecordsForPlot:(CPTPlot *__unused)plot +{ + return self.plotData.count; +} + +-(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +{ + NSString *identifier = (NSString *)plot.identifier; + + if ( fieldEnum == CPTScatterPlotFieldX ) { + return self.plotData[index][@"x"]; + } + else { + NSNumber *baseY = self.plotData[index][@"y"]; + double shift = 0.0; + if ( [identifier isEqualToString:catmullRomUniformIdentifier] ) { + shift = catmullRomUniformPlotYShift; + } + else if ( [identifier isEqualToString:catmullRomCentripetalIdentifier] ) { + shift = catmullRomCentripetalYShift; + } + else if ( [identifier isEqualToString:catmullRomChordalIdentifier] ) { + shift = catmullRomChordalYShift; + } + else if ( [identifier isEqualToString:hermiteCubicIdentifier] ) { + shift = hermiteCubicYShift; + } + else if ( [identifier isEqualToString:bezierCurveIdentifier] ) { + shift = bezierYShift; + } + return @(baseY.doubleValue + shift); + } +} + +#pragma mark - +#pragma mark Plot Space Delegate Methods + +-(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate +{ + CPTGraph *theGraph = space.graph; + CPTXYAxisSet *axisSet = (CPTXYAxisSet *)theGraph.axisSet; + + CPTMutablePlotRange *changedRange = [newRange mutableCopy]; + + switch ( coordinate ) { + case CPTCoordinateX: + [changedRange expandRangeByFactor:@1.025]; + changedRange.location = newRange.location; + axisSet.xAxis.visibleAxisRange = changedRange; + break; + + case CPTCoordinateY: + [changedRange expandRangeByFactor:@1.05]; + axisSet.yAxis.visibleAxisRange = changedRange; + break; + + default: + break; + } + + return newRange; +} + +@end diff --git a/examples/CorePlotGallery/src/plots/CurvedScatterPlot.m b/examples/CorePlotGallery/src/plots/CurvedScatterPlot.m index 51799f473..27e300d0f 100644 --- a/examples/CorePlotGallery/src/plots/CurvedScatterPlot.m +++ b/examples/CorePlotGallery/src/plots/CurvedScatterPlot.m @@ -34,7 +34,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Curved Scatter Plot"; self.section = kLinePlots; } @@ -59,7 +59,7 @@ -(void)killGraph -(void)generateData { - if ( self.plotData == nil ) { + if ( self.plotData.count == 0 ) { NSMutableArray *> *contentArray = [NSMutableArray array]; for ( NSUInteger i = 0; i < 11; i++ ) { @@ -94,7 +94,7 @@ -(void)generateData [contentArray addObject: @{ @"x": @(xLoc), - @"y": @( (dy / dx) / 20.0 ) } + @"y": @((dy / dx) / 20.0) } ]; } @@ -121,7 +121,7 @@ -(void)generateData [contentArray addObject: @{ @"x": @(xLoc), - @"y": @( (dy / dx) / 20.0 ) } + @"y": @((dy / dx) / 20.0) } ]; } @@ -129,9 +129,9 @@ -(void)generateData } } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -169,7 +169,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT redLineStyle.lineColor = [[CPTColor redColor] colorWithAlphaComponent:0.5]; CPTLineCap *lineCap = [CPTLineCap sweptArrowPlotLineCap]; - lineCap.size = CGSizeMake( self.titleSize * CPTFloat(0.625), self.titleSize * CPTFloat(0.625) ); + lineCap.size = CGSizeMake(self.titleSize * CPTFloat(0.625), self.titleSize * CPTFloat(0.625)); // Axes // Label x axis with a fixed interval policy @@ -200,6 +200,8 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT y.minorGridLineStyle = minorGridLineStyle; y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0]; y.labelOffset = self.titleSize * CPTFloat(0.25); + y.alternatingBandFills = @[[[CPTColor whiteColor] colorWithAlphaComponent:CPTFloat(0.1)], [NSNull null]]; + y.alternatingBandAnchor = @0.0; lineCap.lineStyle = y.axisLineStyle; lineColor = lineCap.lineStyle.lineColor; @@ -250,16 +252,11 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT // [graph addPlot:secondPlot]; // Auto scale the plot space to fit the plot data - [plotSpace scaleToFitPlots:[graph allPlots]]; + [plotSpace scaleToFitEntirePlots:[graph allPlots]]; CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy]; CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; // Expand the ranges to put some space around the plot - [xRange expandRangeByFactor:@1.2]; - [yRange expandRangeByFactor:@1.2]; - plotSpace.xRange = xRange; - plotSpace.yRange = yRange; - [xRange expandRangeByFactor:@1.025]; xRange.location = plotSpace.xRange.location; [yRange expandRangeByFactor:@1.05]; @@ -294,7 +291,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT graph.legend.borderLineStyle = x.axisLineStyle; graph.legend.cornerRadius = 5.0; graph.legendAnchor = CPTRectAnchorBottom; - graph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(2.0) ); + graph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(2.0)); } #pragma mark - @@ -368,7 +365,7 @@ -(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *)space willChangePlot #pragma mark - #pragma mark CPTScatterPlot delegate methods --(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index +-(void)scatterPlot:(nonnull CPTScatterPlot *__unused)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index { CPTXYGraph *graph = (self.graphs)[0]; @@ -390,7 +387,7 @@ -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordI NSNumber *x = dataPoint[@"x"]; NSNumber *y = dataPoint[@"y"]; - CPTNumberArray anchorPoint = @[x, y]; + CPTNumberArray *anchorPoint = @[x, y]; // Add annotation // First make a string for the y value @@ -415,6 +412,8 @@ -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordI annotation.contentAnchorPoint = CGPointMake(0.5, 0.0); annotation.displacement = CGPointMake(0.0, 10.0); [graph.plotAreaFrame.plotArea addAnnotation:annotation]; + + self.symbolTextAnnotation = annotation; } } @@ -436,7 +435,7 @@ -(void)scatterPlotDataLineTouchUp:(nonnull CPTScatterPlot *)plot #pragma mark - #pragma mark Plot area delegate method --(void)plotAreaWasSelected:(nonnull CPTPlotArea *)plotArea +-(void)plotAreaWasSelected:(nonnull CPTPlotArea *__unused)plotArea { // Remove the annotation CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; diff --git a/examples/CorePlotGallery/src/plots/DatePlot.m b/examples/CorePlotGallery/src/plots/DatePlot.m index 8cc19f69f..3bc85e487 100644 --- a/examples/CorePlotGallery/src/plots/DatePlot.m +++ b/examples/CorePlotGallery/src/plots/DatePlot.m @@ -5,15 +5,27 @@ #import "DatePlot.h" +typedef NSDictionary CPTPlotData; + +typedef NSArray CPTPlotDataArray; +typedef NSMutableArray CPTMutablePlotDataArray; + +static const NSUInteger kNumPoints = 10; +static const NSTimeInterval oneDay = 24 * 60 * 60; + @interface DatePlot() -@property (nonatomic, readwrite, strong, nonnull) NSArray *plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTPlotDataArray *plotData; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSpaceAnnotation *markerAnnotation; @end +#pragma mark - + @implementation DatePlot @synthesize plotData; +@synthesize markerAnnotation; +(void)load { @@ -22,7 +34,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Date Plot"; self.section = kLinePlots; } @@ -32,13 +44,11 @@ -(nonnull instancetype)init -(void)generateData { - if ( !self.plotData ) { - const NSTimeInterval oneDay = 24 * 60 * 60; - + if ( self.plotData.count == 0 ) { // Add some data - NSMutableArray *newData = [NSMutableArray array]; + CPTMutablePlotDataArray *newData = [NSMutableArray array]; - for ( NSUInteger i = 0; i < 5; i++ ) { + for ( NSUInteger i = 0; i < kNumPoints; i++ ) { NSTimeInterval xVal = oneDay * i; double yVal = 1.2 * arc4random() / (double)UINT32_MAX + 1.2; @@ -53,7 +63,7 @@ -(void)generateData } } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { // If you make sure your dates are calculated at noon, you shouldn't have to // worry about daylight savings. If you use midnight, you will have to adjust @@ -71,9 +81,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; NSDate *refDate = [gregorian dateFromComponents:dateComponents]; - NSTimeInterval oneDay = 24 * 60 * 60; - -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -83,11 +91,20 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT [self addGraph:graph toHostingView:hostingView]; [self applyTheme:theme toGraph:graph withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]]; + graph.plotAreaFrame.paddingLeft = 36.0; + graph.plotAreaFrame.paddingTop = 12.0; + graph.plotAreaFrame.paddingRight = 12.0; + graph.plotAreaFrame.paddingBottom = 12.0; + // Setup scatter plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; - NSTimeInterval xLow = 0.0; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(xLow) length:@(oneDay * 5.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@3.0]; + + NSTimeInterval xLow = 0.0; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(xLow) length:@(oneDay * (kNumPoints - 1))]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@2.0]; + + plotSpace.allowsUserInteraction = YES; + plotSpace.delegate = self; // Axes CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; @@ -107,6 +124,24 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT y.minorTicksPerInterval = 5; y.orthogonalPosition = @(oneDay); + CPTMutableLineStyle *blueLineStyle = [CPTMutableLineStyle lineStyle]; + blueLineStyle.lineColor = [CPTColor blueColor]; + blueLineStyle.lineWidth = 2.0; + + CPTXYAxis *iAxis = [[CPTXYAxis alloc] initWithFrame:CGRectZero]; + iAxis.title = nil; + iAxis.labelFormatter = nil; + iAxis.axisLineStyle = blueLineStyle; + + iAxis.coordinate = CPTCoordinateY; + iAxis.plotSpace = graph.defaultPlotSpace; + iAxis.majorTickLineStyle = nil; + iAxis.minorTickLineStyle = nil; + iAxis.orthogonalPosition = @0.0; + iAxis.hidden = YES; + + graph.axisSet.axes = @[x, y, iAxis]; + // Create a plot that uses the data source method CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] init]; dataSourceLinePlot.identifier = @"Date Plot"; @@ -118,19 +153,125 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT dataSourceLinePlot.dataSource = self; [graph addPlot:dataSourceLinePlot]; + + // Setup a style for the annotation + CPTMutableTextStyle *hitAnnotationTextStyle = [CPTMutableTextStyle textStyle]; + hitAnnotationTextStyle.color = [CPTColor blackColor]; + hitAnnotationTextStyle.fontName = @"Helvetica-Bold"; + hitAnnotationTextStyle.fontSize = self.titleSize * CPTFloat(0.5); + + CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:@"Annotation" style:hitAnnotationTextStyle]; + textLayer.borderLineStyle = blueLineStyle; + textLayer.fill = [CPTFill fillWithColor:[CPTColor whiteColor]]; + textLayer.cornerRadius = 3.0; + textLayer.paddingLeft = 2.0; + textLayer.paddingTop = 2.0; + textLayer.paddingRight = 2.0; + textLayer.paddingBottom = 2.0; + textLayer.hidden = YES; + + CPTPlotSpaceAnnotation *annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:plotSpace anchorPlotPoint:@[@0, @0]]; + annotation.contentLayer = textLayer; + + [graph addAnnotation:annotation]; + + self.markerAnnotation = annotation; } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { return self.plotData[index][@(fieldEnum)]; } +#pragma mark - +#pragma mark Plot Space Delegate Methods + +-(CGPoint)plotSpace:(CPTPlotSpace *__unused)space willDisplaceBy:(CGPoint __unused)displacement +{ + return CPTPointMake(0.0, 0.0); +} + +-(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *__unused)newRange forCoordinate:(CPTCoordinate)coordinate +{ + CPTPlotRange *updatedRange = nil; + + CPTXYPlotSpace *xySpace = (CPTXYPlotSpace *)space; + + switch ( coordinate ) { + case CPTCoordinateX: + updatedRange = xySpace.xRange; + break; + + case CPTCoordinateY: + updatedRange = xySpace.yRange; + break; + + default: + break; + } + + return updatedRange; +} + +-(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint __unused)point +{ + CPTXYPlotSpace *xySpace = (CPTXYPlotSpace *)space; + + CPTGraph *graph = space.graph; + + CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; + + CPTAxisArray *axes = axisSet.axes; + CPTXYAxis *iAxis = axes.lastObject; + + CPTNumberArray *plotPoint = [space plotPointForEvent:event]; + + CPTPlotSpaceAnnotation *annotation = self.markerAnnotation; + + CPTTextLayer *textLayer = (CPTTextLayer *)annotation.contentLayer; + + NSNumber *xNumber = plotPoint[CPTCoordinateX]; + + if ( [xySpace.xRange containsNumber:xNumber] ) { + NSUInteger x = (NSUInteger)lround(xNumber.doubleValue / oneDay); + + xNumber = @(x * oneDay); + + NSString *dateValue = [axisSet.xAxis.labelFormatter stringForObjectValue:xNumber]; + NSNumber *plotValue = self.plotData[x][@(CPTCoordinateY)]; + + textLayer.text = [NSString stringWithFormat:@"%@ → %@", dateValue, [NSString stringWithFormat:@"%1.3f", plotValue.doubleValue]]; + textLayer.hidden = NO; + + annotation.anchorPlotPoint = @[xNumber, xySpace.yRange.maxLimit]; + + iAxis.orthogonalPosition = xNumber; + iAxis.hidden = NO; + } + else { + textLayer.hidden = YES; + iAxis.hidden = YES; + } + + return NO; +} + +-(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)point +{ + return [self plotSpace:space shouldHandlePointingDeviceDownEvent:event atPoint:point]; +} + +-(BOOL)plotSpace:(CPTPlotSpace *__unused)space shouldHandlePointingDeviceUpEvent:(CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)point +{ + return NO; +} + @end diff --git a/examples/CorePlotGallery/src/plots/DonutChart.h b/examples/CorePlotGallery/src/plots/DonutChart.h index ad7f4823e..bab4de00a 100644 --- a/examples/CorePlotGallery/src/plots/DonutChart.h +++ b/examples/CorePlotGallery/src/plots/DonutChart.h @@ -2,6 +2,7 @@ @interface DonutChart : PlotItem @end diff --git a/examples/CorePlotGallery/src/plots/DonutChart.m b/examples/CorePlotGallery/src/plots/DonutChart.m index f05fa77ac..a56ec42fb 100644 --- a/examples/CorePlotGallery/src/plots/DonutChart.m +++ b/examples/CorePlotGallery/src/plots/DonutChart.m @@ -5,7 +5,7 @@ @interface DonutChart() -@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *plotData; @end @@ -20,7 +20,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Donut Chart"; self.section = kPieCharts; } @@ -30,14 +30,14 @@ -(nonnull instancetype)init -(void)generateData { - if ( self.plotData == nil ) { + if ( self.plotData.count == 0 ) { self.plotData = @[@20.0, @30.0, @60.0]; } } -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -59,8 +59,8 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT whiteShadow.shadowColor = [[CPTColor whiteColor] colorWithAlphaComponent:0.25]; // Add pie chart - const CGFloat outerRadius = MIN( CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * graph.paddingLeft) / CPTFloat(2.0), - CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * graph.paddingTop) / CPTFloat(2.0) ); + const CGFloat outerRadius = MIN(CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * graph.paddingLeft) / CPTFloat(2.0), + CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * graph.paddingTop) / CPTFloat(2.0)); const CGFloat innerRadius = outerRadius / CPTFloat(2.0); CPTPieChart *piePlot = [[CPTPieChart alloc] init]; @@ -92,7 +92,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT // Add another pie chart piePlot = [[CPTPieChart alloc] init]; piePlot.dataSource = self; - piePlot.pieRadius = ( animated ? CPTFloat(0.0) : ( innerRadius - CPTFloat(5.0) ) ); + piePlot.pieRadius = (animated ? CPTFloat(0.0) : (innerRadius - CPTFloat(5.0))); piePlot.identifier = innerChartName; piePlot.borderLineStyle = whiteLineStyle; piePlot.startAngle = CPTFloat(M_PI_4); @@ -121,12 +121,12 @@ -(void)pieChart:(nonnull CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUIn #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num; @@ -149,8 +149,8 @@ -(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUI if ( [(NSString *) plot.identifier isEqualToString:outerChartName] ) { dispatch_once(&onceToken, ^{ - whiteText = [[CPTMutableTextStyle alloc] init]; - whiteText.color = [CPTColor whiteColor]; + whiteText = [[CPTMutableTextStyle alloc] init]; + whiteText.color = [CPTColor whiteColor]; whiteText.fontSize = self.titleSize * CPTFloat(0.5); }); @@ -195,12 +195,12 @@ -(void)animationCancelled:(nonnull CPTAnimationOperation *)operation NSLog(@"animationCancelled: %@", operation); } --(void)animationWillUpdate:(nonnull CPTAnimationOperation *)operation +-(void)animationWillUpdate:(nonnull CPTAnimationOperation *__unused)operation { NSLog(@"animationWillUpdate:"); } --(void)animationDidUpdate:(nonnull CPTAnimationOperation *)operation +-(void)animationDidUpdate:(nonnull CPTAnimationOperation *__unused)operation { NSLog(@"animationDidUpdate:"); } diff --git a/examples/CorePlotGallery/src/plots/FunctionPlot.m b/examples/CorePlotGallery/src/plots/FunctionPlot.m index cfa93a914..839ca3d52 100644 --- a/examples/CorePlotGallery/src/plots/FunctionPlot.m +++ b/examples/CorePlotGallery/src/plots/FunctionPlot.m @@ -6,13 +6,7 @@ @interface FunctionPlot() @property (nonatomic, readwrite, strong) NSMutableSet *dataSources; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE -typedef UIFont CPTFont; -#else -typedef NSFont CPTFont; -#endif - --(nullable CPTFont *)italicFontForFont:(nonnull CPTFont *)oldFont; +-(nullable CPTNativeFont *)italicFontForFont:(nonnull CPTNativeFont *)oldFont; @end @@ -33,7 +27,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { dataSources = [[NSMutableSet alloc] init]; self.title = @"Math Function Plot"; @@ -50,9 +44,9 @@ -(void)killGraph [super killGraph]; } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -118,13 +112,13 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT switch ( plotNum ) { case 0: - titleString = @"y = sin(x)"; + titleString = NSLocalizedString(@"y = sin(x)", @"y = sin(x)"); function = &sin; lineColor = [CPTColor redColor]; break; case 1: - titleString = @"y = cos(x)"; + titleString = NSLocalizedString(@"y = cos(x)", @"y = cos(x)"); block = ^(double xVal) { return cos(xVal); }; @@ -132,7 +126,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT break; case 2: - titleString = @"y = tan(x)"; + titleString = NSLocalizedString(@"y = tan(x)", @"y = tan(x)"); function = &tan; lineColor = [CPTColor blueColor]; break; @@ -141,14 +135,14 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT CPTScatterPlot *linePlot = [[CPTScatterPlot alloc] init]; linePlot.identifier = [NSString stringWithFormat:@"Function Plot %lu", (unsigned long)(plotNum + 1)]; - CPTDictionary textAttributes = x.titleTextStyle.attributes; + CPTDictionary *textAttributes = x.titleTextStyle.attributes; NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:titleString attributes:textAttributes]; - CPTFont *fontAttribute = textAttributes[NSFontAttributeName]; + CPTNativeFont *fontAttribute = textAttributes[NSFontAttributeName]; if ( fontAttribute ) { - CPTFont *italicFont = [self italicFontForFont:fontAttribute]; + CPTNativeFont *italicFont = [self italicFontForFont:fontAttribute]; [title addAttribute:NSFontAttributeName value:italicFont @@ -158,7 +152,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT range:NSMakeRange(8, 1)]; } - CPTFont *labelFont = [CPTFont fontWithName:@"Helvetica" size:self.titleSize * CPTFloat(0.5)]; + CPTNativeFont *labelFont = [CPTNativeFont fontWithName:@"Helvetica" size:self.titleSize * CPTFloat(0.5)]; [title addAttribute:NSFontAttributeName value:labelFont range:NSMakeRange(0, title.length)]; @@ -201,7 +195,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT graph.legend.numberOfRows = 1; graph.legend.delegate = self; graph.legendAnchor = CPTRectAnchorBottom; - graph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(1.25) ); + graph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(1.25)); } #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE @@ -209,7 +203,7 @@ -(nullable UIFont *)italicFontForFont:(nonnull UIFont *)oldFont { NSString *italicName = nil; - CPTStringArray fontNames = [UIFont fontNamesForFamilyName:oldFont.familyName]; + CPTStringArray *fontNames = [UIFont fontNamesForFamilyName:oldFont.familyName]; for ( NSString *fontName in fontNames ) { NSString *upperCaseFontName = fontName.uppercaseString; @@ -242,11 +236,12 @@ -(nullable NSFont *)italicFontForFont:(nonnull NSFont *)oldFont return [[NSFontManager sharedFontManager] convertFont:oldFont toHaveTrait:NSFontItalicTrait]; } + #endif #pragma mark - Legend delegate --(void)legend:(nonnull CPTLegend *)legend legendEntryForPlot:(nonnull CPTPlot *)plot wasSelectedAtIndex:(NSUInteger)idx +-(void)legend:(nonnull CPTLegend *__unused)legend legendEntryForPlot:(nonnull CPTPlot *)plot wasSelectedAtIndex:(NSUInteger __unused)idx { plot.hidden = !plot.hidden; } diff --git a/examples/CorePlotGallery/src/plots/GradientScatterPlot.m b/examples/CorePlotGallery/src/plots/GradientScatterPlot.m index d2970ede8..db1004011 100644 --- a/examples/CorePlotGallery/src/plots/GradientScatterPlot.m +++ b/examples/CorePlotGallery/src/plots/GradientScatterPlot.m @@ -24,7 +24,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Gradient Scatter Plot"; self.section = kLinePlots; } @@ -49,7 +49,7 @@ -(void)killGraph -(void)generateData { - if ( self.plotData == nil ) { + if ( self.plotData.count == 0 ) { NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; for ( NSUInteger i = 0; i < 10; i++ ) { NSNumber *x = @(1.0 + i * 0.05); @@ -61,9 +61,9 @@ -(void)generateData } } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -190,27 +190,23 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); NSNumber *num = self.plotData[index][key]; - if ( fieldEnum == CPTScatterPlotFieldY ) { - num = @(num.doubleValue); - } - return num; } #pragma mark - #pragma mark Plot Space Delegate Methods --(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *)space willChangePlotRangeTo:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate +-(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *__unused)space willChangePlotRangeTo:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate { // Impose a limit on how far user can scroll in x if ( coordinate == CPTCoordinateX ) { @@ -226,7 +222,7 @@ -(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *)space willChangePlot #pragma mark - #pragma mark CPTScatterPlot delegate method --(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index +-(void)scatterPlot:(nonnull CPTScatterPlot *__unused)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index { CPTGraph *graph = (self.graphs)[0]; @@ -249,7 +245,7 @@ -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordI NSNumber *x = dataPoint[@"x"]; NSNumber *y = dataPoint[@"y"]; - CPTNumberArray anchorPoint = @[x, y]; + CPTNumberArray *anchorPoint = @[x, y]; // Add annotation // First make a string for the y value @@ -272,7 +268,7 @@ -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordI #pragma mark - #pragma mark Plot area delegate method --(void)plotAreaWasSelected:(nonnull CPTPlotArea *)plotArea +-(void)plotAreaWasSelected:(nonnull CPTPlotArea *__unused)plotArea { // Remove the annotation CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; diff --git a/examples/CorePlotGallery/src/plots/ImageDemo.m b/examples/CorePlotGallery/src/plots/ImageDemo.m index 5606d3120..df304a094 100644 --- a/examples/CorePlotGallery/src/plots/ImageDemo.m +++ b/examples/CorePlotGallery/src/plots/ImageDemo.m @@ -14,7 +14,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Image Demo"; self.section = kDemoPlots; } @@ -22,7 +22,7 @@ -(nonnull instancetype)init return self; } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { #if TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; diff --git a/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.m b/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.m index f97964b57..5be94fe80 100644 --- a/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.m +++ b/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.m @@ -14,7 +14,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Axis Labeling Policies"; self.section = kDemoPlots; } @@ -22,7 +22,7 @@ -(nonnull instancetype)init return self; } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { const CGFloat majorTickLength = 12.0; const CGFloat minorTickLength = 8.0; @@ -70,9 +70,9 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT axisTitleTextStyle.fontName = @"Helvetica-Bold"; // Tick locations - CPTNumberSet majorTickLocations = [NSSet setWithObjects:@0, @30, @50, @85, @100, nil]; + CPTNumberSet *majorTickLocations = [NSSet setWithObjects:@0, @30, @50, @85, @100, nil]; - CPTMutableNumberSet minorTickLocations = [NSMutableSet set]; + CPTMutableNumberSet *minorTickLocations = [NSMutableSet set]; for ( NSUInteger loc = 0; loc <= 100; loc += 10 ) { [minorTickLocations addObject:@(loc)]; } @@ -95,7 +95,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT axisNone.majorTickLocations = majorTickLocations; axisNone.minorTickLocations = minorTickLocations; - CPTMutableAxisLabelSet newAxisLabels = [NSMutableSet set]; + CPTMutableAxisLabelSet *newAxisLabels = [NSMutableSet set]; for ( NSUInteger i = 0; i <= 5; i++ ) { CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithText:[NSString stringWithFormat:@"Label %lu", (unsigned long)i] textStyle:axisNone.labelTextStyle]; diff --git a/examples/CorePlotGallery/src/plots/LineCapDemo.m b/examples/CorePlotGallery/src/plots/LineCapDemo.m index e9690f144..c5b5eb68f 100644 --- a/examples/CorePlotGallery/src/plots/LineCapDemo.m +++ b/examples/CorePlotGallery/src/plots/LineCapDemo.m @@ -14,7 +14,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Line Caps"; self.section = kDemoPlots; } @@ -22,7 +22,7 @@ -(nonnull instancetype)init return self; } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { #if TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; @@ -60,7 +60,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT lineCap.fill = [CPTFill fillWithColor:[CPTColor blueColor]]; // Axes - CPTMutableAxisArray axes = [[NSMutableArray alloc] init]; + CPTMutableAxisArray *axes = [[NSMutableArray alloc] init]; CPTLineCapType lineCapType = CPTLineCapTypeNone; while ( lineCapType < CPTLineCapTypeCustom ) { diff --git a/examples/CorePlotGallery/src/plots/OHLCPlot.m b/examples/CorePlotGallery/src/plots/OHLCPlot.m index 224be5551..7761c4069 100644 --- a/examples/CorePlotGallery/src/plots/OHLCPlot.m +++ b/examples/CorePlotGallery/src/plots/OHLCPlot.m @@ -26,9 +26,9 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { graph = nil; - plotData = nil; + plotData = @[]; self.title = @"OHLC Plot"; self.section = kFinancialPlots; @@ -39,15 +39,15 @@ -(nonnull instancetype)init -(void)generateData { - if ( !self.plotData ) { + if ( self.plotData.count == 0 ) { NSMutableArray *newData = [NSMutableArray array]; for ( NSUInteger i = 0; i < 8; i++ ) { NSTimeInterval x = oneDay * i; double rOpen = 3.0 * arc4random() / (double)UINT32_MAX + 1.0; double rClose = (arc4random() / (double)UINT32_MAX - 0.5) * 0.125 + rOpen; - double rHigh = MAX( rOpen, MAX(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen) ); - double rLow = MIN( rOpen, MIN(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen) ); + double rHigh = MAX(rOpen, MAX(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen)); + double rLow = MIN(rOpen, MIN(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen)); [newData addObject: @{ @(CPTTradingRangePlotFieldX): @(x), @@ -62,14 +62,14 @@ -(void)generateData } } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { // If you make sure your dates are calculated at noon, you shouldn't have to // worry about daylight savings. If you use midnight, you will have to adjust // for daylight savings time. NSDate *refDate = [NSDate dateWithTimeIntervalSinceReferenceDate:oneDay / 2.0]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -105,7 +105,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT CPTLineCap *lineCap = [[CPTLineCap alloc] init]; lineCap.lineStyle = xAxis.axisLineStyle; lineCap.lineCapType = CPTLineCapTypeOpenArrow; - lineCap.size = CGSizeMake( self.titleSize * CPTFloat(0.5), self.titleSize * CPTFloat(0.5) ); + lineCap.size = CGSizeMake(self.titleSize * CPTFloat(0.5), self.titleSize * CPTFloat(0.5)); xAxis.axisLineCapMax = lineCap; CPTXYAxis *yAxis = xyAxisSet.yAxis; @@ -170,7 +170,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT newGraph.legend.cornerRadius = 5.0; newGraph.legend.swatchCornerRadius = 5.0; newGraph.legendAnchor = CPTRectAnchorBottom; - newGraph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(3.0) ); + newGraph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(3.0)); // Set plot ranges CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; @@ -181,7 +181,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } diff --git a/examples/CorePlotGallery/src/plots/PlotSpaceDemo.m b/examples/CorePlotGallery/src/plots/PlotSpaceDemo.m index 05a0c4482..c192afd12 100644 --- a/examples/CorePlotGallery/src/plots/PlotSpaceDemo.m +++ b/examples/CorePlotGallery/src/plots/PlotSpaceDemo.m @@ -14,7 +14,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Plot Space Demo"; self.section = kDemoPlots; } @@ -22,7 +22,7 @@ -(nonnull instancetype)init return self; } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { const CGFloat majorTickLength = 12.0; const CGFloat minorTickLength = 8.0; diff --git a/examples/CorePlotGallery/src/plots/RangePlot.m b/examples/CorePlotGallery/src/plots/RangePlot.m index ef761f2d4..779a94ee0 100644 --- a/examples/CorePlotGallery/src/plots/RangePlot.m +++ b/examples/CorePlotGallery/src/plots/RangePlot.m @@ -30,9 +30,9 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { graph = nil; - plotData = nil; + plotData = @[]; self.title = @"Range Plot"; self.section = kFinancialPlots; @@ -43,7 +43,7 @@ -(nonnull instancetype)init -(void)generateData { - if ( self.plotData == nil ) { + if ( self.plotData.count == 0 ) { NSMutableArray *newData = [NSMutableArray array]; for ( NSUInteger i = 0; i < 5; i++ ) { NSTimeInterval x = oneDay * (i + 1.0); @@ -68,14 +68,14 @@ -(void)generateData } } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { // If you make sure your dates are calculated at noon, you shouldn't have to // worry about daylight savings. If you use midnight, you will have to adjust // for daylight savings time. NSDate *refDate = [NSDate dateWithTimeIntervalSinceReferenceDate:oneDay / 2.0]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -95,7 +95,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT textStyle.fontName = @"Helvetica"; textStyle.fontSize = self.titleSize * CPTFloat(0.5); -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:@"Touch to Toggle Range Plot Style" style:textStyle]; #else CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:@"Click to Toggle Range Plot Style" style:textStyle]; @@ -170,19 +170,20 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT newGraph.legend.borderLineStyle = x.axisLineStyle; newGraph.legend.cornerRadius = 5.0; newGraph.legend.swatchCornerRadius = 3.0; + newGraph.legend.swatchLayout = CPTLegendSwatchLayoutBottom; newGraph.legendAnchor = CPTRectAnchorTop; - newGraph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(-2.0) - CPTFloat(12.0) ); + newGraph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(-2.0) - CPTFloat(12.0)); } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { return self.plotData[index][@(fieldEnum)]; } @@ -190,7 +191,7 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum #pragma mark - #pragma mark Plot Space Delegate Methods --(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)point +-(BOOL)plotSpace:(nonnull CPTPlotSpace *__unused)space shouldHandlePointingDeviceUpEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)point { CPTRangePlot *rangePlot = (CPTRangePlot *)[self.graph plotWithIdentifier:@"Range Plot"]; @@ -209,6 +210,11 @@ -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent return NO; } +-(nullable NSNumber *)barWidthForRangePlot:(nonnull CPTRangePlot *__unused)plot recordIndex:(NSUInteger __unused)idx +{ + return @(arc4random_uniform(85) + 15); +} + #pragma mark - #pragma mark Plot Delegate Methods diff --git a/examples/CorePlotGallery/src/plots/RealTimePlot.m b/examples/CorePlotGallery/src/plots/RealTimePlot.m index 204c103db..053fdda2b 100644 --- a/examples/CorePlotGallery/src/plots/RealTimePlot.m +++ b/examples/CorePlotGallery/src/plots/RealTimePlot.m @@ -13,7 +13,7 @@ @interface RealTimePlot() -@property (nonatomic, readwrite, strong, nonnull) CPTMutableNumberArray plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableNumberArray *plotData; @property (nonatomic, readwrite, assign) NSUInteger currentIndex; @property (nonatomic, readwrite, strong, nullable) NSTimer *dataTimer; @@ -32,7 +32,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { plotData = [[NSMutableArray alloc] initWithCapacity:kMaxDataPoints]; dataTimer = nil; @@ -59,7 +59,7 @@ -(void)generateData -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -158,7 +158,7 @@ -(void)dealloc #pragma mark - #pragma mark Timer callback --(void)newData:(nonnull NSTimer *)theTimer +-(void)newData:(nonnull NSTimer *__unused)theTimer { CPTGraph *theGraph = (self.graphs)[0]; CPTPlot *thePlot = [theGraph plotWithIdentifier:kPlotIdentifier]; @@ -172,7 +172,7 @@ -(void)newData:(nonnull NSTimer *)theTimer CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)theGraph.defaultPlotSpace; NSUInteger location = (self.currentIndex >= kMaxDataPoints ? self.currentIndex - kMaxDataPoints + 2 : 0); - CPTPlotRange *oldRange = [CPTPlotRange plotRangeWithLocation:@( (location > 0) ? (location - 1) : 0 ) + CPTPlotRange *oldRange = [CPTPlotRange plotRangeWithLocation:@((location > 0) ? (location - 1) : 0) length:@(kMaxDataPoints - 2)]; CPTPlotRange *newRange = [CPTPlotRange plotRangeWithLocation:@(location) length:@(kMaxDataPoints - 2)]; @@ -184,7 +184,7 @@ -(void)newData:(nonnull NSTimer *)theTimer duration:CPTFloat(1.0 / kFrameRate)]; self.currentIndex++; - [self.plotData addObject:@( (1.0 - kAlpha) * self.plotData.lastObject.doubleValue + kAlpha * arc4random() / (double)UINT32_MAX )]; + [self.plotData addObject:@((1.0 - kAlpha) * self.plotData.lastObject.doubleValue + kAlpha * arc4random() / (double)UINT32_MAX)]; [thePlot insertDataAtIndex:self.plotData.count - 1 numberOfRecords:1]; } } @@ -192,12 +192,12 @@ -(void)newData:(nonnull NSTimer *)theTimer #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num = nil; diff --git a/examples/CorePlotGallery/src/plots/SimplePieChart.m b/examples/CorePlotGallery/src/plots/SimplePieChart.m index 39972e663..76e5c79ac 100644 --- a/examples/CorePlotGallery/src/plots/SimplePieChart.m +++ b/examples/CorePlotGallery/src/plots/SimplePieChart.m @@ -7,7 +7,7 @@ @interface SimplePieChart() -@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *plotData; @property (nonatomic, readwrite) NSUInteger offsetIndex; @property (nonatomic, readwrite) CGFloat sliceOffset; @@ -26,7 +26,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Simple Pie Chart"; self.section = kPieCharts; @@ -38,14 +38,14 @@ -(nonnull instancetype)init -(void)generateData { - if ( self.plotData == nil ) { + if ( self.plotData.count == 0 ) { self.plotData = @[@20.0, @30.0, @60.0]; } } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -68,8 +68,8 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT // Add pie chart CPTPieChart *piePlot = [[CPTPieChart alloc] init]; piePlot.dataSource = self; - piePlot.pieRadius = MIN( CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * graph.paddingLeft) / CPTFloat(2.0), - CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * graph.paddingTop) / CPTFloat(2.0) ); + piePlot.pieRadius = MIN(CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * graph.paddingLeft) / CPTFloat(2.0), + CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * graph.paddingTop) / CPTFloat(2.0)); piePlot.identifier = self.title; piePlot.startAngle = CPTFloat(M_PI_4); piePlot.sliceDirection = CPTPieDirectionCounterClockwise; @@ -105,14 +105,14 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT graph.legendDisplacement = CGPointMake(-graph.paddingRight - CPTFloat(10.0), 0.0); } --(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUInteger)index +-(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *__unused)plot recordIndex:(NSUInteger)index { static CPTMutableTextStyle *whiteText = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - whiteText = [[CPTMutableTextStyle alloc] init]; - whiteText.color = [CPTColor whiteColor]; + whiteText = [[CPTMutableTextStyle alloc] init]; + whiteText.color = [CPTColor whiteColor]; whiteText.fontSize = self.titleSize * CPTFloat(0.5); }); @@ -135,8 +135,8 @@ -(void)pieChart:(nonnull CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUIn self.offsetIndex = NSNotFound; - CPTMutableNumberArray newData = [[NSMutableArray alloc] init]; - NSUInteger dataCount = (NSUInteger)lrint( ceil(10.0 * arc4random() / (double)UINT32_MAX) ) + 1; + CPTMutableNumberArray *newData = [[NSMutableArray alloc] init]; + NSUInteger dataCount = (NSUInteger)lrint(ceil(10.0 * arc4random() / (double)UINT32_MAX)) + 1; for ( NSUInteger i = 1; i < dataCount; i++ ) { [newData addObject:@(100.0 * arc4random() / (double)UINT32_MAX)]; } @@ -150,14 +150,14 @@ -(void)pieChart:(nonnull CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUIn #pragma mark - #pragma mark CPTLegendDelegate Methods --(void)legend:(nonnull CPTLegend *)legend legendEntryForPlot:(nonnull CPTPlot *)plot wasSelectedAtIndex:(NSUInteger)idx +-(void)legend:(nonnull CPTLegend *__unused)legend legendEntryForPlot:(nonnull CPTPlot *)plot wasSelectedAtIndex:(NSUInteger)idx { NSLog(@"Legend entry for '%@' was selected at index %lu.", plot.identifier, (unsigned long)idx); [CPTAnimation animate:self property:@"sliceOffset" - from:CPTFloat(idx == self.offsetIndex ? CPTNAN : 0.0) - to:CPTFloat(idx == self.offsetIndex ? 0.0 : 35.0) + from:(idx == self.offsetIndex ? CPTNAN : CPTFloat(0.0)) + to:(idx == self.offsetIndex ? CPTFloat(0.0) : CPTFloat(35.0)) duration:0.5 animationCurve:CPTAnimationCurveCubicOut delegate:nil]; @@ -168,12 +168,12 @@ -(void)legend:(nonnull CPTLegend *)legend legendEntryForPlot:(nonnull CPTPlot *) #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num; @@ -187,17 +187,14 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum return num; } --(NSAttributedString *)attributedLegendTitleForPieChart:(nonnull CPTPieChart *)pieChart recordIndex:(NSUInteger)index +-(NSAttributedString *)attributedLegendTitleForPieChart:(nonnull CPTPieChart *__unused)pieChart recordIndex:(NSUInteger)index { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - UIColor *sliceColor = [CPTPieChart defaultPieSliceColorForIndex:index].uiColor; - UIFont *labelFont = [UIFont fontWithName:@"Helvetica" size:self.titleSize * CPTFloat(0.5)]; -#else - NSColor *sliceColor = [CPTPieChart defaultPieSliceColorForIndex:index].nsColor; - NSFont *labelFont = [NSFont fontWithName:@"Helvetica" size:self.titleSize * CPTFloat(0.5)]; -#endif + CPTNativeColor *sliceColor = [CPTPieChart defaultPieSliceColorForIndex:index].nativeColor; + CPTNativeFont *labelFont = [CPTNativeFont fontWithName:@"Helvetica" + size:self.titleSize * CPTFloat(0.5)]; NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"Pie Slice %lu", (unsigned long)index]]; + [title addAttribute:NSForegroundColorAttributeName value:sliceColor range:NSMakeRange(4, 5)]; @@ -209,7 +206,7 @@ -(NSAttributedString *)attributedLegendTitleForPieChart:(nonnull CPTPieChart *)p return title; } --(CGFloat)radialOffsetForPieChart:(nonnull CPTPieChart *)pieChart recordIndex:(NSUInteger)index +-(CGFloat)radialOffsetForPieChart:(nonnull CPTPieChart *__unused)pieChart recordIndex:(NSUInteger)index { return index == self.offsetIndex ? self.sliceOffset : 0.0; } @@ -224,7 +221,7 @@ -(void)setSliceOffset:(CGFloat)newOffset [self.graphs[0] reloadData]; - if ( newOffset == CPTFloat(0.0) ) { + if ( newOffset == CPTFloat(0.0)) { self.offsetIndex = NSNotFound; } } diff --git a/examples/CorePlotGallery/src/plots/SimpleScatterPlot.m b/examples/CorePlotGallery/src/plots/SimpleScatterPlot.m index 47a3f92cc..4a321efc4 100644 --- a/examples/CorePlotGallery/src/plots/SimpleScatterPlot.m +++ b/examples/CorePlotGallery/src/plots/SimpleScatterPlot.m @@ -26,7 +26,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Simple Scatter Plot"; self.section = kLinePlots; @@ -53,7 +53,7 @@ -(void)killGraph -(void)generateData { - if ( self.plotData == nil ) { + if ( self.plotData.count == 0 ) { NSMutableArray *contentArray = [NSMutableArray array]; for ( NSUInteger i = 0; i < 10; i++ ) { NSNumber *x = @(1.0 + i * 0.05); @@ -65,9 +65,9 @@ -(void)generateData } } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -184,12 +184,12 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); NSNumber *num = self.plotData[index][key]; @@ -200,7 +200,7 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum #pragma mark - #pragma mark Plot Space Delegate Methods --(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *)space willChangePlotRangeTo:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate +-(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *__unused)space willChangePlotRangeTo:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate { // Impose a limit on how far user can scroll in x if ( coordinate == CPTCoordinateX ) { @@ -217,7 +217,7 @@ -(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *)space willChangePlot #pragma mark - #pragma mark CPTScatterPlot delegate methods --(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index +-(void)scatterPlot:(nonnull CPTScatterPlot *__unused)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index { CPTXYGraph *graph = (self.graphs)[0]; @@ -240,7 +240,7 @@ -(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordI NSNumber *x = dataPoint[@"x"]; NSNumber *y = dataPoint[@"y"]; - CPTNumberArray anchorPoint = @[x, y]; + CPTNumberArray *anchorPoint = @[x, y]; // Add annotation // First make a string for the y value @@ -278,7 +278,7 @@ -(void)scatterPlotDataLineTouchUp:(nonnull CPTScatterPlot *)plot #pragma mark - #pragma mark Plot area delegate method --(void)plotAreaWasSelected:(nonnull CPTPlotArea *)plotArea +-(void)plotAreaWasSelected:(nonnull CPTPlotArea *__unused)plotArea { CPTXYGraph *graph = (self.graphs)[0]; @@ -293,8 +293,8 @@ -(void)plotAreaWasSelected:(nonnull CPTPlotArea *)plotArea else { CPTScatterPlotInterpolation interpolation = CPTScatterPlotInterpolationHistogram; - // Decrease the histogram display option, and if < 0 display linear graph - if ( --self.histogramOption < 0 ) { + // Decrease the histogram display option, and if < CPTScatterPlotHistogramNormal display linear graph + if ( --self.histogramOption < CPTScatterPlotHistogramNormal ) { interpolation = CPTScatterPlotInterpolationLinear; // Set the histogram option to the count, as that is guaranteed to be the last available option + 1 diff --git a/examples/CorePlotGallery/src/plots/SteppedScatterPlot.h b/examples/CorePlotGallery/src/plots/SteppedScatterPlot.h index 00d6bf568..4d8d78d2e 100644 --- a/examples/CorePlotGallery/src/plots/SteppedScatterPlot.h +++ b/examples/CorePlotGallery/src/plots/SteppedScatterPlot.h @@ -8,4 +8,5 @@ @interface SteppedScatterPlot : PlotItem + @end diff --git a/examples/CorePlotGallery/src/plots/SteppedScatterPlot.m b/examples/CorePlotGallery/src/plots/SteppedScatterPlot.m index 7a1d9fc36..861e3a1b7 100644 --- a/examples/CorePlotGallery/src/plots/SteppedScatterPlot.m +++ b/examples/CorePlotGallery/src/plots/SteppedScatterPlot.m @@ -22,7 +22,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Stepped Scatter Plot"; self.section = kLinePlots; } @@ -32,7 +32,7 @@ -(nonnull instancetype)init -(void)generateData { - if ( self.plotData == nil ) { + if ( self.plotData.count == 0 ) { NSMutableArray *contentArray = [NSMutableArray array]; for ( NSUInteger i = 0; i < 10; i++ ) { NSNumber *x = @(1.0 + i * 0.05); @@ -44,9 +44,9 @@ -(void)generateData } } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -110,12 +110,12 @@ -(void)Plot:(nonnull CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUIntege #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); NSNumber *num = self.plotData[index][key]; diff --git a/examples/CorePlotGallery/src/plots/VerticalBarChart.m b/examples/CorePlotGallery/src/plots/VerticalBarChart.m index b9802ba27..2236f441f 100644 --- a/examples/CorePlotGallery/src/plots/VerticalBarChart.m +++ b/examples/CorePlotGallery/src/plots/VerticalBarChart.m @@ -10,6 +10,7 @@ @interface VerticalBarChart() @property (nonatomic, readwrite, strong, nullable) CPTPlotSpaceAnnotation *symbolTextAnnotation; + @end @implementation VerticalBarChart @@ -23,7 +24,7 @@ +(void)load -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Vertical Bar Chart"; self.section = kBarPlots; } @@ -50,9 +51,9 @@ -(void)generateData { } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -130,7 +131,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT { y.majorIntervalLength = (kUseHorizontalBars ? @1.0 : @10.0); y.minorTicksPerInterval = (kUseHorizontalBars ? 0 : 9); - y.orthogonalPosition = ( kUseHorizontalBars ? @0.0 : @(-0.5) ); + y.orthogonalPosition = (kUseHorizontalBars ? @0.0 : @(-0.5)); y.preferredNumberOfMajorTicks = 8; y.majorGridLineStyle = majorGridLineStyle; @@ -211,7 +212,7 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT theLegend.fill = [CPTFill fillWithColor:[CPTColor colorWithGenericGray:CPTFloat(0.15)]]; theLegend.borderLineStyle = barLineStyle; theLegend.cornerRadius = textSize * CPTFloat(0.25); - theLegend.swatchSize = CGSizeMake( textSize * CPTFloat(0.75), textSize * CPTFloat(0.75) ); + theLegend.swatchSize = CGSizeMake(textSize * CPTFloat(0.75), textSize * CPTFloat(0.75)); whiteTextStyle.fontSize = textSize * CPTFloat(0.5); theLegend.textStyle = whiteTextStyle; theLegend.rowMargin = textSize * CPTFloat(0.25); @@ -221,12 +222,12 @@ -(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withT theLegend.paddingRight = textSize * CPTFloat(0.375); theLegend.paddingBottom = textSize * CPTFloat(0.375); - CPTNumberArray plotPoint = (kUseHorizontalBars ? @[@95, @0] : @[@0, @95]); + CPTNumberArray *plotPoint = (kUseHorizontalBars ? @[@95, @0] : @[@0, @95]); CPTPlotSpaceAnnotation *legendAnnotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:barPlotSpace anchorPlotPoint:plotPoint]; legendAnnotation.contentLayer = theLegend; - legendAnnotation.contentAnchorPoint = ( kUseHorizontalBars ? CGPointMake(1.0, 0.0) : CGPointMake(0.0, 1.0) ); + legendAnnotation.contentAnchorPoint = (kUseHorizontalBars ? CGPointMake(1.0, 0.0) : CGPointMake(0.0, 1.0)); [graph.plotAreaFrame.plotArea addAnnotation:legendAnnotation]; } @@ -263,7 +264,7 @@ -(void)barPlot:(nonnull CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUIntege NSNumber *x = @(index); NSNumber *y = @2; - CPTNumberArray anchorPoint = (kUseHorizontalBars ? @[y, x] : @[x, y]); + CPTNumberArray *anchorPoint = (kUseHorizontalBars ? @[y, x] : @[x, y]); // Add annotation // First make a string for the y value @@ -287,7 +288,7 @@ -(void)barPlot:(nonnull CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUIntege #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return 10; } @@ -306,7 +307,7 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum num = @(index); } else { - num = @( (index + 1) * (index + 1) ); + num = @((index + 1) * (index + 1)); } } else { diff --git a/examples/CorePlotGallery/src/shared/PiNumberFormatter.m b/examples/CorePlotGallery/src/shared/PiNumberFormatter.m index 44db81b2e..8b1f1fdfb 100644 --- a/examples/CorePlotGallery/src/shared/PiNumberFormatter.m +++ b/examples/CorePlotGallery/src/shared/PiNumberFormatter.m @@ -2,6 +2,8 @@ double gcd(double a, double b); +#pragma mark - + /** @brief A number formatter that converts numbers to multiples of π. **/ @implementation PiNumberFormatter @@ -17,12 +19,12 @@ @implementation PiNumberFormatter * @param coordinateValue The numeric value. * @return The formatted string. **/ --(nullable NSString *)stringForObjectValue:(nonnull id)coordinateValue +-(nullable NSString *)stringForObjectValue:(nullable id)coordinateValue { NSString *string = nil; if ( [coordinateValue respondsToSelector:@selector(doubleValue)] ) { - double value = ( (NSNumber *)coordinateValue ).doubleValue / M_PI; + double value = ((NSNumber *)coordinateValue).doubleValue / M_PI; double factor = round(self.multiplier.doubleValue); if ( factor == 0.0 ) { @@ -32,7 +34,7 @@ -(nullable NSString *)stringForObjectValue:(nonnull id)coordinateValue double numerator = round(value * factor); double denominator = factor; double fraction = numerator / denominator; - double divisor = ABS( gcd(numerator, denominator) ); + double divisor = ABS(gcd(numerator, denominator)); if ( fraction == 0.0 ) { string = @"0"; @@ -70,7 +72,7 @@ -(nullable NSString *)stringForObjectValue:(nonnull id)coordinateValue while ( a != 0.0 ) { c = a; - a = round( fmod(b, a) ); + a = round(fmod(b, a)); b = c; } diff --git a/examples/CorePlotGallery/src/shared/PlotGallery.h b/examples/CorePlotGallery/src/shared/PlotGallery.h index 4ce75f7c1..0c6e22f2f 100644 --- a/examples/CorePlotGallery/src/shared/PlotGallery.h +++ b/examples/CorePlotGallery/src/shared/PlotGallery.h @@ -9,7 +9,7 @@ @property (nonatomic, readonly) NSUInteger count; @property (nonatomic, readonly) NSUInteger numberOfSections; -@property (nonatomic, readonly, strong, nonnull) CPTStringArray sectionTitles; +@property (nonatomic, readonly, strong, nonnull) CPTStringArray *sectionTitles; +(nonnull PlotGallery *)sharedPlotGallery; diff --git a/examples/CorePlotGallery/src/shared/PlotGallery.m b/examples/CorePlotGallery/src/shared/PlotGallery.m index 489052d87..fc40ffe5a 100644 --- a/examples/CorePlotGallery/src/shared/PlotGallery.m +++ b/examples/CorePlotGallery/src/shared/PlotGallery.m @@ -12,6 +12,8 @@ @interface PlotGallery() @end +#pragma mark - + @implementation PlotGallery @synthesize plotItems; @@ -21,8 +23,7 @@ @implementation PlotGallery +(nonnull PlotGallery *)sharedPlotGallery { - @synchronized(self) - { + @synchronized ( self ) { if ( sharedPlotGallery == nil ) { sharedPlotGallery = [[self alloc] init]; } @@ -32,8 +33,7 @@ +(nonnull PlotGallery *)sharedPlotGallery +(id)allocWithZone:(NSZone *)zone { - @synchronized(self) - { + @synchronized ( self ) { if ( sharedPlotGallery == nil ) { return [super allocWithZone:zone]; } @@ -45,10 +45,9 @@ -(nonnull instancetype)init { Class thisClass = [self class]; - @synchronized(thisClass) - { + @synchronized ( thisClass ) { if ( sharedPlotGallery == nil ) { - if ( (self = [super init]) ) { + if ((self = [super init])) { sharedPlotGallery = self; plotItems = [[NSMutableArray alloc] init]; plotSections = [[NSCountedSet alloc] init]; @@ -59,7 +58,7 @@ -(nonnull instancetype)init return sharedPlotGallery; } --(nonnull id)copyWithZone:(nullable NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *__unused)zone { return self; } @@ -105,9 +104,9 @@ -(void)sortByTitle [self.plotItems sortUsingSelector:@selector(titleCompare:)]; } --(CPTStringArray)sectionTitles +-(CPTStringArray *)sectionTitles { - return [(self.plotSections).allObjects sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; + return [self.plotSections.allObjects sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; } @end diff --git a/examples/CorePlotGallery/src/shared/PlotItem.h b/examples/CorePlotGallery/src/shared/PlotItem.h index c8c7c4f8b..eefd5e40d 100644 --- a/examples/CorePlotGallery/src/shared/PlotItem.h +++ b/examples/CorePlotGallery/src/shared/PlotItem.h @@ -7,7 +7,7 @@ #import -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #import typedef CGRect CGNSRect; diff --git a/examples/CorePlotGallery/src/shared/PlotItem.m b/examples/CorePlotGallery/src/shared/PlotItem.m index c10b0b8a3..08bc060b7 100644 --- a/examples/CorePlotGallery/src/shared/PlotItem.m +++ b/examples/CorePlotGallery/src/shared/PlotItem.m @@ -7,9 +7,9 @@ #import -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else -// For IKImageBrowser +// For NSCollectionView #import #endif @@ -53,12 +53,12 @@ +(void)registerPlotItem:(nonnull id)item -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { defaultLayerHostingView = nil; graphs = [[NSMutableArray alloc] init]; - section = nil; - title = nil; + section = @""; + title = @""; } return self; @@ -121,8 +121,10 @@ -(CGFloat)titleSize { CGFloat size; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - switch ( UI_USER_INTERFACE_IDIOM() ) { +#if TARGET_OS_TV + size = 36.0; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + switch ( UI_USER_INTERFACE_IDIOM()) { case UIUserInterfaceIdiomPad: size = 24.0; break; @@ -148,7 +150,7 @@ -(void)setPaddingDefaultsForGraph:(nonnull CPTGraph *)graph graph.paddingLeft = boundsPadding; - if ( graph.titleDisplacement.y > CPTFloat(0.0) ) { + if ( graph.titleDisplacement.y > CPTFloat(0.0)) { graph.paddingTop = graph.titleTextStyle.fontSize * CPTFloat(2.0); } else { @@ -172,7 +174,7 @@ -(void)formatAllGraphs graph.title = (self.graphs.count == 1 ? self.title : nil); graph.titleTextStyle = textStyle; - graph.titleDisplacement = CPTPointMake( 0.0, textStyle.fontSize * CPTFloat(1.5) ); + graph.titleDisplacement = CPTPointMake(0.0, textStyle.fontSize * CPTFloat(1.5)); graph.titlePlotAreaFrameAnchor = CPTRectAnchorTop; // Padding @@ -226,7 +228,7 @@ -(void)formatAllGraphs textStyle.fontSize = labelSize; theLegend.textStyle = textStyle; - theLegend.swatchSize = CGSizeMake( labelSize * CPTFloat(1.5), labelSize * CPTFloat(1.5) ); + theLegend.swatchSize = CGSizeMake(labelSize * CPTFloat(1.5), labelSize * CPTFloat(1.5)); theLegend.rowMargin = labelSize * CPTFloat(0.75); theLegend.columnMargin = labelSize * CPTFloat(0.75); @@ -238,9 +240,9 @@ -(void)formatAllGraphs } } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE --(nonnull UIImage *)image +-(nonnull CPTNativeImage *)image { if ( self.cachedImage == nil ) { CGRect imageFrame = CGRectMake(0, 0, 400, 300); @@ -285,7 +287,7 @@ -(nonnull UIImage *)image #else // OSX --(nonnull NSImage *)image +-(nonnull CPTNativeImage *)image { if ( self.cachedImage == nil ) { CGRect imageFrame = CGRectMake(0, 0, 400, 300); @@ -297,26 +299,9 @@ -(nonnull NSImage *)image CGSize boundsSize = imageFrame.size; - NSBitmapImageRep *layerImage = [[NSBitmapImageRep alloc] - initWithBitmapDataPlanes:NULL - pixelsWide:(NSInteger)boundsSize.width - pixelsHigh:(NSInteger)boundsSize.height - bitsPerSample:8 - samplesPerPixel:4 - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSCalibratedRGBColorSpace - bytesPerRow:(NSInteger)boundsSize.width * 4 - bitsPerPixel:32]; - - NSGraphicsContext *bitmapContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:layerImage]; - CGContextRef context = (CGContextRef)bitmapContext.graphicsPort; - - CGContextClearRect( context, CGRectMake(0.0, 0.0, boundsSize.width, boundsSize.height) ); - CGContextSetAllowsAntialiasing(context, true); - CGContextSetShouldSmoothFonts(context, false); - [imageView.layer renderInContext:context]; - CGContextFlush(context); + NSBitmapImageRep *layerImage = [imageView bitmapImageRepForCachingDisplayInRect:imageFrame]; + layerImage.size = boundsSize; + [imageView cacheDisplayInRect:imageFrame toBitmapImageRep:layerImage]; self.cachedImage = [[NSImage alloc] initWithSize:NSSizeFromCGSize(boundsSize)]; [self.cachedImage addRepresentation:layerImage]; @@ -324,6 +309,7 @@ -(nonnull NSImage *)image return self.cachedImage; } + #endif -(void)applyTheme:(nullable CPTTheme *)theme toGraph:(nonnull CPTGraph *)graph withDefault:(nullable CPTTheme *)defaultTheme @@ -336,11 +322,12 @@ -(void)applyTheme:(nullable CPTTheme *)theme toGraph:(nonnull CPTGraph *)graph w } } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else --(void)setFrameSize:(NSSize)size +-(void)setFrameSize:(NSSize __unused)size { } + #endif -(void)renderInView:(nonnull PlotGalleryNativeView *)inView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated @@ -351,7 +338,7 @@ -(void)renderInView:(nonnull PlotGalleryNativeView *)inView withTheme:(nullable [inView addSubview:hostingView]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE hostingView.translatesAutoresizingMaskIntoConstraints = NO; [inView addConstraint:[NSLayoutConstraint constraintWithItem:hostingView attribute:NSLayoutAttributeLeft @@ -394,7 +381,7 @@ -(void)renderInView:(nonnull PlotGalleryNativeView *)inView withTheme:(nullable self.defaultLayerHostingView = hostingView; } --(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *__unused)hostingView withTheme:(nullable CPTTheme *__unused)theme animated:(BOOL __unused)animated { NSLog(@"PlotItem:renderInLayer: Override me"); } @@ -409,7 +396,7 @@ -(void)reloadData #pragma mark - #pragma mark IKImageBrowserItem methods -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else -(NSString *)imageUID @@ -431,6 +418,7 @@ -(NSString *)imageTitle { return self.title; } + #endif @end diff --git a/examples/CorePlotGallery/src/tvOS/AppDelegateTV.h b/examples/CorePlotGallery/src/tvOS/AppDelegateTV.h new file mode 100644 index 000000000..45bd5ecd6 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/AppDelegateTV.h @@ -0,0 +1,7 @@ +#import + +@interface AppDelegateTV : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples/CorePlotGallery/src/tvOS/AppDelegateTV.m b/examples/CorePlotGallery/src/tvOS/AppDelegateTV.m new file mode 100644 index 000000000..25c2be344 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/AppDelegateTV.m @@ -0,0 +1,16 @@ +#import "AppDelegateTV.h" + +#import "PlotGallery.h" + +@implementation AppDelegateTV + +@synthesize window; + +-(BOOL)application:(UIApplication *__unused)application didFinishLaunchingWithOptions:(NSDictionary *__unused)launchOptions +{ + [[PlotGallery sharedPlotGallery] sortByTitle]; + + return YES; +} + +@end diff --git a/examples/CorePlotGallery/src/tvOS/Base.lproj/Main.storyboard b/examples/CorePlotGallery/src/tvOS/Base.lproj/Main.storyboard new file mode 100644 index 000000000..6c7f86385 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/Base.lproj/Main.storyboard @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.h b/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.h new file mode 100644 index 000000000..46e67160d --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.h @@ -0,0 +1,17 @@ +// +// DetailViewControllerTV.h +// CorePlotGallery +// + +@class PlotItem; + +@interface DetailViewControllerTV : UIViewController + +@property (nonatomic, strong) PlotItem *detailItem; +@property (nonatomic, copy) NSString *currentThemeName; + +@property (nonatomic, strong) IBOutlet UIView *hostingView; + +-(void)themeSelectedWithName:(NSString *)themeName; + +@end diff --git a/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.m b/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.m new file mode 100644 index 000000000..7cc1f5d52 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.m @@ -0,0 +1,122 @@ +// +// DetailViewControllerTV +// CorePlotGallery +// + +#import "DetailViewControllerTV.h" + +#import "PlotItem.h" +#import "ThemeTableViewControllerTV.h" + +@interface DetailViewControllerTV() + +-(CPTTheme *)currentTheme; + +-(void)setupView; +-(void)themeChanged:(NSNotification *)notification; + +@end + +#pragma mark - + +@implementation DetailViewControllerTV + +@synthesize detailItem; +@synthesize hostingView; +@synthesize currentThemeName; + +#pragma mark - +#pragma mark Initialization and Memory Management + +-(void)setupView +{ + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(themeChanged:) + name:PlotGalleryThemeDidChangeNotification + object:nil]; + + [self.detailItem renderInView:self.hostingView withTheme:[self currentTheme] animated:YES]; +} + +-(void)awakeFromNib +{ + [super awakeFromNib]; + + [self setupView]; +} + +-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { + [self setupView]; + } + + return self; +} + +-(void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +#pragma mark - +#pragma mark Managing the detail item + +-(void)setDetailItem:(PlotItem *)newDetailItem +{ + if ( detailItem != newDetailItem ) { + [detailItem killGraph]; + + detailItem = newDetailItem; + + if ( self.hostingView ) { + [detailItem renderInView:self.hostingView withTheme:[self currentTheme] animated:YES]; + } + } +} + +#pragma mark - +#pragma mark View lifecycle + +-(void)viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; + + [self setupView]; +} + +#pragma mark - +#pragma mark Theme Selection + +-(CPTTheme *)currentTheme +{ + CPTTheme *theme; + + if ( [self.currentThemeName isEqualToString:kThemeTableViewControllerNoTheme] ) { + theme = (id)[NSNull null]; + } + else if ( [self.currentThemeName isEqualToString:kThemeTableViewControllerDefaultTheme] ) { + theme = nil; + } + else { + theme = [CPTTheme themeNamed:self.currentThemeName]; + } + + return theme; +} + +-(void)themeSelectedWithName:(NSString *)themeName +{ + self.currentThemeName = themeName; + + [self.detailItem renderInView:self.hostingView withTheme:[self currentTheme] animated:YES]; +} + +-(void)themeChanged:(NSNotification *)notification +{ + NSDictionary *themeInfo = notification.userInfo; + + [self themeSelectedWithName:themeInfo[PlotGalleryThemeNameKey]]; +} + +@end diff --git a/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.h b/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.h new file mode 100644 index 000000000..db15ca7f8 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.h @@ -0,0 +1,10 @@ +// +// RootViewControllerTV.h +// CorePlotGallery +// + +@interface RootViewControllerTV : UITableViewController + +@property (nonatomic, strong) IBOutlet UIBarButtonItem *themeBarButton; + +@end diff --git a/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.m b/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.m new file mode 100644 index 000000000..0e114aef2 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.m @@ -0,0 +1,125 @@ +// +// RootViewControllerTV.m +// CorePlotGallery +// + +#import "RootViewControllerTV.h" + +#import "DetailViewControllerTV.h" +#import "ThemeTableViewControllerTV.h" + +#import "PlotGallery.h" +#import "PlotItem.h" + +@interface RootViewControllerTV() + +@property (nonatomic, copy) NSString *currentThemeName; + +-(void)themeChanged:(NSNotification *)notification; + +@end + +#pragma mark - + +@implementation RootViewControllerTV + +@synthesize themeBarButton; +@synthesize currentThemeName; + +-(void)viewDidLoad +{ + [super viewDidLoad]; + + self.clearsSelectionOnViewWillAppear = NO; + + self.currentThemeName = kThemeTableViewControllerDefaultTheme; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(themeChanged:) + name:PlotGalleryThemeDidChangeNotification + object:nil]; +} + +-(void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +#pragma mark - +#pragma mark Segues + +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id __unused)sender +{ + if ( [segue.identifier isEqualToString:@"showDetail"] ) { + DetailViewControllerTV *controller = (DetailViewControllerTV *)segue.destinationViewController; + + controller.navigationItem.leftBarButtonItem = self.splitViewController.displayModeButtonItem; + + controller.currentThemeName = self.currentThemeName; + + NSIndexPath *indexPath = self.tableView.indexPathForSelectedRow; + + PlotItem *plotItem = [[PlotGallery sharedPlotGallery] objectInSection:[indexPath indexAtPosition:0] + atIndex:[indexPath indexAtPosition:1]]; + + controller.detailItem = plotItem; + } +} + +#pragma mark - +#pragma mark Theme Selection + +-(void)setCurrentThemeName:(NSString *)newThemeName +{ + if ( newThemeName != currentThemeName ) { + currentThemeName = [newThemeName copy]; + + self.themeBarButton.title = newThemeName; + } +} + +-(void)themeChanged:(NSNotification *)notification +{ + NSDictionary *themeInfo = notification.userInfo; + + self.currentThemeName = themeInfo[PlotGalleryThemeNameKey]; +} + +#pragma mark - +#pragma mark Table view data source + +-(NSInteger)numberOfSectionsInTableView:(UITableView *__unused)tv +{ + return (NSInteger)[PlotGallery sharedPlotGallery].numberOfSections; +} + +-(NSInteger)tableView:(UITableView *__unused)tv numberOfRowsInSection:(NSInteger)section +{ + return (NSInteger)[[PlotGallery sharedPlotGallery] numberOfRowsInSection:(NSUInteger)section]; +} + +-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *cellId = @"PlotCell"; + + UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:cellId]; + + if ( cell == nil ) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; + cell.accessoryType = UITableViewCellAccessoryNone; + } + + PlotItem *plotItem = [[PlotGallery sharedPlotGallery] objectInSection:[indexPath indexAtPosition:0] + atIndex:[indexPath indexAtPosition:1]]; + cell.imageView.image = [plotItem image]; + cell.textLabel.text = plotItem.title; + + return cell; +} + +-(NSString *)tableView:(UITableView *__unused)tableView titleForHeaderInSection:(NSInteger)section +{ + return [PlotGallery sharedPlotGallery].sectionTitles[(NSUInteger)section]; +} + +@end diff --git a/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.h b/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.h new file mode 100644 index 000000000..db53d1f17 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.h @@ -0,0 +1,16 @@ +// +// ThemeTableViewControllerTV.h +// CorePlotGallery +// + +extern NSString *const kThemeTableViewControllerNoTheme; +extern NSString *const kThemeTableViewControllerDefaultTheme; + +extern NSString *const PlotGalleryThemeDidChangeNotification; +extern NSString *const PlotGalleryThemeNameKey; + +#pragma mark - + +@interface ThemeTableViewControllerTV : UITableViewController + +@end diff --git a/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.m b/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.m new file mode 100644 index 000000000..fb6aac50e --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.m @@ -0,0 +1,102 @@ +// +// ThemeTableViewControllerTV.m +// CorePlotGallery +// + +#import "ThemeTableViewControllerTV.h" + +#import + +NSString *const kThemeTableViewControllerNoTheme = @"None"; +NSString *const kThemeTableViewControllerDefaultTheme = @"Default"; + +NSString *const PlotGalleryThemeDidChangeNotification = @"PlotGalleryThemeDidChangeNotification"; +NSString *const PlotGalleryThemeNameKey = @"PlotGalleryThemeNameKey"; + +@interface ThemeTableViewControllerTV() + +@property (nonatomic, readwrite, strong) CPTMutableStringArray *themes; + +@end + +#pragma mark - + +@implementation ThemeTableViewControllerTV + +@synthesize themes; + +-(void)setupThemes +{ + CPTMutableStringArray *themeList = [[NSMutableArray alloc] init]; + + [themeList addObject:kThemeTableViewControllerDefaultTheme]; + [themeList addObject:kThemeTableViewControllerNoTheme]; + + for ( Class themeClass in [CPTTheme themeClasses] ) { + [themeList addObject:[themeClass name]]; + } + + self.themes = themeList; +} + +-(void)awakeFromNib +{ + [super awakeFromNib]; + + [self setupThemes]; +} + +-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { + [self setupThemes]; + } + + return self; +} + +#pragma mark - +#pragma mark Table view data source + +-(NSInteger)numberOfSectionsInTableView:(UITableView *__unused)tableView +{ + return 1; +} + +-(NSInteger)tableView:(UITableView *__unused)tableView numberOfRowsInSection:(NSInteger __unused)section +{ + return (NSInteger)self.themes.count; +} + +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"ThemeCell"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + + if ( cell == nil ) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; + } + + cell.textLabel.text = self.themes[(NSUInteger)indexPath.row]; + + return cell; +} + +#pragma mark - +#pragma mark Table view delegate + +-(void)tableView:(UITableView *__unused)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSDictionary *themeInfo = @{ + PlotGalleryThemeNameKey: self.themes[(NSUInteger)indexPath.row] + }; + + [[NSNotificationCenter defaultCenter] postNotificationName:PlotGalleryThemeDidChangeNotification + object:self + userInfo:themeInfo]; + + [self dismissViewControllerAnimated:YES completion:nil]; +} + +@end diff --git a/examples/CorePlotGallery/src/tvOS/main.m b/examples/CorePlotGallery/src/tvOS/main.m new file mode 100644 index 000000000..3bc32fa82 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/main.m @@ -0,0 +1,9 @@ +#import "AppDelegateTV.h" +#import + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegateTV class])); + } +} diff --git a/examples/DatePlot/DatePlot.xib b/examples/DatePlot/Base.lproj/DatePlot.xib similarity index 100% rename from examples/DatePlot/DatePlot.xib rename to examples/DatePlot/Base.lproj/DatePlot.xib diff --git a/examples/DatePlot/Info.plist b/examples/DatePlot/Base.lproj/Info.plist similarity index 100% rename from examples/DatePlot/Info.plist rename to examples/DatePlot/Base.lproj/Info.plist diff --git a/examples/DatePlot/DatePlot-Bridging-Header.h b/examples/DatePlot/DatePlot-Bridging-Header.h deleted file mode 100644 index cde174e4f..000000000 --- a/examples/DatePlot/DatePlot-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import diff --git a/examples/DatePlot/DatePlot.xcodeproj/project.pbxproj b/examples/DatePlot/DatePlot.xcodeproj/project.pbxproj index 704f45dc6..21d005158 100644 --- a/examples/DatePlot/DatePlot.xcodeproj/project.pbxproj +++ b/examples/DatePlot/DatePlot.xcodeproj/project.pbxproj @@ -11,10 +11,10 @@ 0761850B0F3CB1E800A89A76 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076184C10F3CAD5900A89A76 /* CorePlot.framework */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - 90AF4F440F36CF1800753D26 /* DatePlot.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90AF4F430F36CF1800753D26 /* DatePlot.xib */; }; BC8E737D0FC0B3CF00DF8511 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */; }; - C33E19A8198330CA00182AF2 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33E19A7198330CA00182AF2 /* main.swift */; }; + C33E19A8198330CA00182AF2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33E19A7198330CA00182AF2 /* AppDelegate.swift */; }; C3A14440197DE35F0048F1FF /* DateController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3A1443F197DE35F0048F1FF /* DateController.swift */; }; + C3D0A1A720E0183A00BA2921 /* DatePlot.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1A920E0183A00BA2921 /* DatePlot.xib */; }; C3D3937419FD6E3500148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3937319FD6E3500148319 /* Images.xcassets */; }; /* End PBXBuildFile section */ @@ -40,6 +40,20 @@ remoteGlobalIDString = 0730F600109492D800E95162; remoteInfo = UnitTests; }; + C310CE5B1C0A3DB500C4FCB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C310CE5D1C0A3DB500C4FCB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; C3F04DB71B44CCFD0002322A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; @@ -88,19 +102,18 @@ 071BCBD61079EBE00045E43D /* CorePlot.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = SOURCE_ROOT; }; 0761854B0F3CB3CB00A89A76 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = CorePlot.framework; path = ../../../../framework/build/Debug/CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* DatePlot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DatePlot.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 90AF4F430F36CF1800753D26 /* DatePlot.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DatePlot.xib; sourceTree = ""; }; BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - C33E19A7198330CA00182AF2 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = main.swift; path = Source/main.swift; sourceTree = ""; }; - C3A1443E197DE35F0048F1FF /* DatePlot-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DatePlot-Bridging-Header.h"; sourceTree = ""; }; + C33E19A7198330CA00182AF2 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Source/AppDelegate.swift; sourceTree = ""; }; + C37A409820E030B500C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; + C385066522A9CC740086BAD5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; C3A1443F197DE35F0048F1FF /* DateController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DateController.swift; path = Source/DateController.swift; sourceTree = ""; }; C3C3CBBF19EA07F600A0296A /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3D0A1B620E0184100BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/DatePlot.xib; sourceTree = ""; }; C3D3937319FD6E3500148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = DatePlot/Images.xcassets; sourceTree = ""; }; /* End PBXFileReference section */ @@ -127,6 +140,8 @@ C3F04DBA1B44CCFD0002322A /* UnitTests iOS.xctest */, C3F04DBC1B44CCFD0002322A /* libCorePlot-CocoaTouch.a */, C3F04DBE1B44CCFD0002322A /* CorePlot-CocoaTouchTests.xctest */, + C310CE5C1C0A3DB500C4FCB4 /* CorePlot.framework */, + C310CE5E1C0A3DB500C4FCB4 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -134,7 +149,7 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( - C3A1443E197DE35F0048F1FF /* DatePlot-Bridging-Header.h */, + C33E19A7198330CA00182AF2 /* AppDelegate.swift */, C3A1443F197DE35F0048F1FF /* DateController.swift */, ); name = Classes; @@ -189,8 +204,8 @@ isa = PBXGroup; children = ( C3D3937319FD6E3500148319 /* Images.xcassets */, - 90AF4F430F36CF1800753D26 /* DatePlot.xib */, - 8D1107310486CEB800E47090 /* Info.plist */, + C3D0A1A920E0183A00BA2921 /* DatePlot.xib */, + C37A409920E030B500C4FF48 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, ); name = Resources; @@ -208,7 +223,6 @@ C33E19A219832EEA00182AF2 /* Other Sources */ = { isa = PBXGroup; children = ( - C33E19A7198330CA00182AF2 /* main.swift */, C3C3CBBF19EA07F600A0296A /* CorePlotWarnings.xcconfig */, ); name = "Other Sources"; @@ -245,17 +259,23 @@ attributes = { BuildIndependentTargetsInParallel = NO; LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0700; + LastUpgradeCheck = 1100; + TargetAttributes = { + 8D1107260486CEB800E47090 = { + LastSwiftMigration = 1020; + }; + }; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "DatePlot" */; compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + de, + ja, + en, + fr, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CPTTestApp */; projectDirPath = ""; @@ -287,6 +307,20 @@ remoteRef = 07E0DF7F109C4E9500F108D2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C310CE5C1C0A3DB500C4FCB4 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C310CE5B1C0A3DB500C4FCB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C310CE5E1C0A3DB500C4FCB4 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C310CE5D1C0A3DB500C4FCB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; C3F04DB81B44CCFD0002322A /* CorePlot.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -324,7 +358,7 @@ files = ( 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, C3D3937419FD6E3500148319 /* Images.xcassets in Resources */, - 90AF4F440F36CF1800753D26 /* DatePlot.xib in Resources */, + C3D0A1A720E0183A00BA2921 /* DatePlot.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -335,7 +369,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C33E19A8198330CA00182AF2 /* main.swift in Sources */, + C33E19A8198330CA00182AF2 /* AppDelegate.swift in Sources */, C3A14440197DE35F0048F1FF /* DateController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -354,11 +388,27 @@ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 089C165DFE840E0CC02AAC07 /* English */, + C385066522A9CC740086BAD5 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; + C37A409920E030B500C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A409820E030B500C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; + C3D0A1A920E0183A00BA2921 /* DatePlot.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1B620E0184100BA2921 /* Base */, + ); + name = DatePlot.xib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -370,22 +420,21 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = DatePlot_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = DatePlot; - SWIFT_OBJC_BRIDGING_HEADER = "DatePlot-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -397,32 +446,35 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = DatePlot_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = DatePlot; - SWIFT_OBJC_BRIDGING_HEADER = "DatePlot-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; }; name = Release; }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C3CBBF19EA07F600A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; @@ -431,12 +483,14 @@ }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C3CBBF19EA07F600A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.9; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; }; diff --git a/examples/DatePlot/DatePlot.xcodeproj/xcshareddata/xcschemes/DatePlot.xcscheme b/examples/DatePlot/DatePlot.xcodeproj/xcshareddata/xcschemes/DatePlot.xcscheme index 651e0c1da..40f98e3d8 100644 --- a/examples/DatePlot/DatePlot.xcodeproj/xcshareddata/xcschemes/DatePlot.xcscheme +++ b/examples/DatePlot/DatePlot.xcodeproj/xcshareddata/xcschemes/DatePlot.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "YES"> - - - - + + - - UInt + func numberOfRecords(for plot: CPTPlot) -> UInt { return UInt(self.plotData.count) } - func numberForPlot(plot: CPTPlot, field: UInt, recordIndex: UInt) -> AnyObject? + func number(for plot: CPTPlot, field: UInt, record: UInt) -> Any? { switch CPTScatterPlotField(rawValue: Int(field))! { case .X: - return (oneDay * Double(recordIndex)) as NSNumber + return (oneDay * Double(record)) as NSNumber case .Y: - return self.plotData[Int(recordIndex)] as NSNumber + return self.plotData[Int(record)] as NSNumber + + @unknown default: + return nil } } } diff --git a/examples/DatePlot/Source/main.swift b/examples/DatePlot/Source/main.swift deleted file mode 100644 index f43c39451..000000000 --- a/examples/DatePlot/Source/main.swift +++ /dev/null @@ -1,3 +0,0 @@ -import Cocoa - -NSApplicationMain(Process.argc, Process.unsafeArgv) diff --git a/examples/DatePlot/English.lproj/InfoPlist.strings b/examples/DatePlot/en.lproj/InfoPlist.strings similarity index 100% rename from examples/DatePlot/English.lproj/InfoPlist.strings rename to examples/DatePlot/en.lproj/InfoPlist.strings diff --git a/examples/DropPlot/English.lproj/CPTPlotDocument.xib b/examples/DropPlot/Base.lproj/CPTPlotDocument.xib similarity index 100% rename from examples/DropPlot/English.lproj/CPTPlotDocument.xib rename to examples/DropPlot/Base.lproj/CPTPlotDocument.xib diff --git a/examples/DropPlot/Info.plist b/examples/DropPlot/Base.lproj/Info.plist similarity index 100% rename from examples/DropPlot/Info.plist rename to examples/DropPlot/Base.lproj/Info.plist diff --git a/examples/DropPlot/English.lproj/MainMenu.xib b/examples/DropPlot/Base.lproj/MainMenu.xib similarity index 100% rename from examples/DropPlot/English.lproj/MainMenu.xib rename to examples/DropPlot/Base.lproj/MainMenu.xib diff --git a/examples/DropPlot/CPTPlotDocument.m b/examples/DropPlot/CPTPlotDocument.m index 77c5c6355..537a8bdcb 100644 --- a/examples/DropPlot/CPTPlotDocument.m +++ b/examples/DropPlot/CPTPlotDocument.m @@ -59,7 +59,7 @@ -(nullable NSString *)windowNibName return @"CPTPlotDocument"; } --(void)windowControllerDidLoadNib:(nonnull NSWindowController *)windowController +-(void)windowControllerDidLoadNib:(nonnull NSWindowController *__unused)windowController { // Create graph from theme CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; @@ -90,9 +90,9 @@ -(void)windowControllerDidLoadNib:(nonnull NSWindowController *)windowController // Setup plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(self.minimumValueForXAxis) - length:@(ceil( (self.maximumValueForXAxis - self.minimumValueForXAxis) / self.majorIntervalLengthForX ) * self.majorIntervalLengthForX)]; + length:@(ceil((self.maximumValueForXAxis - self.minimumValueForXAxis) / self.majorIntervalLengthForX) * self.majorIntervalLengthForX)]; plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(self.minimumValueForYAxis) - length:@(ceil( (self.maximumValueForYAxis - self.minimumValueForYAxis) / self.majorIntervalLengthForY ) * self.majorIntervalLengthForY)]; + length:@(ceil((self.maximumValueForYAxis - self.minimumValueForYAxis) / self.majorIntervalLengthForY) * self.majorIntervalLengthForY)]; // this allows the plot to respond to mouse events plotSpace.delegate = self; @@ -128,7 +128,7 @@ -(void)windowControllerDidLoadNib:(nonnull NSWindowController *)windowController #pragma mark - #pragma mark Data loading methods --(nullable NSData *)dataOfType:(nonnull NSString *)typeName error:(NSError *__autoreleasing __nullable *)outError +-(nullable NSData *)dataOfType:(nonnull NSString *__unused)typeName error:(NSError *__autoreleasing __nullable *)outError { // Insert code here to write your document to data of the specified type. If the given outError != NULL, ensure that you set *outError when returning nil. @@ -156,20 +156,20 @@ -(BOOL)readFromData:(nonnull NSData *)data ofType:(NSString *)typeName error:(NS NSString *fileContents = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; // Parse CSV - NSUInteger length = fileContents.length; + NSUInteger length = fileContents.length; NSUInteger lineStart = 0, lineEnd = 0, contentsEnd = 0; NSRange currentRange; // Read headers from the first line of the file [fileContents getParagraphStart:&lineStart end:&lineEnd contentsEnd:&contentsEnd forRange:NSMakeRange(lineEnd, 0)]; -// currentRange = NSMakeRange(lineStart, contentsEnd - lineStart); -// CPTStringArray columnHeaders = [[fileContents substringWithRange:currentRange] arrayByParsingCSVLine]; -// NSLog([columnHeaders objectAtIndex:0]); + // currentRange = NSMakeRange(lineStart, contentsEnd - lineStart); + // CPTStringArray * columnHeaders = [[fileContents substringWithRange:currentRange] arrayByParsingCSVLine]; + // NSLog([columnHeaders objectAtIndex:0]); while ( lineEnd < length ) { [fileContents getParagraphStart:&lineStart end:&lineEnd contentsEnd:&contentsEnd forRange:NSMakeRange(lineEnd, 0)]; currentRange = NSMakeRange(lineStart, contentsEnd - lineStart); - CPTStringArray columnValues = [[fileContents substringWithRange:currentRange] arrayByParsingCSVLine]; + CPTStringArray *columnValues = [[fileContents substringWithRange:currentRange] arrayByParsingCSVLine]; double xValue = columnValues[0].doubleValue; double yValue = columnValues[1].doubleValue; @@ -201,13 +201,13 @@ -(BOOL)readFromData:(nonnull NSData *)data ofType:(NSString *)typeName error:(NS double intervalX = (maxX - minX) / 5.0; if ( intervalX > 0.0 ) { - intervalX = pow( 10.0, ceil( log10(intervalX) ) ); + intervalX = pow(10.0, ceil(log10(intervalX))); } self.majorIntervalLengthForX = intervalX; double intervalY = (maxY - minY) / 10.0; if ( intervalY > 0.0 ) { - intervalY = pow( 10.0, ceil( log10(intervalY) ) ); + intervalY = pow(10.0, ceil(log10(intervalY))); } self.majorIntervalLengthForY = intervalY; @@ -297,9 +297,9 @@ -(IBAction)zoomOut CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(minX) - length:@(ceil( (maxX - minX) / intervalX ) * intervalX)]; + length:@(ceil((maxX - minX) / intervalX) * intervalX)]; plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(minY) - length:@(ceil( (maxY - minY) / intervalY ) * intervalY)]; + length:@(ceil((maxY - minY) / intervalY) * intervalY)]; CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.graph.axisSet; axisSet.xAxis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; axisSet.yAxis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; @@ -308,7 +308,7 @@ -(IBAction)zoomOut #pragma mark - #pragma mark PDF / image export --(IBAction)exportToPDF:(nullable id)sender +-(IBAction)exportToPDF:(nullable id __unused)sender { NSSavePanel *pdfSavingDialog = [NSSavePanel savePanel]; @@ -324,7 +324,7 @@ -(IBAction)exportToPDF:(nullable id)sender } } --(IBAction)exportToPNG:(nullable id)sender +-(IBAction)exportToPNG:(nullable id __unused)sender { NSSavePanel *pngSavingDialog = [NSSavePanel savePanel]; @@ -346,12 +346,12 @@ -(IBAction)exportToPNG:(nullable id)sender #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.dataPoints.count; } --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); @@ -361,7 +361,7 @@ -(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum #pragma mark - #pragma mark Plot Space Delegate Methods --(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)plotSpace:(nonnull CPTPlotSpace *__unused)space shouldHandlePointingDeviceDraggedEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint)interactionPoint { CPTPlotSpaceAnnotation *annotation = self.zoomAnnotation; @@ -369,16 +369,16 @@ -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDragged CPTPlotArea *plotArea = self.graph.plotAreaFrame.plotArea; CGRect plotBounds = plotArea.bounds; - // convert the dragStart and dragEnd values to plot coordinates +// convert the dragStart and dragEnd values to plot coordinates CGPoint dragStartInPlotArea = [self.graph convertPoint:self.dragStart toLayer:plotArea]; CGPoint dragEndInPlotArea = [self.graph convertPoint:interactionPoint toLayer:plotArea]; - // create the dragrect from dragStart to the current location - CGFloat endX = MAX( MIN( dragEndInPlotArea.x, CGRectGetMaxX(plotBounds) ), CGRectGetMinX(plotBounds) ); - CGFloat endY = MAX( MIN( dragEndInPlotArea.y, CGRectGetMaxY(plotBounds) ), CGRectGetMinY(plotBounds) ); - CGRect borderRect = CGRectMake( dragStartInPlotArea.x, dragStartInPlotArea.y, - (endX - dragStartInPlotArea.x), - (endY - dragStartInPlotArea.y) ); +// create the dragrect from dragStart to the current location + CGFloat endX = MAX(MIN(dragEndInPlotArea.x, CGRectGetMaxX(plotBounds)), CGRectGetMinX(plotBounds)); + CGFloat endY = MAX(MIN(dragEndInPlotArea.y, CGRectGetMaxY(plotBounds)), CGRectGetMinY(plotBounds)); + CGRect borderRect = CGRectMake(dragStartInPlotArea.x, dragStartInPlotArea.y, + (endX - dragStartInPlotArea.x), + (endY - dragStartInPlotArea.y)); annotation.contentAnchorPoint = CGPointMake(dragEndInPlotArea.x >= dragStartInPlotArea.x ? 0.0 : 1.0, dragEndInPlotArea.y >= dragStartInPlotArea.y ? 0.0 : 1.0); @@ -388,7 +388,7 @@ -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDragged return NO; } --(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)plotSpace:(nonnull CPTPlotSpace *__unused)space shouldHandlePointingDeviceDownEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint)interactionPoint { if ( !self.zoomAnnotation ) { self.dragStart = interactionPoint; @@ -396,9 +396,9 @@ -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDownEve CPTPlotArea *plotArea = self.graph.plotAreaFrame.plotArea; CGPoint dragStartInPlotArea = [self.graph convertPoint:self.dragStart toLayer:plotArea]; - if ( CGRectContainsPoint(plotArea.bounds, dragStartInPlotArea) ) { - // create the zoom rectangle - // first a bordered layer to draw the zoomrect + if ( CGRectContainsPoint(plotArea.bounds, dragStartInPlotArea)) { +// create the zoom rectangle +// first a bordered layer to draw the zoomrect CPTBorderedLayer *zoomRectangleLayer = [[CPTBorderedLayer alloc] initWithFrame:CGRectNull]; CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle]; @@ -411,10 +411,10 @@ -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDownEve double start[2]; [self.graph.defaultPlotSpace doublePrecisionPlotPoint:start numberOfCoordinates:2 forPlotAreaViewPoint:dragStartInPlotArea]; - CPTNumberArray anchorPoint = @[@(start[CPTCoordinateX]), - @(start[CPTCoordinateY])]; + CPTNumberArray *anchorPoint = @[@(start[CPTCoordinateX]), + @(start[CPTCoordinateY])]; - // now create the annotation +// now create the annotation CPTPlotSpace *defaultSpace = self.graph.defaultPlotSpace; if ( defaultSpace ) { CPTPlotSpaceAnnotation *annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:defaultSpace anchorPlotPoint:anchorPoint]; @@ -429,28 +429,28 @@ -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDownEve return NO; } --(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)plotSpace:(nonnull CPTPlotSpace *__unused)space shouldHandlePointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { CPTPlotSpaceAnnotation *annotation = self.zoomAnnotation; if ( annotation ) { self.dragEnd = interactionPoint; - // double-click to completely zoom out - if ( event.clickCount == 2 ) { +// double-click to completely zoom out + if ((event.type != NSEventTypeScrollWheel) && (event.clickCount == 2)) { CPTPlotArea *plotArea = self.graph.plotAreaFrame.plotArea; CGPoint dragEndInPlotArea = [self.graph convertPoint:interactionPoint toLayer:plotArea]; - if ( CGRectContainsPoint(plotArea.bounds, dragEndInPlotArea) ) { + if ( CGRectContainsPoint(plotArea.bounds, dragEndInPlotArea)) { [self zoomOut]; } } - else if ( !CGPointEqualToPoint(self.dragStart, self.dragEnd) ) { - // no accidental drag, so zoom in + else if ( !CGPointEqualToPoint(self.dragStart, self.dragEnd)) { +// no accidental drag, so zoom in [self zoomIn]; } - // and we're done with the drag +// and we're done with the drag [self.graph.plotAreaFrame.plotArea removeAnnotation:annotation]; self.zoomAnnotation = nil; @@ -461,7 +461,7 @@ -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent return NO; } --(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)plotSpace:(nonnull CPTPlotSpace *__unused)space shouldHandlePointingDeviceCancelledEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)interactionPoint { CPTPlotSpaceAnnotation *annotation = self.zoomAnnotation; diff --git a/examples/DropPlot/DropPlot.xcodeproj/project.pbxproj b/examples/DropPlot/DropPlot.xcodeproj/project.pbxproj index a07cd5882..43c984131 100644 --- a/examples/DropPlot/DropPlot.xcodeproj/project.pbxproj +++ b/examples/DropPlot/DropPlot.xcodeproj/project.pbxproj @@ -71,6 +71,20 @@ remoteGlobalIDString = C38A09C41A4619A900D45436; remoteInfo = "CorePlot-CocoaTouchTests"; }; + C3CBFB791BE590A300519EE8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BC93AA7C0FDEFEAC00606226 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C3CBFB7B1BE590A300519EE8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BC93AA7C0FDEFEAC00606226 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -88,26 +102,26 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 089C1660FE840EACC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; - 1DDD58290DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/CPTPlotDocument.xib; sourceTree = ""; }; - 1DDD582B0DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; - 2A37F4ACFDCFA73011CA2CEA /* CPTPlotDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlotDocument.m; sourceTree = ""; }; + 2A37F4ACFDCFA73011CA2CEA /* CPTPlotDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotDocument.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 2A37F4AEFDCFA73011CA2CEA /* CPTPlotDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotDocument.h; sourceTree = ""; }; 2A37F4B0FDCFA73011CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 2A37F4BAFDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = ""; }; 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32DBCF750370BD2300C91783 /* DropPlot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DropPlot_Prefix.pch; sourceTree = ""; }; - 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D15AC370486D014006FF6A4 /* DropPlot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DropPlot.app; sourceTree = BUILT_PRODUCTS_DIR; }; BC00E6470FE1BF0A00DE81E0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BC93AA7C0FDEFEAC00606226 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = SOURCE_ROOT; }; BC93AAF40FDF3F0200606226 /* NSString+ParseCSV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ParseCSV.h"; sourceTree = ""; }; BC93AAF50FDF3F0200606226 /* NSString+ParseCSV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ParseCSV.m"; sourceTree = ""; }; + C3564D1722A2D115000A54C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; + C3564D1822A2D115000A54C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + C37A40A820E0314800C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; C3D3937719FD705000148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = DropPlot/Images.xcassets; sourceTree = ""; }; C3D6210E19DF72E000652CE7 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3DA082A20E00C3C00F73704 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/CPTPlotDocument.xib; sourceTree = ""; }; + C3DA082B20E00C3C00F73704 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -193,7 +207,7 @@ children = ( C3D3937719FD705000148319 /* Images.xcassets */, 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */, - 8D15AC360486D014006FF6A4 /* Info.plist */, + C37A40A920E0314800C4FF48 /* Info.plist */, 089C165FFE840EACC02AAC07 /* InfoPlist.strings */, 1DDD58280DA1D0D100B32029 /* CPTPlotDocument.xib */, 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */, @@ -219,6 +233,8 @@ C3B345AA1B46194500844218 /* UnitTests iOS.xctest */, C3B345AC1B46194500844218 /* libCorePlot-CocoaTouch.a */, C3B345AE1B46194500844218 /* CorePlot-CocoaTouchTests.xctest */, + C3CBFB7A1BE590A300519EE8 /* CorePlot.framework */, + C3CBFB7C1BE590A300519EE8 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -252,17 +268,18 @@ 2A37F4A9FDCFA73011CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; + LastUpgradeCheck = 1100; }; buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "DropPlot" */; compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + de, + ja, + fr, + en, ); mainGroup = 2A37F4AAFDCFA73011CA2CEA /* DropPlot */; projectDirPath = ""; @@ -322,6 +339,20 @@ remoteRef = C3B345AD1B46194500844218 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C3CBFB7A1BE590A300519EE8 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3CBFB791BE590A300519EE8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3CBFB7C1BE590A300519EE8 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C3CBFB7B1BE590A300519EE8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -364,7 +395,7 @@ 089C165FFE840EACC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 089C1660FE840EACC02AAC07 /* English */, + C3564D1822A2D115000A54C9 /* en */, ); name = InfoPlist.strings; sourceTree = ""; @@ -372,7 +403,7 @@ 1DDD58280DA1D0D100B32029 /* CPTPlotDocument.xib */ = { isa = PBXVariantGroup; children = ( - 1DDD58290DA1D0D100B32029 /* English */, + C3DA082A20E00C3C00F73704 /* Base */, ); name = CPTPlotDocument.xib; sourceTree = ""; @@ -380,7 +411,7 @@ 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( - 1DDD582B0DA1D0D100B32029 /* English */, + C3DA082B20E00C3C00F73704 /* Base */, ); name = MainMenu.xib; sourceTree = ""; @@ -388,11 +419,19 @@ 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */ = { isa = PBXVariantGroup; children = ( - 2A37F4BAFDCFA73011CA2CEA /* English */, + C3564D1722A2D115000A54C9 /* en */, ); name = Credits.rtf; sourceTree = ""; }; + C37A40A920E0314800C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A40A820E0314800C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -403,14 +442,14 @@ ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = DropPlot_Prefix.pch; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; @@ -425,13 +464,14 @@ ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = DropPlot_Prefix.pch; HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; @@ -441,15 +481,15 @@ }; C05733CC08A9546B00998B17 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3D6210E19DF72E000652CE7 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; @@ -458,11 +498,13 @@ }; C05733CD08A9546B00998B17 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3D6210E19DF72E000652CE7 /* CorePlotWarnings.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; + MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; }; diff --git a/examples/DropPlot/DropPlot.xcodeproj/xcshareddata/xcschemes/DropPlot.xcscheme b/examples/DropPlot/DropPlot.xcodeproj/xcshareddata/xcschemes/DropPlot.xcscheme index 4abb0038f..e0844ecb4 100644 --- a/examples/DropPlot/DropPlot.xcodeproj/xcshareddata/xcschemes/DropPlot.xcscheme +++ b/examples/DropPlot/DropPlot.xcodeproj/xcshareddata/xcschemes/DropPlot.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "YES"> - - - - + + - - + buildForAnalyzing = "YES"> - - - - + + - - + buildForAnalyzing = "YES"> - - - - + + - - - - - - endDate - 2009-06-19T06:53:47Z - financialData - - - adjClose - 135.88 - close - 135.88 - date - 2009-06-18T04:00:00Z - high - 138 - low - 135.59 - open - 136.11 - volume - 15237600 - - - adjClose - 135.58 - close - 135.58 - date - 2009-06-17T04:00:00Z - high - 137.45 - low - 134.53 - open - 136.67 - volume - 20377100 - - - adjClose - 136.35 - close - 136.35 - date - 2009-06-16T04:00:00Z - high - 138.47 - low - 136.1 - open - 136.66 - volume - 18255100 - - - adjClose - 136.09 - close - 136.09 - date - 2009-06-15T04:00:00Z - high - 136.93 - low - 134.89 - open - 136.01 - volume - 19276800 - - - adjClose - 136.97 - close - 136.97 - date - 2009-06-12T04:00:00Z - high - 139.1 - low - 136.04 - open - 138.81 - volume - 20098500 - - - adjClose - 139.95 - close - 139.95 - date - 2009-06-11T04:00:00Z - high - 141.56 - low - 138.55 - open - 139.55 - volume - 18719300 - - - adjClose - 140.25 - close - 140.25 - date - 2009-06-10T04:00:00Z - high - 142.35 - low - 138.3 - open - 142.28 - volume - 24593700 - - - adjClose - 142.72 - close - 142.72 - date - 2009-06-09T04:00:00Z - high - 144.56 - low - 140.55 - open - 143.81 - volume - 24152500 - - - adjClose - 143.85 - close - 143.85 - date - 2009-06-08T04:00:00Z - high - 144.23 - low - 139.43 - open - 143.82 - volume - 33255400 - - - adjClose - 144.67 - close - 144.67 - date - 2009-06-05T04:00:00Z - high - 146.4 - low - 143.21 - open - 145.31 - volume - 22585700 - - - adjClose - 143.74 - close - 143.74 - date - 2009-06-04T04:00:00Z - high - 144.18 - low - 140.04 - open - 140.13 - volume - 19537200 - - - adjClose - 140.95 - close - 140.95 - date - 2009-06-03T04:00:00Z - high - 141.11 - low - 139.07 - open - 140 - volume - 20171800 - - - adjClose - 139.49 - close - 139.49 - date - 2009-06-02T04:00:00Z - high - 141.34 - low - 138.35 - open - 138.99 - volume - 16199500 - - - adjClose - 139.35 - close - 139.35 - date - 2009-06-01T04:00:00Z - high - 139.99 - low - 136 - open - 136.47 - volume - 16160700 - - - adjClose - 135.81 - close - 135.81 - date - 2009-05-29T04:00:00Z - high - 135.9 - low - 133.85 - open - 135.39 - volume - 16304800 - - - adjClose - 135.07 - close - 135.07 - date - 2009-05-28T04:00:00Z - high - 135.39 - low - 132.03 - open - 133.45 - volume - 17397200 - - - adjClose - 133.05 - close - 133.05 - date - 2009-05-27T04:00:00Z - high - 134.98 - low - 130.91 - open - 131.78 - volume - 23086500 - - - adjClose - 130.78 - close - 130.78 - date - 2009-05-26T04:00:00Z - high - 130.83 - low - 124.55 - open - 124.76 - volume - 22692300 - - - adjClose - 122.5 - close - 122.5 - date - 2009-05-22T04:00:00Z - high - 124.18 - low - 121.75 - open - 124.05 - volume - 10642800 - - - adjClose - 124.18 - close - 124.18 - date - 2009-05-21T04:00:00Z - high - 126.78 - low - 122.89 - open - 125.15 - volume - 14569500 - - - adjClose - 125.87 - close - 125.87 - date - 2009-05-20T04:00:00Z - high - 129.21 - low - 125.3 - open - 127.63 - volume - 13878000 - - - adjClose - 127.45 - close - 127.45 - date - 2009-05-19T04:00:00Z - high - 129.31 - low - 125.74 - open - 126.82 - volume - 13300800 - - - adjClose - 126.65 - close - 126.65 - date - 2009-05-18T04:00:00Z - high - 126.7 - low - 121.57 - open - 123.73 - volume - 16387200 - - - adjClose - 122.42 - close - 122.42 - date - 2009-05-15T04:00:00Z - high - 124.62 - low - 121.61 - open - 122.32 - volume - 13127400 - - - adjClose - 122.95 - close - 122.95 - date - 2009-05-14T04:00:00Z - high - 123.53 - low - 119.7 - open - 119.78 - volume - 15993800 - - - adjClose - 119.49 - close - 119.49 - date - 2009-05-13T04:00:00Z - high - 124.02 - low - 119.38 - open - 123.21 - volume - 21284700 - - - adjClose - 124.42 - close - 124.42 - date - 2009-05-12T04:00:00Z - high - 129.71 - low - 123.25 - open - 129.56 - volume - 21767200 - - - adjClose - 129.57 - close - 129.57 - date - 2009-05-11T04:00:00Z - high - 130.96 - low - 127.12 - open - 127.37 - volume - 14452100 - - - adjClose - 129.19 - close - 129.19 - date - 2009-05-08T04:00:00Z - high - 131.23 - low - 126.26 - open - 129.04 - volume - 16713000 - - - adjClose - 129.06 - close - 129.06 - date - 2009-05-07T04:00:00Z - high - 132.39 - low - 127.9 - open - 132.33 - volume - 18992000 - - - adjClose - 132.5 - close - 132.5 - date - 2009-05-06T04:00:00Z - high - 133.5 - low - 130.22 - open - 133.33 - volume - 16912100 - - - adjClose - 132.71 - close - 132.71 - date - 2009-05-05T04:00:00Z - high - 132.86 - low - 131.12 - open - 131.75 - volume - 14223400 - - - adjClose - 132.07 - close - 132.07 - date - 2009-05-04T04:00:00Z - high - 132.25 - low - 127.68 - open - 128.24 - volume - 21762800 - - - adjClose - 127.24 - close - 127.24 - date - 2009-05-01T04:00:00Z - high - 127.95 - low - 125.8 - open - 125.8 - volume - 14197000 - - - adjClose - 125.83 - close - 125.83 - date - 2009-04-30T04:00:00Z - high - 127 - low - 124.92 - open - 126.22 - volume - 17803200 - - - adjClose - 125.14 - close - 125.14 - date - 2009-04-29T04:00:00Z - high - 126.85 - low - 123.83 - open - 124.85 - volume - 16361100 - - - adjClose - 123.9 - close - 123.9 - date - 2009-04-28T04:00:00Z - high - 126.21 - low - 123.26 - open - 123.35 - volume - 16280600 - - - adjClose - 124.73 - close - 124.73 - date - 2009-04-27T04:00:00Z - high - 125 - low - 122.66 - open - 122.9 - volume - 17167500 - - - adjClose - 123.9 - close - 123.9 - date - 2009-04-24T04:00:00Z - high - 125.14 - low - 122.97 - open - 124.64 - volume - 19313000 - - - adjClose - 125.4 - close - 125.4 - date - 2009-04-23T04:00:00Z - high - 127.2 - low - 123.51 - open - 126.62 - volume - 33755600 - - - adjClose - 121.51 - close - 121.51 - date - 2009-04-22T04:00:00Z - high - 125.35 - low - 121.2 - open - 122.63 - volume - 33527400 - - - adjClose - 121.76 - close - 121.76 - date - 2009-04-21T04:00:00Z - high - 122.14 - low - 118.6 - open - 118.89 - volume - 16810200 - - - adjClose - 120.5 - close - 120.5 - date - 2009-04-20T04:00:00Z - high - 122.99 - low - 119.16 - open - 121.73 - volume - 16659500 - - - adjClose - 123.42 - close - 123.42 - date - 2009-04-17T04:00:00Z - high - 124.25 - low - 120.25 - open - 121.18 - volume - 17767700 - - - adjClose - 121.45 - close - 121.45 - date - 2009-04-16T04:00:00Z - high - 123.15 - low - 118.79 - open - 119.19 - volume - 21194500 - - - adjClose - 117.64 - close - 117.64 - date - 2009-04-15T04:00:00Z - high - 118.25 - low - 115.76 - open - 117.2 - volume - 14745800 - - - adjClose - 118.31 - close - 118.31 - date - 2009-04-14T04:00:00Z - high - 120.17 - low - 117.25 - open - 119.57 - volume - 16236500 - - - adjClose - 120.22 - close - 120.22 - date - 2009-04-13T04:00:00Z - high - 120.98 - low - 119 - open - 120.01 - volume - 13901300 - - - adjClose - 119.57 - close - 119.57 - date - 2009-04-09T04:00:00Z - high - 120 - low - 117.96 - open - 118.42 - volume - 18955600 - - - adjClose - 116.32 - close - 116.32 - date - 2009-04-08T04:00:00Z - high - 116.79 - low - 114.58 - open - 115.43 - volume - 16272500 - - - adjClose - 115 - close - 115 - date - 2009-04-07T04:00:00Z - high - 116.67 - low - 114.19 - open - 116.53 - volume - 19163600 - - - adjClose - 118.45 - close - 118.45 - date - 2009-04-06T04:00:00Z - high - 118.75 - low - 113.28 - open - 114.94 - volume - 23502300 - - - adjClose - 115.99 - close - 115.99 - date - 2009-04-03T04:00:00Z - high - 116.13 - low - 113.52 - open - 114.19 - volume - 22722900 - - - adjClose - 112.71 - close - 112.71 - date - 2009-04-02T04:00:00Z - high - 114.75 - low - 109.78 - open - 110.14 - volume - 29013100 - - - adjClose - 108.69 - close - 108.69 - date - 2009-04-01T04:00:00Z - high - 109 - low - 103.89 - open - 104.09 - volume - 21049000 - - - adjClose - 105.12 - close - 105.12 - date - 2009-03-31T04:00:00Z - high - 107.45 - low - 105 - open - 105.45 - volume - 20338500 - - - adjClose - 104.49 - close - 104.49 - date - 2009-03-30T04:00:00Z - high - 105.01 - low - 102.61 - open - 104.51 - volume - 17957000 - - - adjClose - 106.85 - close - 106.85 - date - 2009-03-27T04:00:00Z - high - 108.53 - low - 106.4 - open - 108.23 - volume - 17602600 - - - adjClose - 109.87 - close - 109.87 - date - 2009-03-26T04:00:00Z - high - 109.98 - low - 107.58 - open - 107.83 - volume - 22009000 - - - adjClose - 106.49 - close - 106.49 - date - 2009-03-25T04:00:00Z - high - 108.36 - low - 103.86 - open - 107.58 - volume - 23093500 - - - adjClose - 106.5 - close - 106.5 - date - 2009-03-24T04:00:00Z - high - 109.44 - low - 105.39 - open - 106.36 - volume - 22879000 - - - adjClose - 107.66 - close - 107.66 - date - 2009-03-23T04:00:00Z - high - 108.16 - low - 101.75 - open - 102.71 - volume - 23799900 - - - adjClose - 101.59 - close - 101.59 - date - 2009-03-20T04:00:00Z - high - 103.11 - low - 100.57 - open - 102.09 - volume - 24842400 - - - adjClose - 101.62 - close - 101.62 - date - 2009-03-19T04:00:00Z - high - 103.2 - low - 100.25 - open - 101.85 - volume - 17863600 - - - adjClose - 101.52 - close - 101.52 - date - 2009-03-18T04:00:00Z - high - 103.48 - low - 99.72 - open - 99.91 - volume - 28429900 - - - adjClose - 99.66 - close - 99.66 - date - 2009-03-17T04:00:00Z - high - 99.69 - low - 95.07000000000001 - open - 95.23999999999999 - volume - 28094500 - - - adjClose - 95.42 - close - 95.42 - date - 2009-03-16T04:00:00Z - high - 97.39 - low - 94.17999999999999 - open - 96.53 - volume - 28473000 - - - adjClose - 95.92999999999999 - close - 95.92999999999999 - date - 2009-03-13T04:00:00Z - high - 97.2 - low - 95.01000000000001 - open - 96.3 - volume - 21470300 - - - overallHigh - 146.4 - overallLow - 94.17999999999999 - startDate - 2009-03-13T06:53:47Z - symbol - AAPL - - diff --git a/examples/StockPlot/Classes/APYahooDataPuller.h b/examples/StockPlot/Classes/APYahooDataPuller.h deleted file mode 100644 index 0a69082f5..000000000 --- a/examples/StockPlot/Classes/APYahooDataPuller.h +++ /dev/null @@ -1,37 +0,0 @@ -#import "NSDictionary+APFinancialData.h" - -@class APYahooDataPuller; - -typedef NSArray *CPTFinancialDataArray; - -@protocol APYahooDataPullerDelegate - -@optional - --(void)dataPullerFinancialDataDidChange:(nonnull APYahooDataPuller *)dp; --(void)dataPuller:(nonnull APYahooDataPuller *)dp downloadDidFailWithError:(nonnull NSError *)error; - -@end - -#pragma mark - - -@interface APYahooDataPuller : NSObject - -@property (nonatomic, readwrite, weak, nullable) id delegate; -@property (nonatomic, readwrite, copy, nonnull) NSString *symbol; -@property (nonatomic, readwrite, strong, nonnull) NSDate *startDate; -@property (nonatomic, readwrite, strong, nonnull) NSDate *endDate; -@property (nonatomic, readwrite, copy, nonnull) NSString *targetSymbol; -@property (nonatomic, readwrite, strong, nonnull) NSDate *targetStartDate; -@property (nonatomic, readwrite, strong, nonnull) NSDate *targetEndDate; -@property (nonatomic, readonly, strong, nonnull) CPTFinancialDataArray financialData; -@property (nonatomic, readonly, strong, nonnull) NSDecimalNumber *overallHigh; -@property (nonatomic, readonly, strong, nonnull) NSDecimalNumber *overallLow; -@property (nonatomic, readonly, assign) BOOL loadingData; -@property (nonatomic, readonly, assign) BOOL staleData; - --(nonnull instancetype)initWithTargetSymbol:(nonnull NSString *)aSymbol targetStartDate:(nonnull NSDate *)aStartDate targetEndDate:(nonnull NSDate *)anEndDate; --(void)fetchIfNeeded; --(void)cancelDownload; - -@end diff --git a/examples/StockPlot/Classes/APYahooDataPuller.m b/examples/StockPlot/Classes/APYahooDataPuller.m deleted file mode 100644 index 005bb63f0..000000000 --- a/examples/StockPlot/Classes/APYahooDataPuller.m +++ /dev/null @@ -1,395 +0,0 @@ -#import "APYahooDataPuller.h" -#import "NSDictionary+APFinancialData.h" - -@interface APYahooDataPuller() - -@property (nonatomic, readwrite, copy, nonnull) NSString *csvString; - -@property (nonatomic, readwrite, strong, nonnull) NSDecimalNumber *overallHigh; -@property (nonatomic, readwrite, strong, nonnull) NSDecimalNumber *overallLow; -@property (nonatomic, readwrite, strong) CPTFinancialDataArray financialData; - -@property (nonatomic, readwrite, assign) BOOL loadingData; -@property (nonatomic, readwrite, strong, nullable) NSMutableData *receivedData; -@property (nonatomic, readwrite, strong, nullable) NSURLConnection *connection; - -NSTimeInterval timeIntervalForNumberOfWeeks(double numberOfWeeks); - --(nonnull CPTDictionary)sanitizedFinancialLine:(nonnull CPTDictionary)theFinancialLine; - --(nonnull instancetype)initWithDictionary:(nonnull CPTDictionary)aDict targetSymbol:(nonnull NSString *)aSymbol targetStartDate:(nonnull NSDate *)aStartDate targetEndDate:(nonnull NSDate *)anEndDate; - --(nonnull CPTDictionary)plistRep; --(BOOL)writeToFile:(nonnull NSString *)path atomically:(BOOL)flag; --(nonnull NSString *)URL; --(nonnull NSString *)pathForSymbol:(nonnull NSString *)aSymbol; --(nonnull NSString *)faultTolerantPathForSymbol:(nonnull NSString *)aSymbol; --(nonnull CPTDictionary)dictionaryForSymbol:(nonnull NSString *)aSymbol; - -@end - -#pragma mark - - -NSTimeInterval timeIntervalForNumberOfWeeks(double numberOfWeeks) -{ - NSTimeInterval seconds = fabs(60.0 * 60.0 * 24.0 * 7.0 * numberOfWeeks); - - return seconds; -} - -@implementation APYahooDataPuller - -@synthesize symbol; -@synthesize startDate; -@synthesize endDate; -@synthesize targetStartDate; -@synthesize targetEndDate; -@synthesize targetSymbol; -@synthesize overallLow; -@synthesize overallHigh; -@synthesize csvString; -@synthesize financialData; - -@synthesize receivedData; -@synthesize connection; -@synthesize loadingData; -@dynamic staleData; - -@synthesize delegate; - -// convert any NSNumber in financial line to NSDecimalNumber --(nonnull CPTDictionary)sanitizedFinancialLine:(nonnull CPTDictionary)theFinancialLine -{ - CPTMutableDictionary aFinancialLine = [NSMutableDictionary dictionaryWithDictionary:theFinancialLine]; - - for ( id key in aFinancialLine.allKeys ) { - id something = aFinancialLine[key]; - if ( [something respondsToSelector:@selector(decimalValue)] ) { - something = [NSDecimalNumber decimalNumberWithDecimal:( (NSNumber *)something ).decimalValue]; - aFinancialLine[key] = something; - } - } - return [NSDictionary dictionaryWithDictionary:aFinancialLine]; -} - --(void)setFinancialData:(nonnull NSArray *)aFinancialData -{ - // NSLog(@"in -setFinancialData:, old value of financialData: %@, changed to: %@", financialData, aFinancialData); - - if ( financialData != aFinancialData ) { - NSMutableArray *mutableFinancialData = [aFinancialData mutableCopy]; - CPTDictionary financialLine = nil; - - NSUInteger count = mutableFinancialData.count; - - for ( NSUInteger i = 0; i < count; i++ ) { - financialLine = (CPTDictionary)mutableFinancialData[i]; - financialLine = [self sanitizedFinancialLine:financialLine]; - mutableFinancialData[i] = financialLine; - } - - financialData = [[NSArray alloc] initWithArray:mutableFinancialData]; - if ( 0 < financialData.count ) { - [self notifyFinancesChanged]; - } - } -} - --(nonnull CPTDictionary)plistRep -{ - CPTMutableDictionary rep = [NSMutableDictionary dictionaryWithCapacity:7]; - - rep[@"symbol"] = self.symbol; - rep[@"startDate"] = self.startDate; - rep[@"endDate"] = self.endDate; - rep[@"overallHigh"] = self.overallHigh; - rep[@"overallLow"] = self.overallLow; - rep[@"financialData"] = self.financialData; - - return [NSDictionary dictionaryWithDictionary:rep]; -} - --(BOOL)writeToFile:(nonnull NSString *)path atomically:(BOOL)flag -{ - NSLog(@"writeToFile:%@", path); - BOOL success = [[self plistRep] writeToFile:path atomically:flag]; - return success; -} - --(nonnull instancetype)initWithDictionary:(nonnull CPTDictionary)aDict targetSymbol:(nonnull NSString *)aSymbol targetStartDate:(nonnull NSDate *)aStartDate targetEndDate:(nonnull NSDate *)anEndDate -{ - self = [super init]; - if ( self != nil ) { - NSString *theSymbol = aDict[@"symbol"]; - self.symbol = theSymbol ? theSymbol : @""; - NSDate *theStartDate = aDict[@"startDate"]; - self.startDate = theStartDate ? theStartDate : [NSDate date]; - NSDate *theEndDate = aDict[@"endDate"]; - self.endDate = theEndDate ? theEndDate : [NSDate date]; - NSNumber *low = aDict[@"overallLow"]; - self.overallLow = low ? [NSDecimalNumber decimalNumberWithDecimal:low.decimalValue] : [NSDecimalNumber notANumber]; - NSNumber *high = aDict[@"overallHigh"]; - self.overallHigh = high ? [NSDecimalNumber decimalNumberWithDecimal:high.decimalValue] : [NSDecimalNumber notANumber]; - CPTFinancialDataArray dataArray = aDict[@"financialData"]; - self.financialData = dataArray ? dataArray : [[NSArray alloc] init]; - - self.targetSymbol = aSymbol; - self.targetStartDate = aStartDate; - self.targetEndDate = anEndDate; - - self.csvString = @""; - } - return self; -} - --(nonnull NSString *)pathForSymbol:(nonnull NSString *)aSymbol -{ - CPTStringArray paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsDirectory = paths[0]; - NSString *docPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.plist", aSymbol]]; - - return docPath; -} - --(nonnull NSString *)faultTolerantPathForSymbol:(nonnull NSString *)aSymbol -{ - NSString *docPath = [self pathForSymbol:aSymbol]; - - if ( ![[NSFileManager defaultManager] fileExistsAtPath:docPath] ) { - // if there isn't one in the user's documents directory, see if we ship with this data - docPath = [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.plist", aSymbol]]; - } - return docPath; -} - -// Always returns *something* --(nonnull CPTDictionary)dictionaryForSymbol:(nonnull NSString *)aSymbol -{ - NSString *path = [self faultTolerantPathForSymbol:aSymbol]; - - CPTMutableDictionary localPlistDict = [NSMutableDictionary dictionaryWithContentsOfFile:path]; - - return localPlistDict; -} - --(nonnull instancetype)initWithTargetSymbol:(nonnull NSString *)aSymbol targetStartDate:(nonnull NSDate *)aStartDate targetEndDate:(nonnull NSDate *)anEndDate -{ - CPTDictionary cachedDictionary = [self dictionaryForSymbol:aSymbol]; - - if ( nil != cachedDictionary ) { - return [self initWithDictionary:cachedDictionary targetSymbol:aSymbol targetStartDate:aStartDate targetEndDate:anEndDate]; - } - - CPTMutableDictionary rep = [NSMutableDictionary dictionaryWithCapacity:7]; - rep[@"symbol"] = aSymbol; - rep[@"startDate"] = aStartDate; - rep[@"endDate"] = anEndDate; - rep[@"overallHigh"] = [NSDecimalNumber notANumber]; - rep[@"overallLow"] = [NSDecimalNumber notANumber]; - rep[@"financialData"] = @[]; - - return [self initWithDictionary:rep targetSymbol:aSymbol targetStartDate:aStartDate targetEndDate:anEndDate]; -} - --(nonnull instancetype)init -{ - NSTimeInterval secondsAgo = -timeIntervalForNumberOfWeeks(14.0); // 12 weeks ago - NSDate *start = [NSDate dateWithTimeIntervalSinceNow:secondsAgo]; - - NSDate *end = [NSDate date]; - - return [self initWithTargetSymbol:@"AAPL" targetStartDate:start targetEndDate:end]; -} - --(void)dealloc -{ - delegate = nil; -} - -// http://www.goldb.org/ystockquote.html --(nonnull NSString *)URL -{ - NSUInteger unitFlags = NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitYear; - - NSCalendar *gregorian = [[NSCalendar alloc] - initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; - - NSString *url = [NSString stringWithFormat:@"https://ichart.yahoo.com/table.csv?s=%@&", self.targetSymbol]; - - NSDate *tStartDate = self.targetStartDate; - - if ( tStartDate ) { - NSDateComponents *compsStart = [gregorian components:unitFlags fromDate:tStartDate]; - - url = [url stringByAppendingFormat:@"a=%ld&", (long)compsStart.month - 1]; - url = [url stringByAppendingFormat:@"b=%ld&", (long)compsStart.day]; - url = [url stringByAppendingFormat:@"c=%ld&", (long)compsStart.year]; - } - - NSDate *tEndDate = self.targetEndDate; - if ( tEndDate ) { - NSDateComponents *compsEnd = [gregorian components:unitFlags fromDate:tEndDate]; - - url = [url stringByAppendingFormat:@"d=%ld&", (long)compsEnd.month - 1]; - url = [url stringByAppendingFormat:@"e=%ld&", (long)compsEnd.day]; - url = [url stringByAppendingFormat:@"f=%ld&", (long)compsEnd.year]; - } - - url = [url stringByAppendingString:@"g=d&"]; - - url = [url stringByAppendingString:@"ignore=.csv"]; - url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - - return url; -} - --(void)notifyFinancesChanged -{ - id theDelegate = self.delegate; - - if ( [theDelegate respondsToSelector:@selector(dataPullerFinancialDataDidChange:)] ) { - [theDelegate performSelector:@selector(dataPullerFinancialDataDidChange:) withObject:self]; - } -} - -#pragma mark - -#pragma mark Downloading of data - --(BOOL)staleData -{ - NSTimeInterval twelveHours = 60.0 * 60.0 * 12.0; - - return 0 >= self.financialData.count || - ![self.targetSymbol isEqualToString:self.symbol] || - [self.targetStartDate timeIntervalSinceDate:self.startDate] > twelveHours || - [self.targetEndDate timeIntervalSinceDate:self.endDate] > twelveHours; -} - --(void)fetchIfNeeded -{ - if ( self.loadingData ) { - return; - } - - // Check to see if cached data is stale - if ( self.staleData ) { - self.loadingData = YES; - NSString *urlString = [self URL]; - NSLog(@"Fetching URL %@", urlString); - NSURL *url = [NSURL URLWithString:urlString]; - NSURLRequest *theRequest = [NSURLRequest requestWithURL:url - cachePolicy:NSURLRequestUseProtocolCachePolicy - timeoutInterval:60.0]; - - // create the connection with the request - // and start loading the data - self.connection = [NSURLConnection connectionWithRequest:theRequest delegate:self]; - if ( self.connection ) { - self.receivedData = [NSMutableData data]; - } - else { - self.loadingData = NO; - } - } -} - --(void)connection:(nonnull NSURLConnection *)connection didReceiveData:(nonnull NSData *)data -{ - // append the new data to the receivedData - [self.receivedData appendData:data]; -} - --(void)connection:(nonnull NSURLConnection *)connection didReceiveResponse:(nonnull NSURLResponse *)response -{ - // this method is called when the server has determined that it - // has enough information to create the NSURLResponse - // it can be called multiple times, for example in the case of a - // redirect, so each time we reset the data. - self.receivedData.length = 0; -} - --(void)cancelDownload -{ - if ( self.loadingData ) { - [self.connection cancel]; - self.loadingData = NO; - - self.receivedData = nil; - self.connection = nil; - } -} - --(void)connection:(nonnull NSURLConnection *)connection didFailWithError:(nonnull NSError *)error -{ - self.loadingData = NO; - self.receivedData = nil; - self.connection = nil; - NSLog(@"err = %@", error.localizedDescription); - self.connection = nil; - - id theDelegate = self.delegate; - if ( [theDelegate respondsToSelector:@selector(dataPuller:downloadDidFailWithError:)] ) { - [theDelegate performSelector:@selector(dataPuller:downloadDidFailWithError:) withObject:self withObject:error]; - } -} - --(void)connectionDidFinishLoading:(nonnull NSURLConnection *)connection -{ - self.loadingData = NO; - self.connection = nil; - - NSMutableData *data = self.receivedData; - if ( data ) { - NSString *csv = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - [self populateWithString:csv]; - } - else { - [self populateWithString:@""]; - } - - self.receivedData = nil; - [self writeToFile:[self pathForSymbol:self.symbol] atomically:YES]; -} - --(void)populateWithString:(NSString *)csv -{ - CPTStringArray csvLines = [csv componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; - - NSMutableArray *newFinancials = [NSMutableArray arrayWithCapacity:csvLines.count]; - NSDictionary *currentFinancial = nil; - NSString *line = nil; - - self.overallHigh = [NSDecimalNumber notANumber]; - self.overallLow = [NSDecimalNumber notANumber]; - - for ( NSUInteger i = 1; i < csvLines.count - 1; i++ ) { - line = (NSString *)csvLines[i]; - currentFinancial = [NSDictionary dictionaryWithCSVLine:line]; - [newFinancials addObject:currentFinancial]; - - NSDecimalNumber *high = currentFinancial[@"high"]; - NSDecimalNumber *low = currentFinancial[@"low"]; - - if ( [self.overallHigh isEqual:[NSDecimalNumber notANumber]] ) { - self.overallHigh = high; - } - - if ( [self.overallLow isEqual:[NSDecimalNumber notANumber]] ) { - self.overallLow = low; - } - - if ( [low compare:self.overallLow] == NSOrderedAscending ) { - self.overallLow = low; - } - if ( [high compare:self.overallHigh] == NSOrderedDescending ) { - self.overallHigh = high; - } - } - self.startDate = self.targetStartDate; - self.endDate = self.targetEndDate; - self.symbol = self.targetSymbol; - - self.financialData = [NSArray arrayWithArray:newFinancials]; -} - -@end diff --git a/examples/StockPlot/Classes/APYahooDataPullerGraph.h b/examples/StockPlot/Classes/APYahooDataPullerGraph.h deleted file mode 100644 index 7e4f72c24..000000000 --- a/examples/StockPlot/Classes/APYahooDataPullerGraph.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// APYahooDataPullerGraph.h -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - -#import "APYahooDataPuller.h" -#import "CorePlot-CocoaTouch.h" -#import - -@interface APYahooDataPullerGraph : UIViewController - -@property (nonatomic, strong, nullable) IBOutlet CPTGraphHostingView *graphHost; -@property (nonatomic, strong, nonnull) APYahooDataPuller *dataPuller; - -@end diff --git a/examples/StockPlot/Classes/APYahooDataPullerGraph.m b/examples/StockPlot/Classes/APYahooDataPullerGraph.m deleted file mode 100644 index 9125fced1..000000000 --- a/examples/StockPlot/Classes/APYahooDataPullerGraph.m +++ /dev/null @@ -1,170 +0,0 @@ -// -// APYahooDataPullerGraph.m -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - -#import "APYahooDataPullerGraph.h" - -@interface APYahooDataPullerGraph() - -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; - -@end - -#pragma mark - - -@implementation APYahooDataPullerGraph - -@synthesize graphHost; -@synthesize dataPuller; -@synthesize graph; - --(void)reloadData -{ - if ( !self.graph ) { - CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; - [newGraph applyTheme:theme]; - self.graph = newGraph; - - newGraph.paddingTop = 30.0; - newGraph.paddingBottom = 30.0; - newGraph.paddingLeft = 50.0; - newGraph.paddingRight = 50.0; - - CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] initWithFrame:newGraph.bounds]; - dataSourceLinePlot.identifier = @"Data Source Plot"; - - CPTMutableLineStyle *lineStyle = [dataSourceLinePlot.dataLineStyle mutableCopy]; - lineStyle.lineWidth = 1.0; - lineStyle.lineColor = [CPTColor redColor]; - dataSourceLinePlot.dataLineStyle = lineStyle; - - dataSourceLinePlot.dataSource = self; - [newGraph addPlot:dataSourceLinePlot]; - } - - CPTXYGraph *theGraph = self.graph; - self.graphHost.hostedGraph = theGraph; - - CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)theGraph.defaultPlotSpace; - - NSDecimalNumber *high = self.dataPuller.overallHigh; - NSDecimalNumber *low = self.dataPuller.overallLow; - NSDecimalNumber *length = [high decimalNumberBySubtracting:low]; - - // NSLog(@"high = %@, low = %@, length = %@", high, low, length); - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(self.dataPuller.financialData.count)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:low length:length]; - // Axes - CPTXYAxisSet *axisSet = (CPTXYAxisSet *)theGraph.axisSet; - - CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = @10.0; - x.orthogonalPosition = @0.0; - x.minorTicksPerInterval = 1; - - CPTXYAxis *y = axisSet.yAxis; - NSDecimal six = CPTDecimalFromInteger(6); - y.majorIntervalLength = [NSDecimalNumber decimalNumberWithDecimal:CPTDecimalDivide(length.decimalValue, six)]; - y.majorTickLineStyle = nil; - y.minorTicksPerInterval = 4; - y.minorTickLineStyle = nil; - y.orthogonalPosition = @0.0; - y.alternatingBandFills = @[[[CPTColor whiteColor] colorWithAlphaComponent:CPTFloat(0.1)], [NSNull null]]; - - [theGraph reloadData]; - - self.navigationItem.title = self.dataPuller.symbol; -} - --(void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; -} - -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. --(void)viewDidLoad -{ - [super viewDidLoad]; - [self reloadData]; -} - --(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration -{ - // NSLog(@"willRotateToInterfaceOrientation"); -} - --(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation -{ - // NSLog(@"didRotateFromInterfaceOrientation"); -} - --(void)didReceiveMemoryWarning -{ - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -#pragma mark - -#pragma mark Plot Data Source Methods - --(NSUInteger)numberOfRecords -{ - return self.dataPuller.financialData.count; -} - --(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index -{ - NSNumber *num = @0; - - if ( fieldEnum == CPTScatterPlotFieldX ) { - num = @(index + 1); - } - else if ( fieldEnum == CPTScatterPlotFieldY ) { - CPTFinancialDataArray financialData = self.dataPuller.financialData; - - CPTDictionary fData = financialData[financialData.count - index - 1]; - num = fData[@"close"]; - NSAssert([num isMemberOfClass:[NSDecimalNumber class]], @"grrr"); - } - - return num; -} - --(void)dataPullerFinancialDataDidChange:(nonnull APYahooDataPuller *)dp -{ - [self reloadData]; -} - -#pragma mark accessors - --(void)setDataPuller:(nonnull APYahooDataPuller *)aDataPuller -{ - // NSLog(@"in -setDataPuller:, old value of dataPuller: %@, changed to: %@", dataPuller, aDataPuller); - - if ( dataPuller != aDataPuller ) { - dataPuller = aDataPuller; - dataPuller.delegate = self; - [self reloadData]; - } -} - --(void)dealloc -{ - if ( dataPuller.delegate == self ) { - [dataPuller setDelegate:nil]; - } -} - --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot -{ - return [self numberOfRecords]; -} - -@end diff --git a/examples/StockPlot/Classes/APYahooDataPullerGraph.xib b/examples/StockPlot/Classes/APYahooDataPullerGraph.xib deleted file mode 100644 index 979259557..000000000 --- a/examples/StockPlot/Classes/APYahooDataPullerGraph.xib +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/StockPlot/Classes/NSDictionary+APFinancialData.h b/examples/StockPlot/Classes/NSDictionary+APFinancialData.h deleted file mode 100644 index 9a2509602..000000000 --- a/examples/StockPlot/Classes/NSDictionary+APFinancialData.h +++ /dev/null @@ -1,7 +0,0 @@ -#import "CorePlot-CocoaTouch.h" - -@interface NSDictionary(APFinancialData) - -+(nonnull CPTDictionary)dictionaryWithCSVLine:(nonnull NSString *)csvLine; - -@end diff --git a/examples/StockPlot/Classes/NSDictionary+APFinancialData.m b/examples/StockPlot/Classes/NSDictionary+APFinancialData.m deleted file mode 100644 index 2bd122e61..000000000 --- a/examples/StockPlot/Classes/NSDictionary+APFinancialData.m +++ /dev/null @@ -1,60 +0,0 @@ -#import "NSDictionary+APFinancialData.h" - -@interface NSDateFormatter(yahooCSVDateFormatter) - -+(nonnull NSDateFormatter *)yahooCSVDateFormatter; - -@end - -#pragma mark - - -@implementation NSDateFormatter(yahooCSVDateFormatter) - -+(nonnull NSDateFormatter *)yahooCSVDateFormatter -{ - static NSDateFormatter *df = nil; - static dispatch_once_t onceToken = 0; - - dispatch_once(&onceToken, ^{ - df = [[NSDateFormatter alloc] init]; - df.dateFormat = @"yyyy-MM-dd"; - }); - - return df; -} - -@end - -#pragma mark - - -@implementation NSDictionary(APFinancialData) - -+(nonnull CPTDictionary)dictionaryWithCSVLine:(nonnull NSString *)csvLine -{ - CPTStringArray csvChunks = [csvLine componentsSeparatedByString:@","]; - - CPTMutableDictionary csvDict = [NSMutableDictionary dictionaryWithCapacity:7]; - - // Date,Open,High,Low,Close,Volume,Adj Close - // 2009-06-08,143.82,144.23,139.43,143.85,33255400,143.85 - NSDate *theDate = [[NSDateFormatter yahooCSVDateFormatter] dateFromString:csvChunks[0]]; - - csvDict[@"date"] = theDate; - NSDecimalNumber *theOpen = [NSDecimalNumber decimalNumberWithString:csvChunks[1]]; - csvDict[@"open"] = theOpen; - NSDecimalNumber *theHigh = [NSDecimalNumber decimalNumberWithString:csvChunks[2]]; - csvDict[@"high"] = theHigh; - NSDecimalNumber *theLow = [NSDecimalNumber decimalNumberWithString:csvChunks[3]]; - csvDict[@"low"] = theLow; - NSDecimalNumber *theClose = [NSDecimalNumber decimalNumberWithString:csvChunks[4]]; - csvDict[@"close"] = theClose; - NSDecimalNumber *theVolume = [NSDecimalNumber decimalNumberWithString:csvChunks[5]]; - csvDict[@"volume"] = theVolume; - NSDecimalNumber *theAdjClose = [NSDecimalNumber decimalNumberWithString:csvChunks[6]]; - csvDict[@"adjClose"] = theAdjClose; - - // non-mutable autoreleased dict - return [NSDictionary dictionaryWithDictionary:csvDict]; -} - -@end diff --git a/examples/StockPlot/Classes/RootViewController.h b/examples/StockPlot/Classes/RootViewController.h deleted file mode 100644 index 0c0774805..000000000 --- a/examples/StockPlot/Classes/RootViewController.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// RootViewController.h -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// -#import - -#import "APYahooDataPuller.h" -#import "APYahooDataPullerGraph.h" - -@interface RootViewController : UITableViewController - -@property (nonatomic, readonly, strong, nonnull) CPTStringArray symbols; - --(void)addSymbol:(nonnull NSString *)aSymbol; - -@end diff --git a/examples/StockPlot/Classes/RootViewController.m b/examples/StockPlot/Classes/RootViewController.m deleted file mode 100644 index 4037157e3..000000000 --- a/examples/StockPlot/Classes/RootViewController.m +++ /dev/null @@ -1,319 +0,0 @@ -// -// RootViewController.m -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// - -#import "APYahooDataPuller.h" -#import "RootViewController.h" - -@interface RootViewController() - -@property (nonatomic, readwrite, strong, nonnull) APYahooDataPullerGraph *graph; -@property (nonatomic, readwrite, strong, nonnull) NSMutableArray *stocks; - -@end - -@implementation RootViewController - -@synthesize graph; -@synthesize stocks; -@dynamic symbols; - --(void)viewDidLoad -{ - [super viewDidLoad]; - self.stocks = [[NSMutableArray alloc] initWithCapacity:4]; - [self addSymbol:@"AAPL"]; - [self addSymbol:@"GOOG"]; - [self addSymbol:@"YHOO"]; - [self addSymbol:@"MSFT"]; - - // Uncomment the following line to display an Edit button in the navigation bar for this view controller. - // self.navigationItem.rightBarButtonItem = self.editButtonItem; -} - --(void)didReceiveMemoryWarning -{ - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - --(void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; - self.navigationItem.title = @"Stocks"; - // the graph will set itself as delegate of the dataPuller when we push it, so we need to reset this. - for ( APYahooDataPuller *dp in self.stocks ) { - dp.delegate = self; - } -} - -#pragma mark Table view methods - --(void)inspectStock:(nonnull APYahooDataPuller *)aStock -{ - NSDecimalNumber *high = aStock.overallHigh; - NSDecimalNumber *low = aStock.overallLow; - - if ( [high isEqualToNumber:[NSDecimalNumber notANumber]] || [low isEqualToNumber:[NSDecimalNumber notANumber]] || (aStock.financialData.count <= 0) ) { - NSString *message = [NSString stringWithFormat:@"No information available for %@", aStock.symbol]; - UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Alert" message:message delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil]; - [av show]; - } - else { - if ( nil == self.graph ) { - APYahooDataPullerGraph *aGraph = [[APYahooDataPullerGraph alloc] initWithNibName:@"APYahooDataPullerGraph" bundle:nil]; - self.graph = aGraph; - } - - self.graph.dataPuller = aStock; - [self.navigationController pushViewController:self.graph animated:YES]; - self.graph.view.frame = self.view.bounds; - } -} - -// Override to support row selection in the table view. --(void)tableView:(nonnull UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath -{ - APYahooDataPuller *dp = self.stocks[(NSUInteger)indexPath.row]; - - [self inspectStock:dp]; - [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; -} - --(NSInteger)numberOfSectionsInTableView:(nonnull UITableView *)tableView -{ - return 1; -} - -// Customize the number of rows in the table view. --(NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - return (NSInteger)self.stocks.count; -} - --(void)setupCell:(nonnull UITableViewCell *)cell forStockAtIndex:(NSUInteger)row -{ - APYahooDataPuller *dp = self.stocks[row]; - - cell.textLabel.text = dp.symbol; - - NSDateFormatter *df = [[NSDateFormatter alloc] init]; - df.dateStyle = NSDateFormatterShortStyle; - NSString *startString = @"(NA)"; - if ( dp.startDate ) { - startString = [df stringFromDate:dp.startDate]; - } - - NSString *endString = @"(NA)"; - if ( dp.endDate ) { - endString = [df stringFromDate:dp.endDate]; - } - - NSNumberFormatter *nf = [[NSNumberFormatter alloc] init]; - nf.roundingMode = NSNumberFormatterRoundHalfUp; - nf.decimalSeparator = @"."; - nf.groupingSeparator = @","; - nf.positiveFormat = @"\u00A4###,##0.00"; - nf.negativeFormat = @"(\u00A4###,##0.00)"; - - NSString *overallLow = @"(NA)"; - if ( ![[NSDecimalNumber notANumber] isEqual:dp.overallLow] ) { - overallLow = [nf stringFromNumber:dp.overallLow]; - } - NSString *overallHigh = @"(NA)"; - if ( ![[NSDecimalNumber notANumber] isEqual:dp.overallHigh] ) { - overallHigh = [nf stringFromNumber:dp.overallHigh]; - } - - cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ - %@; Low:%@ High:%@", startString, endString, overallLow, overallHigh]; - - UIView *accessory = cell.accessoryView; - if ( dp.loadingData ) { - if ( ![accessory isMemberOfClass:[UIActivityIndicatorView class]] ) { - accessory = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; - [(UIActivityIndicatorView *) accessory setHidesWhenStopped:NO]; - cell.accessoryView = accessory; - } - [(UIActivityIndicatorView *) accessory startAnimating]; - } - else { - if ( [accessory isMemberOfClass:[UIActivityIndicatorView class]] ) { - [(UIActivityIndicatorView *) accessory stopAnimating]; - } - if ( dp.staleData ) { - if ( ![accessory isMemberOfClass:[UIImageView class]] ) { - UIImage *caution = [UIImage imageNamed:@"caution.png"]; - accessory = [[UIImageView alloc] initWithImage:caution]; - cell.accessoryView = accessory; -// CGRect frame = accessory.frame; -// #pragma unused (frame) - } - } - else { - [cell setAccessoryView:nil]; - } - } -} - -// Customize the appearance of table view cells. --(UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath -{ - static NSString *CellIdentifier = @"UITableViewCellStyleSubtitle"; - - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; - - if ( cell == nil ) { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; - } - - NSUInteger row = (NSUInteger)indexPath.row; - - [self setupCell:cell forStockAtIndex:row]; - - return cell; -} - --(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation -{ - self.graph.view.frame = self.view.bounds; -} - -#pragma mark - -#pragma mark accessors - --(nonnull CPTStringArray)symbols -{ - // NSLog(@"in -symbols, returned symbols = %@", symbols); - CPTMutableStringArray symbols = [NSMutableArray arrayWithCapacity:self.stocks.count]; - - for ( APYahooDataPuller *dp in self.stocks ) { - [symbols addObject:dp.symbol]; - } - return [NSArray arrayWithArray:symbols]; -} - --(void)dataPuller:(nonnull APYahooDataPuller *)dp downloadDidFailWithError:(nonnull NSError *)error -{ - NSLog(@"dataPuller:%@ downloadDidFailWithError:%@", dp, error); - NSUInteger idx = [self.stocks indexOfObject:dp]; - NSInteger section = 0; - NSIndexPath *path = [NSIndexPath indexPathForRow:(NSInteger)idx inSection:section]; - UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path]; - [self setupCell:cell forStockAtIndex:idx]; -} - --(void)dataPullerFinancialDataDidChange:(nonnull APYahooDataPuller *)dp -{ - NSLog(@"dataPullerFinancialDataDidChange:%@", dp); - NSUInteger idx = [self.stocks indexOfObject:dp]; - NSInteger section = 0; - NSIndexPath *path = [NSIndexPath indexPathForRow:(NSInteger)idx inSection:section]; - UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path]; - [self setupCell:cell forStockAtIndex:idx]; -} - --(void)addSymbol:(nonnull NSString *)aSymbol -{ - NSTimeInterval secondsAgo = -fabs(60.0 * 60.0 * 24.0 * 7.0 * 12.0); // 12 weeks ago - NSDate *start = [NSDate dateWithTimeIntervalSinceNow:secondsAgo]; - NSDate *end = [NSDate date]; - - APYahooDataPuller *dp = [[APYahooDataPuller alloc] initWithTargetSymbol:aSymbol targetStartDate:start targetEndDate:end]; - - [self.stocks addObject:dp]; - [dp fetchIfNeeded]; - dp.delegate = self; - [self.tableView reloadData]; // TODO: should reload whole thing -} - --(void)dealloc -{ - for ( APYahooDataPuller *dp in stocks ) { - if ( dp.delegate == self ) { - dp.delegate = nil; - } - } - stocks = nil; -} - -/* - * - (void)viewDidLoad { - * [super viewDidLoad]; - * - * // Uncomment the following line to display an Edit button in the navigation bar for this view controller. - * // self.navigationItem.rightBarButtonItem = self.editButtonItem; - * } - */ - -/* - * - (void)viewDidAppear:(BOOL)animated { - * [super viewDidAppear:animated]; - * } - */ - -/* - * - (void)viewWillDisappear:(BOOL)animated { - * [super viewWillDisappear:animated]; - * } - */ - -/* - * - (void)viewDidDisappear:(BOOL)animated { - * [super viewDidDisappear:animated]; - * } - */ - -/* - * // Override to support row selection in the table view. - * - (void)tableView:(nonnull UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath { - * - * // Navigation logic may go here -- for example, create and push another view controller. - * // AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; - * // [self.navigationController pushViewController:anotherViewController animated:YES]; - * // [anotherViewController release]; - * } - */ - -/* - * // Override to support conditional editing of the table view. - * - (BOOL)tableView:(nonnull UITableView *)tableView canEditRowAtIndexPath:(nonnull NSIndexPath *)indexPath { - * // Return NO if you do not want the specified item to be editable. - * return YES; - * } - */ - -/* - * // Override to support editing the table view. - * - (void)tableView:(nonnull UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(nonnull NSIndexPath *)indexPath { - * - * if (editingStyle == UITableViewCellEditingStyleDelete) { - * // Delete the row from the data source. - * [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; - * } - * else if (editingStyle == UITableViewCellEditingStyleInsert) { - * // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. - * } - * } - */ - -/* - * // Override to support rearranging the table view. - * - (void)tableView:(nonnull UITableView *)tableView moveRowAtIndexPath:(nonnull NSIndexPath *)fromIndexPath toIndexPath:(nonnull NSIndexPath *)toIndexPath { - * } - */ - -/* - * // Override to support conditional rearranging of the table view. - * - (BOOL)tableView:(nonnull UITableView *)tableView canMoveRowAtIndexPath:(nonnull NSIndexPath *)indexPath { - * // Return NO if you do not want the item to be re-orderable. - * return YES; - * } - */ - -@end diff --git a/examples/StockPlot/Classes/StockPlotAppDelegate.h b/examples/StockPlot/Classes/StockPlotAppDelegate.h deleted file mode 100644 index 8ef6cdd9d..000000000 --- a/examples/StockPlot/Classes/StockPlotAppDelegate.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// StockPlotAppDelegate.h -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// - -@interface StockPlotAppDelegate : NSObject - -@property (nonatomic, strong, nullable) IBOutlet UIWindow *window; -@property (nonatomic, strong, nullable) IBOutlet UINavigationController *navigationController; - -@end diff --git a/examples/StockPlot/Classes/StockPlotAppDelegate.m b/examples/StockPlot/Classes/StockPlotAppDelegate.m deleted file mode 100644 index 73a586315..000000000 --- a/examples/StockPlot/Classes/StockPlotAppDelegate.m +++ /dev/null @@ -1,36 +0,0 @@ -// -// StockPlotAppDelegate.m -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// - -#import "RootViewController.h" -#import "StockPlotAppDelegate.h" - -@implementation StockPlotAppDelegate - -@synthesize window; -@synthesize navigationController; - -#pragma mark - -#pragma mark Application lifecycle - --(void)applicationDidFinishLaunching:(nonnull UIApplication *)application -{ - self.navigationController.navigationBar.tintColor = [UIColor blackColor]; - - self.window.rootViewController = self.navigationController; - [self.window makeKeyAndVisible]; -} - --(void)applicationWillTerminate:(nonnull UIApplication *)application -{ - // Save data if appropriate -} - -#pragma mark - -#pragma mark Memory management - -@end diff --git a/examples/StockPlot/GOOG.plist b/examples/StockPlot/GOOG.plist deleted file mode 100644 index 489ad37be..000000000 --- a/examples/StockPlot/GOOG.plist +++ /dev/null @@ -1,1107 +0,0 @@ - - - - - endDate - 2009-06-19T06:53:47Z - financialData - - - adjClose - 414.0600000000001 - close - 414.0600000000001 - date - 2009-06-18T04:00:00Z - high - 418.6899999999999 - low - 413 - open - 415.68 - volume - 3085200 - - - adjClose - 415.16 - close - 415.16 - date - 2009-06-17T04:00:00Z - high - 419.72 - low - 411.5600000000001 - open - 416.1899999999999 - volume - 3490100 - - - adjClose - 416 - close - 416 - date - 2009-06-16T04:00:00Z - high - 421.09 - low - 415.42 - open - 419.3100000000001 - volume - 3049700 - - - adjClose - 416.77 - close - 416.77 - date - 2009-06-15T04:00:00Z - high - 421.5 - low - 414 - open - 421.5 - volume - 3736900 - - - adjClose - 424.84 - close - 424.84 - date - 2009-06-12T04:00:00Z - high - 427.7 - low - 421.21 - open - 426.86 - volume - 2918400 - - - adjClose - 429 - close - 429 - date - 2009-06-11T04:00:00Z - high - 433.73 - low - 428.37 - open - 431.77 - volume - 2865200 - - - adjClose - 432.6 - close - 432.6 - date - 2009-06-10T04:00:00Z - high - 437.89 - low - 426.67 - open - 436.23 - volume - 3358900 - - - adjClose - 435.62 - close - 435.62 - date - 2009-06-09T04:00:00Z - high - 440.5 - low - 431.76 - open - 438.58 - volume - 3254900 - - - adjClose - 438.77 - close - 438.77 - date - 2009-06-08T04:00:00Z - high - 440.92 - low - 434.12 - open - 439.5 - volume - 3098700 - - - adjClose - 444.32 - close - 444.32 - date - 2009-06-05T04:00:00Z - high - 447.34 - low - 439.46 - open - 445.07 - volume - 3680800 - - - adjClose - 440.28 - close - 440.28 - date - 2009-06-04T04:00:00Z - high - 441.24 - low - 434.5 - open - 435.3 - volume - 3638100 - - - adjClose - 431.65 - close - 431.65 - date - 2009-06-03T04:00:00Z - high - 432.46 - low - 424 - open - 426 - volume - 3532800 - - - adjClose - 428.4 - close - 428.4 - date - 2009-06-02T04:00:00Z - high - 429.96 - low - 423.4 - open - 426.25 - volume - 2623600 - - - adjClose - 426.5600000000001 - close - 426.5600000000001 - date - 2009-06-01T04:00:00Z - high - 429.6 - low - 418.53 - open - 418.73 - volume - 3322400 - - - adjClose - 417.23 - close - 417.23 - date - 2009-05-29T04:00:00Z - high - 417.23 - low - 410.7 - open - 412.11 - volume - 2648200 - - - adjClose - 410.4 - close - 410.4 - date - 2009-05-28T04:00:00Z - high - 411.62 - low - 404.61 - open - 408.68 - volume - 2668800 - - - adjClose - 405.56 - close - 405.56 - date - 2009-05-27T04:00:00Z - high - 411.86 - low - 404.81 - open - 405.64 - volume - 3034300 - - - adjClose - 404.36 - close - 404.36 - date - 2009-05-26T04:00:00Z - high - 405 - low - 390 - open - 391.95 - volume - 3104500 - - - adjClose - 393.5 - close - 393.5 - date - 2009-05-22T04:00:00Z - high - 398.65 - low - 392 - open - 396.66 - volume - 1718600 - - - adjClose - 396.5 - close - 396.5 - date - 2009-05-21T04:00:00Z - high - 402.84 - low - 393.84 - open - 396.3 - volume - 2719800 - - - adjClose - 397.18 - close - 397.18 - date - 2009-05-20T04:00:00Z - high - 405.67 - low - 395 - open - 402.09 - volume - 2284000 - - - adjClose - 398.88 - close - 398.88 - date - 2009-05-19T04:00:00Z - high - 401.64 - low - 393 - open - 396.1 - volume - 2837500 - - - adjClose - 396.84 - close - 396.84 - date - 2009-05-18T04:00:00Z - high - 397.31 - low - 385.4 - open - 394.73 - volume - 3351700 - - - adjClose - 390 - close - 390 - date - 2009-05-15T04:00:00Z - high - 394.11 - low - 389.09 - open - 391.1 - volume - 3008700 - - - adjClose - 387.5 - close - 387.5 - date - 2009-05-14T04:00:00Z - high - 392.21 - low - 384.69 - open - 388.8 - volume - 2937000 - - - adjClose - 389.54 - close - 389.54 - date - 2009-05-13T04:00:00Z - high - 396.39 - low - 388.35 - open - 394.09 - volume - 2842800 - - - adjClose - 399.01 - close - 399.01 - date - 2009-05-12T04:00:00Z - high - 410.99 - low - 395.11 - open - 410.01 - volume - 3790800 - - - adjClose - 407.98 - close - 407.98 - date - 2009-05-11T04:00:00Z - high - 412 - low - 401.2 - open - 402.8 - volume - 2559300 - - - adjClose - 407.33 - close - 407.33 - date - 2009-05-08T04:00:00Z - high - 410.13 - low - 395 - open - 402.85 - volume - 3865100 - - - adjClose - 396.61 - close - 396.61 - date - 2009-05-07T04:00:00Z - high - 404.99 - low - 392.5 - open - 404.1 - volume - 2999800 - - - adjClose - 403.47 - close - 403.47 - date - 2009-05-06T04:00:00Z - high - 408.28 - low - 401 - open - 406.79 - volume - 2632900 - - - adjClose - 402.99 - close - 402.99 - date - 2009-05-05T04:00:00Z - high - 405 - low - 397.25 - open - 399.98 - volume - 2400800 - - - adjClose - 401.98 - close - 401.98 - date - 2009-05-04T04:00:00Z - high - 402.4 - low - 394.79 - open - 398.17 - volume - 3203000 - - - adjClose - 393.69 - close - 393.69 - date - 2009-05-01T04:00:00Z - high - 397.59 - low - 391.55 - open - 395.03 - volume - 2427700 - - - adjClose - 395.97 - close - 395.97 - date - 2009-04-30T04:00:00Z - high - 403.75 - low - 394.8 - open - 395.76 - volume - 4355700 - - - adjClose - 391.47 - close - 391.47 - date - 2009-04-29T04:00:00Z - high - 394.97 - low - 385.83 - open - 385.97 - volume - 3610000 - - - adjClose - 383.71 - close - 383.71 - date - 2009-04-28T04:00:00Z - high - 389.05 - low - 381.54 - open - 383.75 - volume - 2943600 - - - adjClose - 385.95 - close - 385.95 - date - 2009-04-27T04:00:00Z - high - 389.49 - low - 382.75 - open - 384.34 - volume - 2290600 - - - adjClose - 389.49 - close - 389.49 - date - 2009-04-24T04:00:00Z - high - 393.18 - low - 380.5 - open - 386.05 - volume - 3385400 - - - adjClose - 384.69 - close - 384.69 - date - 2009-04-23T04:00:00Z - high - 389.75 - low - 381.11 - open - 387.51 - volume - 2609000 - - - adjClose - 383.86 - close - 383.86 - date - 2009-04-22T04:00:00Z - high - 390 - low - 379.01 - open - 381.75 - volume - 3501800 - - - adjClose - 381.47 - close - 381.47 - date - 2009-04-21T04:00:00Z - high - 384.3 - low - 376.1 - open - 376.17 - volume - 3695400 - - - adjClose - 379.3 - close - 379.3 - date - 2009-04-20T04:00:00Z - high - 390.65 - low - 375.89 - open - 386.15 - volume - 4428900 - - - adjClose - 392.24 - close - 392.24 - date - 2009-04-17T04:00:00Z - high - 399.82 - low - 384.81 - open - 386.02 - volume - 10730800 - - - adjClose - 388.74 - close - 388.74 - date - 2009-04-16T04:00:00Z - high - 392.9 - low - 381.02 - open - 381.5 - volume - 10185100 - - - adjClose - 379.5 - close - 379.5 - date - 2009-04-15T04:00:00Z - high - 381.06 - low - 364.16 - open - 367.1 - volume - 4930700 - - - adjClose - 368.91 - close - 368.91 - date - 2009-04-14T04:00:00Z - high - 376.99 - low - 365.6 - open - 376.94 - volume - 3428600 - - - adjClose - 378.11 - close - 378.11 - date - 2009-04-13T04:00:00Z - high - 379.1 - low - 370.3 - open - 371.33 - volume - 3050100 - - - adjClose - 372.5 - close - 372.5 - date - 2009-04-09T04:00:00Z - high - 374.35 - low - 366.25 - open - 369.5 - volume - 3382600 - - - adjClose - 362 - close - 362 - date - 2009-04-08T04:00:00Z - high - 365 - low - 356.21 - open - 363.5 - volume - 2765200 - - - adjClose - 358.65 - close - 358.65 - date - 2009-04-07T04:00:00Z - high - 363.75 - low - 355.31 - open - 362.6 - volume - 3680100 - - - adjClose - 368.24 - close - 368.24 - date - 2009-04-06T04:00:00Z - high - 369.82 - low - 361.4 - open - 367 - volume - 3280300 - - - adjClose - 369.78 - close - 369.78 - date - 2009-04-03T04:00:00Z - high - 371.72 - low - 358 - open - 364.5 - volume - 3789800 - - - adjClose - 362.5 - close - 362.5 - date - 2009-04-02T04:00:00Z - high - 369.76 - low - 360.32 - open - 363.31 - volume - 4488000 - - - adjClose - 354.09 - close - 354.09 - date - 2009-04-01T04:00:00Z - high - 355.24 - low - 340.61 - open - 343.78 - volume - 3301200 - - - adjClose - 348.06 - close - 348.06 - date - 2009-03-31T04:00:00Z - high - 353.51 - low - 346.18 - open - 348.93 - volume - 3655300 - - - adjClose - 342.69 - close - 342.69 - date - 2009-03-30T04:00:00Z - high - 343.81 - low - 336.05 - open - 342.55 - volume - 3094100 - - - adjClose - 347.7 - close - 347.7 - date - 2009-03-27T04:00:00Z - high - 352 - low - 345.47 - open - 350 - volume - 3322800 - - - adjClose - 353.29 - close - 353.29 - date - 2009-03-26T04:00:00Z - high - 359.16 - low - 348.5 - open - 353.13 - volume - 6003300 - - - adjClose - 344.07 - close - 344.07 - date - 2009-03-25T04:00:00Z - high - 351.34 - low - 336.25 - open - 350.4 - volume - 4336300 - - - adjClose - 347.17 - close - 347.17 - date - 2009-03-24T04:00:00Z - high - 353.84 - low - 344 - open - 346.5 - volume - 3820000 - - - adjClose - 348.6 - close - 348.6 - date - 2009-03-23T04:00:00Z - high - 349.45 - low - 333.03 - open - 333.56 - volume - 4271500 - - - adjClose - 330.16 - close - 330.16 - date - 2009-03-20T04:00:00Z - high - 332.99 - low - 326.34 - open - 330.3 - volume - 4737900 - - - adjClose - 329.94 - close - 329.94 - date - 2009-03-19T04:00:00Z - high - 336 - low - 327.38 - open - 331.68 - volume - 4111200 - - - adjClose - 333.1 - close - 333.1 - date - 2009-03-18T04:00:00Z - high - 340 - low - 328.05 - open - 334.81 - volume - 5012200 - - - adjClose - 335.34 - close - 335.34 - date - 2009-03-17T04:00:00Z - high - 335.34 - low - 319.09 - open - 320.18 - volume - 4712500 - - - adjClose - 319.69 - close - 319.69 - date - 2009-03-16T04:00:00Z - high - 329.73 - low - 318.59 - open - 325.99 - volume - 4946800 - - - adjClose - 324.42 - close - 324.42 - date - 2009-03-13T04:00:00Z - high - 327.46 - low - 319.03 - open - 326.1 - volume - 3906400 - - - overallHigh - 447.34 - overallLow - 318.59 - startDate - 2009-03-13T06:53:47Z - symbol - GOOG - - diff --git a/examples/StockPlot/Launch Screen.xib b/examples/StockPlot/Launch Screen.xib deleted file mode 100644 index a4454db08..000000000 --- a/examples/StockPlot/Launch Screen.xib +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/StockPlot/MSFT.plist b/examples/StockPlot/MSFT.plist deleted file mode 100644 index 5564f546f..000000000 --- a/examples/StockPlot/MSFT.plist +++ /dev/null @@ -1,1107 +0,0 @@ - - - - - endDate - 2009-06-19T06:53:47Z - financialData - - - adjClose - 23.5 - close - 23.5 - date - 2009-06-18T04:00:00Z - high - 23.69 - low - 23.3 - open - 23.62 - volume - 58825800 - - - adjClose - 23.68 - close - 23.68 - date - 2009-06-17T04:00:00Z - high - 23.82 - low - 23.17 - open - 23.5 - volume - 86463700 - - - adjClose - 23.45 - close - 23.45 - date - 2009-06-16T04:00:00Z - high - 24.11 - low - 23.44 - open - 23.47 - volume - 105284900 - - - adjClose - 23.42 - close - 23.42 - date - 2009-06-15T04:00:00Z - high - 23.54 - low - 23.02 - open - 23.23 - volume - 69074500 - - - adjClose - 23.33 - close - 23.33 - date - 2009-06-12T04:00:00Z - high - 23.38 - low - 22.74 - open - 22.9 - volume - 50951800 - - - adjClose - 22.83 - close - 22.83 - date - 2009-06-11T04:00:00Z - high - 23.26 - low - 22.57 - open - 22.59 - volume - 65124600 - - - adjClose - 22.55 - close - 22.55 - date - 2009-06-10T04:00:00Z - high - 22.62 - low - 22.12 - open - 22.17 - volume - 61202600 - - - adjClose - 22.08 - close - 22.08 - date - 2009-06-09T04:00:00Z - high - 22.32 - low - 21.88 - open - 22.06 - volume - 50852100 - - - adjClose - 22.05 - close - 22.05 - date - 2009-06-08T04:00:00Z - high - 22.32 - low - 21.63 - open - 21.98 - volume - 49000600 - - - adjClose - 22.14 - close - 22.14 - date - 2009-06-05T04:00:00Z - high - 22.31 - low - 21.81 - open - 21.96 - volume - 59579200 - - - adjClose - 21.83 - close - 21.83 - date - 2009-06-04T04:00:00Z - high - 21.9 - low - 21.58 - open - 21.77 - volume - 42330000 - - - adjClose - 21.73 - close - 21.73 - date - 2009-06-03T04:00:00Z - high - 21.76 - low - 21.29 - open - 21.31 - volume - 56039600 - - - adjClose - 21.4 - close - 21.4 - date - 2009-06-02T04:00:00Z - high - 21.98 - low - 21.2 - open - 21.36 - volume - 48935700 - - - adjClose - 21.4 - close - 21.4 - date - 2009-06-01T04:00:00Z - high - 21.5 - low - 20.86 - open - 21 - volume - 57317100 - - - adjClose - 20.89 - close - 20.89 - date - 2009-05-29T04:00:00Z - high - 20.94 - low - 20.3 - open - 20.56 - volume - 46134900 - - - adjClose - 20.45 - close - 20.45 - date - 2009-05-28T04:00:00Z - high - 20.63 - low - 20.05 - open - 20.32 - volume - 45480800 - - - adjClose - 20.13 - close - 20.13 - date - 2009-05-27T04:00:00Z - high - 20.6 - low - 20.07 - open - 20.25 - volume - 42892900 - - - adjClose - 20.34 - close - 20.34 - date - 2009-05-26T04:00:00Z - high - 20.45 - low - 19.45 - open - 19.54 - volume - 44991700 - - - adjClose - 19.75 - close - 19.75 - date - 2009-05-22T04:00:00Z - high - 20.17 - low - 19.47 - open - 19.93 - volume - 37318700 - - - adjClose - 19.82 - close - 19.82 - date - 2009-05-21T04:00:00Z - high - 20.23 - low - 19.51 - open - 20.14 - volume - 58232800 - - - adjClose - 20.38 - close - 20.38 - date - 2009-05-20T04:00:00Z - high - 20.69 - low - 20.22 - open - 20.41 - volume - 47450700 - - - adjClose - 20.31 - close - 20.31 - date - 2009-05-19T04:00:00Z - high - 20.74 - low - 20.25 - open - 20.51 - volume - 51368300 - - - adjClose - 20.47 - close - 20.6 - date - 2009-05-18T04:00:00Z - high - 20.6 - low - 20.24 - open - 20.36 - volume - 46073800 - - - adjClose - 20.09 - close - 20.22 - date - 2009-05-15T04:00:00Z - high - 20.5 - low - 19.98 - open - 20.13 - volume - 61289900 - - - adjClose - 19.93 - close - 20.06 - date - 2009-05-14T04:00:00Z - high - 20.23 - low - 19.8 - open - 19.83 - volume - 54539500 - - - adjClose - 19.63 - close - 19.75 - date - 2009-05-13T04:00:00Z - high - 20 - low - 19.67 - open - 19.92 - volume - 49281700 - - - adjClose - 19.76 - close - 19.89 - date - 2009-05-12T04:00:00Z - high - 20.06 - low - 19.47 - open - 19.51 - volume - 71966800 - - - adjClose - 19.2 - close - 19.32 - date - 2009-05-11T04:00:00Z - high - 19.73 - low - 19.01 - open - 19.2 - volume - 63762600 - - - adjClose - 19.3 - close - 19.42 - date - 2009-05-08T04:00:00Z - high - 19.64 - low - 19.14 - open - 19.46 - volume - 67597600 - - - adjClose - 19.2 - close - 19.32 - date - 2009-05-07T04:00:00Z - high - 19.99 - low - 19.14 - open - 19.96 - volume - 68727200 - - - adjClose - 19.67 - close - 19.79 - date - 2009-05-06T04:00:00Z - high - 20.07 - low - 19.61 - open - 20.06 - volume - 59639100 - - - adjClose - 19.67 - close - 19.79 - date - 2009-05-05T04:00:00Z - high - 20.24 - low - 19.64 - open - 20.14 - volume - 66835500 - - - adjClose - 20.06 - close - 20.19 - date - 2009-05-04T04:00:00Z - high - 20.4 - low - 19.98 - open - 20.37 - volume - 54313400 - - - adjClose - 20.11 - close - 20.24 - date - 2009-05-01T04:00:00Z - high - 20.35 - low - 19.86 - open - 20.19 - volume - 63224500 - - - adjClose - 20.13 - close - 20.26 - date - 2009-04-30T04:00:00Z - high - 21.1 - low - 20.01 - open - 20.6 - volume - 87439900 - - - adjClose - 20.12 - close - 20.25 - date - 2009-04-29T04:00:00Z - high - 20.89 - low - 20.06 - open - 20.11 - volume - 79301600 - - - adjClose - 19.8 - close - 19.93 - date - 2009-04-28T04:00:00Z - high - 20.27 - low - 19.79 - open - 20.25 - volume - 76685200 - - - adjClose - 20.27 - close - 20.4 - date - 2009-04-27T04:00:00Z - high - 20.82 - low - 20.28 - open - 20.55 - volume - 68219600 - - - adjClose - 20.78 - close - 20.91 - date - 2009-04-24T04:00:00Z - high - 21.2 - low - 19.5 - open - 19.82 - volume - 168478500 - - - adjClose - 18.8 - close - 18.92 - date - 2009-04-23T04:00:00Z - high - 18.94 - low - 18.47 - open - 18.92 - volume - 86116300 - - - adjClose - 18.66 - close - 18.78 - date - 2009-04-22T04:00:00Z - high - 19.19 - low - 18.7 - open - 18.76 - volume - 59401000 - - - adjClose - 18.85 - close - 18.97 - date - 2009-04-21T04:00:00Z - high - 19.08 - low - 18.57 - open - 18.59 - volume - 60928300 - - - adjClose - 18.49 - close - 18.61 - date - 2009-04-20T04:00:00Z - high - 18.95 - low - 18.57 - open - 18.89 - volume - 62937200 - - - adjClose - 19.08 - close - 19.2 - date - 2009-04-17T04:00:00Z - high - 19.69 - low - 19 - open - 19.69 - volume - 61398500 - - - adjClose - 19.64 - close - 19.76 - date - 2009-04-16T04:00:00Z - high - 19.78 - low - 18.99 - open - 19.16 - volume - 67688700 - - - adjClose - 18.71 - close - 18.83 - date - 2009-04-15T04:00:00Z - high - 19.25 - low - 18.51 - open - 19.21 - volume - 72725500 - - - adjClose - 19.23 - close - 19.35 - date - 2009-04-14T04:00:00Z - high - 19.55 - low - 19 - open - 19.44 - volume - 63796300 - - - adjClose - 19.47 - close - 19.59 - date - 2009-04-13T04:00:00Z - high - 19.85 - low - 19.37 - open - 19.69 - volume - 44444700 - - - adjClose - 19.55 - close - 19.67 - date - 2009-04-09T04:00:00Z - high - 19.7 - low - 19.22 - open - 19.45 - volume - 55759600 - - - adjClose - 19.07 - close - 19.19 - date - 2009-04-08T04:00:00Z - high - 19.62 - low - 18.96 - open - 18.97 - volume - 56408900 - - - adjClose - 18.64 - close - 18.76 - date - 2009-04-07T04:00:00Z - high - 19.14 - low - 18.63 - open - 18.76 - volume - 65815200 - - - adjClose - 18.64 - close - 18.76 - date - 2009-04-06T04:00:00Z - high - 18.76 - low - 18.27 - open - 18.54 - volume - 47476100 - - - adjClose - 18.63 - close - 18.75 - date - 2009-04-03T04:00:00Z - high - 19.15 - low - 18.43 - open - 19.13 - volume - 81858400 - - - adjClose - 19.17 - close - 19.29 - date - 2009-04-02T04:00:00Z - high - 19.89 - low - 19 - open - 19.5 - volume - 99082300 - - - adjClose - 19.19 - close - 19.31 - date - 2009-04-01T04:00:00Z - high - 19.36 - low - 18.18 - open - 18.23 - volume - 96438900 - - - adjClose - 18.25 - close - 18.37 - date - 2009-03-31T04:00:00Z - high - 18.79 - low - 17.78 - open - 17.83 - volume - 92095500 - - - adjClose - 17.37 - close - 17.48 - date - 2009-03-30T04:00:00Z - high - 17.76 - low - 17.27 - open - 17.74 - volume - 49633000 - - - adjClose - 18.02 - close - 18.13 - date - 2009-03-27T04:00:00Z - high - 18.62 - low - 18.05 - open - 18.54 - volume - 47670400 - - - adjClose - 18.71 - close - 18.83 - date - 2009-03-26T04:00:00Z - high - 18.88 - low - 18.12 - open - 18.17 - volume - 63775100 - - - adjClose - 17.77 - close - 17.88 - date - 2009-03-25T04:00:00Z - high - 18.31 - low - 17.52 - open - 17.98 - volume - 73927100 - - - adjClose - 17.82 - close - 17.93 - date - 2009-03-24T04:00:00Z - high - 18.21 - low - 17.84 - open - 18.04 - volume - 50044100 - - - adjClose - 18.21 - close - 18.33 - date - 2009-03-23T04:00:00Z - high - 18.59 - low - 17.31 - open - 17.37 - volume - 71600000 - - - adjClose - 16.95 - close - 17.06 - date - 2009-03-20T04:00:00Z - high - 17.65 - low - 16.88 - open - 17.32 - volume - 81725500 - - - adjClose - 17.03 - close - 17.14 - date - 2009-03-19T04:00:00Z - high - 17.45 - low - 16.92 - open - 17.37 - volume - 58994600 - - - adjClose - 16.85 - close - 16.96 - date - 2009-03-18T04:00:00Z - high - 17.22 - low - 16.6 - open - 17.03 - volume - 70710700 - - - adjClose - 16.79 - close - 16.9 - date - 2009-03-17T04:00:00Z - high - 16.9 - low - 16.26 - open - 16.32 - volume - 62481000 - - - adjClose - 16.15 - close - 16.25 - date - 2009-03-16T04:00:00Z - high - 16.96 - low - 16.24 - open - 16.82 - volume - 67028900 - - - adjClose - 16.54 - close - 16.65 - date - 2009-03-13T04:00:00Z - high - 17.05 - low - 16.18 - open - 16.98 - volume - 82965800 - - - overallHigh - 24.11 - overallLow - 16.18 - startDate - 2009-03-13T06:53:47Z - symbol - MSFT - - diff --git a/examples/StockPlot/MainWindow.xib b/examples/StockPlot/MainWindow.xib deleted file mode 100644 index ddc52b78a..000000000 --- a/examples/StockPlot/MainWindow.xib +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/StockPlot/RootViewController.xib b/examples/StockPlot/RootViewController.xib deleted file mode 100644 index 046950821..000000000 --- a/examples/StockPlot/RootViewController.xib +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/StockPlot/StockPlot-Info.plist b/examples/StockPlot/StockPlot-Info.plist deleted file mode 100644 index 1d8d9b7be..000000000 --- a/examples/StockPlot/StockPlot-Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIcons~ipad - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - NSMainNibFile - MainWindow - UILaunchStoryboardName - Launch Screen - UIStatusBarStyle - UIStatusBarStyleDefault - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationPortraitUpsideDown - - - diff --git a/examples/StockPlot/StockPlot.png b/examples/StockPlot/StockPlot.png deleted file mode 100644 index 8c1c5ca30..000000000 Binary files a/examples/StockPlot/StockPlot.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot.xcodeproj/project.pbxproj b/examples/StockPlot/StockPlot.xcodeproj/project.pbxproj deleted file mode 100644 index 759fa8d7b..000000000 --- a/examples/StockPlot/StockPlot.xcodeproj/project.pbxproj +++ /dev/null @@ -1,470 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 47; - objects = { - -/* Begin PBXBuildFile section */ - 1D3623260D0F684500981E51 /* StockPlotAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* StockPlotAppDelegate.m */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; }; - 2899E5600DE3E45000AC0155 /* RootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E55F0DE3E45000AC0155 /* RootViewController.xib */; }; - 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD735F0D9D9599002E5188 /* MainWindow.xib */; }; - 28C286E10D94DF7D0034E888 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28C286E00D94DF7D0034E888 /* RootViewController.m */; }; - AB0363AA0FEF3681007B09A9 /* YHOO.plist in Resources */ = {isa = PBXBuildFile; fileRef = AB6FA6090FEB6DAA008DB04A /* YHOO.plist */; }; - AB0363AB0FEF3684007B09A9 /* MSFT.plist in Resources */ = {isa = PBXBuildFile; fileRef = AB6FA60A0FEB6DAA008DB04A /* MSFT.plist */; }; - AB0363AC0FEF3687007B09A9 /* GOOG.plist in Resources */ = {isa = PBXBuildFile; fileRef = AB6FA60B0FEB6DAA008DB04A /* GOOG.plist */; }; - AB0363AD0FEF368A007B09A9 /* AAPL.plist in Resources */ = {isa = PBXBuildFile; fileRef = AB6FA60C0FEB6DAA008DB04A /* AAPL.plist */; }; - AB0364770FEF4603007B09A9 /* caution.png in Resources */ = {isa = PBXBuildFile; fileRef = AB0364760FEF4603007B09A9 /* caution.png */; }; - AB4913C80FECC2B8008A08AB /* APYahooDataPuller.m in Sources */ = {isa = PBXBuildFile; fileRef = AB4913C60FECC2B8008A08AB /* APYahooDataPuller.m */; }; - AB4913C90FECC2B8008A08AB /* NSDictionary+APFinancialData.m in Sources */ = {isa = PBXBuildFile; fileRef = AB4913C70FECC2B8008A08AB /* NSDictionary+APFinancialData.m */; }; - AB6FA4A40FEB579B008DB04A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB6FA4A30FEB579B008DB04A /* QuartzCore.framework */; }; - AB6FA5590FEB6235008DB04A /* APYahooDataPullerGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = AB6FA5570FEB6235008DB04A /* APYahooDataPullerGraph.m */; }; - AB6FA55A0FEB6235008DB04A /* APYahooDataPullerGraph.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB6FA5580FEB6235008DB04A /* APYahooDataPullerGraph.xib */; }; - C36157E919D79AAC0036ACDA /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C36157E819D79AAC0036ACDA /* Launch Screen.xib */; }; - C3CD284817DE9D1F008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD284717DE9D1F008EED1E /* Accelerate.framework */; }; - C3D3937019FD6CBF00148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3936F19FD6CBF00148319 /* Images.xcassets */; }; - C3D414DF1A7D84CC00B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3D414DC1A7D84BF00B6F5D6 /* libCorePlot-CocoaTouch.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - C3D414D31A7D84BF00B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D414C71A7D84BF00B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 8DC2EF5B0486A6940098B216; - remoteInfo = CorePlot; - }; - C3D414D51A7D84BF00B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D414C71A7D84BF00B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 0730F600109492D800E95162; - remoteInfo = UnitTests; - }; - C3D414D71A7D84BF00B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D414C71A7D84BF00B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C38A09781A46185200D45436; - remoteInfo = CorePlot_iOS; - }; - C3D414D91A7D84BF00B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D414C71A7D84BF00B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C38A09821A46185300D45436; - remoteInfo = CorePlot_iOSTests; - }; - C3D414DB1A7D84BF00B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D414C71A7D84BF00B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C38A09BA1A4619A900D45436; - remoteInfo = "CorePlot-CocoaTouch"; - }; - C3D414DD1A7D84BF00B6F5D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C3D414C71A7D84BF00B6F5D6 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C38A09C41A4619A900D45436; - remoteInfo = "CorePlot-CocoaTouchTests"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D3623240D0F684500981E51 /* StockPlotAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StockPlotAppDelegate.h; sourceTree = ""; }; - 1D3623250D0F684500981E51 /* StockPlotAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StockPlotAppDelegate.m; sourceTree = ""; }; - 1D6058910D05DD3D006BFB54 /* StockPlot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StockPlot.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 2899E55F0DE3E45000AC0155 /* RootViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RootViewController.xib; sourceTree = ""; }; - 28A0AAE50D9B0CCF005BE974 /* StockPlot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StockPlot_Prefix.pch; sourceTree = ""; }; - 28AD735F0D9D9599002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; - 28C286DF0D94DF7D0034E888 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; - 28C286E00D94DF7D0034E888 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* StockPlot-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "StockPlot-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; - AB0364760FEF4603007B09A9 /* caution.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = caution.png; sourceTree = SOURCE_ROOT; }; - AB4913C50FECC2B8008A08AB /* APYahooDataPuller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = APYahooDataPuller.h; path = Classes/APYahooDataPuller.h; sourceTree = SOURCE_ROOT; }; - AB4913C60FECC2B8008A08AB /* APYahooDataPuller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = APYahooDataPuller.m; path = Classes/APYahooDataPuller.m; sourceTree = SOURCE_ROOT; }; - AB4913C70FECC2B8008A08AB /* NSDictionary+APFinancialData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDictionary+APFinancialData.m"; path = "Classes/NSDictionary+APFinancialData.m"; sourceTree = SOURCE_ROOT; }; - AB6FA4A30FEB579B008DB04A /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - AB6FA4DE0FEB59DB008DB04A /* NSDictionary+APFinancialData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+APFinancialData.h"; sourceTree = ""; }; - AB6FA5560FEB6235008DB04A /* APYahooDataPullerGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = APYahooDataPullerGraph.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - AB6FA5570FEB6235008DB04A /* APYahooDataPullerGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = APYahooDataPullerGraph.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - AB6FA5580FEB6235008DB04A /* APYahooDataPullerGraph.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = APYahooDataPullerGraph.xib; path = Classes/APYahooDataPullerGraph.xib; sourceTree = ""; }; - AB6FA6090FEB6DAA008DB04A /* YHOO.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = YHOO.plist; sourceTree = SOURCE_ROOT; }; - AB6FA60A0FEB6DAA008DB04A /* MSFT.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = MSFT.plist; sourceTree = SOURCE_ROOT; }; - AB6FA60B0FEB6DAA008DB04A /* GOOG.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = GOOG.plist; sourceTree = SOURCE_ROOT; }; - AB6FA60C0FEB6DAA008DB04A /* AAPL.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = AAPL.plist; sourceTree = SOURCE_ROOT; }; - C36157E819D79AAC0036ACDA /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; }; - C3CA9B5B19E203B2008DF7A3 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; - C3CD284717DE9D1F008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - C3D3936F19FD6CBF00148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = StockPlot/Images.xcassets; sourceTree = ""; }; - C3D414C71A7D84BF00B6F5D6 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, - 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */, - AB6FA4A40FEB579B008DB04A /* QuartzCore.framework in Frameworks */, - C3CD284817DE9D1F008EED1E /* Accelerate.framework in Frameworks */, - C3D414DF1A7D84CC00B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - AB4913C50FECC2B8008A08AB /* APYahooDataPuller.h */, - AB4913C60FECC2B8008A08AB /* APYahooDataPuller.m */, - AB6FA4DE0FEB59DB008DB04A /* NSDictionary+APFinancialData.h */, - AB4913C70FECC2B8008A08AB /* NSDictionary+APFinancialData.m */, - 28C286DF0D94DF7D0034E888 /* RootViewController.h */, - 28C286E00D94DF7D0034E888 /* RootViewController.m */, - 1D3623240D0F684500981E51 /* StockPlotAppDelegate.h */, - 1D3623250D0F684500981E51 /* StockPlotAppDelegate.m */, - AB6FA5560FEB6235008DB04A /* APYahooDataPullerGraph.h */, - AB6FA5570FEB6235008DB04A /* APYahooDataPullerGraph.m */, - ); - path = Classes; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* StockPlot.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - C3D414C71A7D84BF00B6F5D6 /* CorePlot.xcodeproj */, - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - indentWidth = 4; - name = CustomTemplate; - sourceTree = ""; - tabWidth = 4; - usesTabs = 0; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 28A0AAE50D9B0CCF005BE974 /* StockPlot_Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - C3CA9B5B19E203B2008DF7A3 /* CorePlotWarnings.xcconfig */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - C3D3936F19FD6CBF00148319 /* Images.xcassets */, - AB0364760FEF4603007B09A9 /* caution.png */, - AB6FA6090FEB6DAA008DB04A /* YHOO.plist */, - AB6FA60A0FEB6DAA008DB04A /* MSFT.plist */, - AB6FA60B0FEB6DAA008DB04A /* GOOG.plist */, - AB6FA60C0FEB6DAA008DB04A /* AAPL.plist */, - AB6FA5580FEB6235008DB04A /* APYahooDataPullerGraph.xib */, - 2899E55F0DE3E45000AC0155 /* RootViewController.xib */, - 28AD735F0D9D9599002E5188 /* MainWindow.xib */, - 8D1107310486CEB800E47090 /* StockPlot-Info.plist */, - C36157E819D79AAC0036ACDA /* Launch Screen.xib */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, - 1D30AB110D05D00D00671497 /* Foundation.framework */, - 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */, - AB6FA4A30FEB579B008DB04A /* QuartzCore.framework */, - C3CD284717DE9D1F008EED1E /* Accelerate.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - C3D414C81A7D84BF00B6F5D6 /* Products */ = { - isa = PBXGroup; - children = ( - C3D414D41A7D84BF00B6F5D6 /* CorePlot.framework */, - C3D414D61A7D84BF00B6F5D6 /* UnitTests.xctest */, - C3D414D81A7D84BF00B6F5D6 /* CorePlot.framework */, - C3D414DA1A7D84BF00B6F5D6 /* UnitTests iOS.xctest */, - C3D414DC1A7D84BF00B6F5D6 /* libCorePlot-CocoaTouch.a */, - C3D414DE1A7D84BF00B6F5D6 /* CorePlot-CocoaTouchTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* StockPlot */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "StockPlot" */; - buildPhases = ( - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = StockPlot; - productName = StockPlot; - productReference = 1D6058910D05DD3D006BFB54 /* StockPlot.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0700; - TargetAttributes = { - 1D6058900D05DD3D006BFB54 = { - DevelopmentTeam = 28ZA45DE7D; - }; - }; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "StockPlot" */; - compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - en, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = C3D414C81A7D84BF00B6F5D6 /* Products */; - ProjectRef = C3D414C71A7D84BF00B6F5D6 /* CorePlot.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* StockPlot */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - C3D414D41A7D84BF00B6F5D6 /* CorePlot.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = CorePlot.framework; - remoteRef = C3D414D31A7D84BF00B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C3D414D61A7D84BF00B6F5D6 /* UnitTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = UnitTests.xctest; - remoteRef = C3D414D51A7D84BF00B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C3D414D81A7D84BF00B6F5D6 /* CorePlot.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = CorePlot.framework; - remoteRef = C3D414D71A7D84BF00B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C3D414DA1A7D84BF00B6F5D6 /* UnitTests iOS.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "UnitTests iOS.xctest"; - remoteRef = C3D414D91A7D84BF00B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C3D414DC1A7D84BF00B6F5D6 /* libCorePlot-CocoaTouch.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libCorePlot-CocoaTouch.a"; - remoteRef = C3D414DB1A7D84BF00B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C3D414DE1A7D84BF00B6F5D6 /* CorePlot-CocoaTouchTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "CorePlot-CocoaTouchTests.xctest"; - remoteRef = C3D414DD1A7D84BF00B6F5D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */, - 2899E5600DE3E45000AC0155 /* RootViewController.xib in Resources */, - AB6FA55A0FEB6235008DB04A /* APYahooDataPullerGraph.xib in Resources */, - AB0363AA0FEF3681007B09A9 /* YHOO.plist in Resources */, - C3D3937019FD6CBF00148319 /* Images.xcassets in Resources */, - AB0363AB0FEF3684007B09A9 /* MSFT.plist in Resources */, - AB0363AC0FEF3687007B09A9 /* GOOG.plist in Resources */, - AB0363AD0FEF368A007B09A9 /* AAPL.plist in Resources */, - AB0364770FEF4603007B09A9 /* caution.png in Resources */, - C36157E919D79AAC0036ACDA /* Launch Screen.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 1D3623260D0F684500981E51 /* StockPlotAppDelegate.m in Sources */, - 28C286E10D94DF7D0034E888 /* RootViewController.m in Sources */, - AB6FA5590FEB6235008DB04A /* APYahooDataPullerGraph.m in Sources */, - AB4913C80FECC2B8008A08AB /* APYahooDataPuller.m in Sources */, - AB4913C90FECC2B8008A08AB /* NSDictionary+APFinancialData.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3CA9B5B19E203B2008DF7A3 /* CorePlotWarnings.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = StockPlot_Prefix.pch; - HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = "StockPlot-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; - PRODUCT_NAME = StockPlot; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3CA9B5B19E203B2008DF7A3 /* CorePlotWarnings.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - COPY_PHASE_STRIP = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = StockPlot_Prefix.pch; - HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = "StockPlot-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; - PRODUCT_NAME = StockPlot; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - SDKROOT = iphoneos; - SYMROOT = "$(SRCROOT)/../../build"; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - SDKROOT = iphoneos; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "StockPlot" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "StockPlot" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/examples/StockPlot/StockPlot.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/StockPlot/StockPlot.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 3318309c7..000000000 --- a/examples/StockPlot/StockPlot.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 340f2376e..000000000 --- a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "images" : [ - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-Spotlight-40@2x.png", - "scale" : "2x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png deleted file mode 100644 index 5ce9f6593..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png deleted file mode 100644 index 0786734de..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small.png deleted file mode 100644 index a40598c34..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png deleted file mode 100644 index e4b5c2785..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png deleted file mode 100644 index 390cd034f..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon.png deleted file mode 100644 index ac669215a..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon@2x.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon@2x.png deleted file mode 100644 index dd7353607..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon@2x.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/LaunchImage.launchimage/Contents.json b/examples/StockPlot/StockPlot/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index e6c8ec6a6..000000000 --- a/examples/StockPlot/StockPlot/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "8.0", - "subtype" : "736h", - "scale" : "3x" - }, - { - "orientation" : "landscape", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "8.0", - "subtype" : "736h", - "scale" : "3x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "8.0", - "subtype" : "667h", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "subtype" : "retina4", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/StockPlot/StockPlot_Prefix.pch b/examples/StockPlot/StockPlot_Prefix.pch deleted file mode 100644 index d6179e313..000000000 --- a/examples/StockPlot/StockPlot_Prefix.pch +++ /dev/null @@ -1,14 +0,0 @@ -// -// Prefix header for all source files of the 'StockPlot' target in the 'StockPlot' project -// -#import - -#ifndef __IPHONE_3_0 -#warning "This project uses features only available in iPhone SDK 3.0 and later." -#endif - - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/examples/StockPlot/YHOO.plist b/examples/StockPlot/YHOO.plist deleted file mode 100644 index 08a118eac..000000000 --- a/examples/StockPlot/YHOO.plist +++ /dev/null @@ -1,1107 +0,0 @@ - - - - - endDate - 2009-06-19T06:53:47Z - financialData - - - adjClose - 15.34 - close - 15.34 - date - 2009-06-18T04:00:00Z - high - 15.64 - low - 15.23 - open - 15.62 - volume - 16185400 - - - adjClose - 15.6 - close - 15.6 - date - 2009-06-17T04:00:00Z - high - 16.03 - low - 15.46 - open - 15.91 - volume - 16159600 - - - adjClose - 15.96 - close - 15.96 - date - 2009-06-16T04:00:00Z - high - 16.38 - low - 15.9 - open - 16.33 - volume - 15116000 - - - adjClose - 16.4 - close - 16.4 - date - 2009-06-15T04:00:00Z - high - 16.68 - low - 16.13 - open - 16.56 - volume - 23251700 - - - adjClose - 16.4 - close - 16.4 - date - 2009-06-12T04:00:00Z - high - 16.47 - low - 16.1 - open - 16.17 - volume - 16962900 - - - adjClose - 16.19 - close - 16.19 - date - 2009-06-11T04:00:00Z - high - 16.46 - low - 16.15 - open - 16.26 - volume - 14787400 - - - adjClose - 16.32 - close - 16.32 - date - 2009-06-10T04:00:00Z - high - 16.72 - low - 16.1 - open - 16.7 - volume - 15761000 - - - adjClose - 16.4 - close - 16.4 - date - 2009-06-09T04:00:00Z - high - 16.5 - low - 16.18 - open - 16.23 - volume - 13083200 - - - adjClose - 16.19 - close - 16.19 - date - 2009-06-08T04:00:00Z - high - 16.49 - low - 16.04 - open - 16.47 - volume - 13680700 - - - adjClose - 16.64 - close - 16.64 - date - 2009-06-05T04:00:00Z - high - 16.99 - low - 16.3 - open - 16.77 - volume - 17311400 - - - adjClose - 16.65 - close - 16.65 - date - 2009-06-04T04:00:00Z - high - 16.71 - low - 16.04 - open - 16.4 - volume - 19001400 - - - adjClose - 16.3 - close - 16.3 - date - 2009-06-03T04:00:00Z - high - 16.5 - low - 15.67 - open - 16.5 - volume - 26358100 - - - adjClose - 16.62 - close - 16.62 - date - 2009-06-02T04:00:00Z - high - 16.75 - low - 16.25 - open - 16.6 - volume - 15286700 - - - adjClose - 16.58 - close - 16.58 - date - 2009-06-01T04:00:00Z - high - 16.65 - low - 16.13 - open - 16.17 - volume - 27926100 - - - adjClose - 15.84 - close - 15.84 - date - 2009-05-29T04:00:00Z - high - 15.84 - low - 15.11 - open - 15.19 - volume - 29557500 - - - adjClose - 15.09 - close - 15.09 - date - 2009-05-28T04:00:00Z - high - 15.24 - low - 14.69 - open - 15.09 - volume - 19131600 - - - adjClose - 14.94 - close - 14.94 - date - 2009-05-27T04:00:00Z - high - 15.53 - low - 14.88 - open - 15.27 - volume - 18977400 - - - adjClose - 15.28 - close - 15.28 - date - 2009-05-26T04:00:00Z - high - 15.44 - low - 14.67 - open - 14.68 - volume - 19953000 - - - adjClose - 14.98 - close - 14.98 - date - 2009-05-22T04:00:00Z - high - 15.17 - low - 14.75 - open - 14.89 - volume - 19150500 - - - adjClose - 14.87 - close - 14.87 - date - 2009-05-21T04:00:00Z - high - 15.12 - low - 14.62 - open - 14.92 - volume - 15186800 - - - adjClose - 14.96 - close - 14.96 - date - 2009-05-20T04:00:00Z - high - 15.31 - low - 14.8 - open - 15.08 - volume - 15781600 - - - adjClose - 15.18 - close - 15.18 - date - 2009-05-19T04:00:00Z - high - 15.34 - low - 15.02 - open - 15.06 - volume - 13676000 - - - adjClose - 15.17 - close - 15.17 - date - 2009-05-18T04:00:00Z - high - 15.18 - low - 14.74 - open - 15.1 - volume - 18629500 - - - adjClose - 14.91 - close - 14.91 - date - 2009-05-15T04:00:00Z - high - 15.1 - low - 14.86 - open - 15 - volume - 22525900 - - - adjClose - 14.76 - close - 14.76 - date - 2009-05-14T04:00:00Z - high - 14.86 - low - 14.4 - open - 14.5 - volume - 20841800 - - - adjClose - 14.52 - close - 14.52 - date - 2009-05-13T04:00:00Z - high - 14.95 - low - 14.5 - open - 14.92 - volume - 23585400 - - - adjClose - 15.1 - close - 15.1 - date - 2009-05-12T04:00:00Z - high - 15.5 - low - 14.9 - open - 15.5 - volume - 31403300 - - - adjClose - 15.54 - close - 15.54 - date - 2009-05-11T04:00:00Z - high - 15.83 - low - 14.81 - open - 14.9 - volume - 39492400 - - - adjClose - 15.15 - close - 15.15 - date - 2009-05-08T04:00:00Z - high - 15.3 - low - 14.7 - open - 14.88 - volume - 22461200 - - - adjClose - 14.8 - close - 14.8 - date - 2009-05-07T04:00:00Z - high - 15.1 - low - 14.38 - open - 15.03 - volume - 24328500 - - - adjClose - 14.85 - close - 14.85 - date - 2009-05-06T04:00:00Z - high - 15 - low - 14.52 - open - 14.8 - volume - 19105800 - - - adjClose - 14.74 - close - 14.74 - date - 2009-05-05T04:00:00Z - high - 14.99 - low - 14.18 - open - 14.55 - volume - 35233200 - - - adjClose - 14.18 - close - 14.18 - date - 2009-05-04T04:00:00Z - high - 14.25 - low - 13.96 - open - 14.2 - volume - 25094600 - - - adjClose - 14.14 - close - 14.14 - date - 2009-05-01T04:00:00Z - high - 14.5 - low - 13.91 - open - 14.5 - volume - 23721700 - - - adjClose - 14.29 - close - 14.29 - date - 2009-04-30T04:00:00Z - high - 14.6 - low - 14.12 - open - 14.12 - volume - 25883300 - - - adjClose - 14.02 - close - 14.02 - date - 2009-04-29T04:00:00Z - high - 14.35 - low - 13.7 - open - 13.7 - volume - 16570900 - - - adjClose - 13.64 - close - 13.64 - date - 2009-04-28T04:00:00Z - high - 14.05 - low - 13.6 - open - 13.74 - volume - 18856500 - - - adjClose - 13.89 - close - 13.89 - date - 2009-04-27T04:00:00Z - high - 14.55 - low - 13.88 - open - 14.48 - volume - 22640600 - - - adjClose - 14.73 - close - 14.73 - date - 2009-04-24T04:00:00Z - high - 14.94 - low - 14.36 - open - 14.79 - volume - 25803000 - - - adjClose - 14.55 - close - 14.55 - date - 2009-04-23T04:00:00Z - high - 14.74 - low - 14.11 - open - 14.56 - volume - 32943200 - - - adjClose - 14.48 - close - 14.48 - date - 2009-04-22T04:00:00Z - high - 15.39 - low - 14.41 - open - 14.62 - volume - 65407800 - - - adjClose - 14.38 - close - 14.38 - date - 2009-04-21T04:00:00Z - high - 14.59 - low - 13.71 - open - 13.94 - volume - 54237700 - - - adjClose - 13.66 - close - 13.66 - date - 2009-04-20T04:00:00Z - high - 14.25 - low - 13.6 - open - 14.16 - volume - 13470500 - - - adjClose - 14.39 - close - 14.39 - date - 2009-04-17T04:00:00Z - high - 14.52 - low - 14.03 - open - 14.43 - volume - 19800400 - - - adjClose - 14.43 - close - 14.43 - date - 2009-04-16T04:00:00Z - high - 14.53 - low - 14.05 - open - 14.15 - volume - 19156500 - - - adjClose - 14.02 - close - 14.02 - date - 2009-04-15T04:00:00Z - high - 14.09 - low - 13.77 - open - 13.93 - volume - 12383200 - - - adjClose - 14.07 - close - 14.07 - date - 2009-04-14T04:00:00Z - high - 14.42 - low - 14 - open - 14.4 - volume - 15151700 - - - adjClose - 14.42 - close - 14.42 - date - 2009-04-13T04:00:00Z - high - 14.54 - low - 13.86 - open - 14.02 - volume - 35067600 - - - adjClose - 13.47 - close - 13.47 - date - 2009-04-09T04:00:00Z - high - 13.59 - low - 13.07 - open - 13.14 - volume - 17285800 - - - adjClose - 12.92 - close - 12.92 - date - 2009-04-08T04:00:00Z - high - 13.01 - low - 12.75 - open - 12.9 - volume - 11241000 - - - adjClose - 12.81 - close - 12.81 - date - 2009-04-07T04:00:00Z - high - 13.1 - low - 12.68 - open - 13 - volume - 12306400 - - - adjClose - 13.23 - close - 13.23 - date - 2009-04-06T04:00:00Z - high - 13.24 - low - 12.99 - open - 13.08 - volume - 11935700 - - - adjClose - 13.34 - close - 13.34 - date - 2009-04-03T04:00:00Z - high - 13.39 - low - 12.78 - open - 12.95 - volume - 18534900 - - - adjClose - 12.95 - close - 12.95 - date - 2009-04-02T04:00:00Z - high - 13.14 - low - 12.8 - open - 13.04 - volume - 28823100 - - - adjClose - 12.75 - close - 12.75 - date - 2009-04-01T04:00:00Z - high - 13.12 - low - 12.6 - open - 12.7 - volume - 14540400 - - - adjClose - 12.81 - close - 12.81 - date - 2009-03-31T04:00:00Z - high - 13.1 - low - 12.67 - open - 12.76 - volume - 11882100 - - - adjClose - 12.7 - close - 12.7 - date - 2009-03-30T04:00:00Z - high - 13.14 - low - 12.51 - open - 12.93 - volume - 16558800 - - - adjClose - 13.18 - close - 13.18 - date - 2009-03-27T04:00:00Z - high - 13.61 - low - 13.12 - open - 13.17 - volume - 22426200 - - - adjClose - 13.35 - close - 13.35 - date - 2009-03-26T04:00:00Z - high - 13.61 - low - 13 - open - 13.55 - volume - 24223400 - - - adjClose - 13.55 - close - 13.55 - date - 2009-03-25T04:00:00Z - high - 13.88 - low - 13.35 - open - 13.69 - volume - 16746400 - - - adjClose - 13.63 - close - 13.63 - date - 2009-03-24T04:00:00Z - high - 14.02 - low - 13.56 - open - 13.98 - volume - 17293600 - - - adjClose - 14.09 - close - 14.09 - date - 2009-03-23T04:00:00Z - high - 14.12 - low - 13.62 - open - 13.79 - volume - 18200000 - - - adjClose - 13.6 - close - 13.6 - date - 2009-03-20T04:00:00Z - high - 13.87 - low - 13.51 - open - 13.63 - volume - 22079300 - - - adjClose - 13.74 - close - 13.74 - date - 2009-03-19T04:00:00Z - high - 14.14 - low - 13.61 - open - 13.68 - volume - 25954300 - - - adjClose - 13.42 - close - 13.42 - date - 2009-03-18T04:00:00Z - high - 13.95 - low - 13.23 - open - 13.81 - volume - 26324300 - - - adjClose - 13.99 - close - 13.99 - date - 2009-03-17T04:00:00Z - high - 14.04 - low - 13.22 - open - 13.35 - volume - 16719400 - - - adjClose - 13.22 - close - 13.22 - date - 2009-03-16T04:00:00Z - high - 13.66 - low - 13.2 - open - 13.66 - volume - 19448800 - - - adjClose - 13.51 - close - 13.51 - date - 2009-03-13T04:00:00Z - high - 13.64 - low - 13.27 - open - 13.58 - volume - 12522600 - - - overallHigh - 16.99 - overallLow - 12.51 - startDate - 2009-03-13T06:53:47Z - symbol - YHOO - - diff --git a/examples/StockPlot/caution.png b/examples/StockPlot/caution.png deleted file mode 100644 index ec4b70669..000000000 Binary files a/examples/StockPlot/caution.png and /dev/null differ diff --git a/examples/StockPlot/main.m b/examples/StockPlot/main.m deleted file mode 100644 index 3105528ad..000000000 --- a/examples/StockPlot/main.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// main.m -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - int retVal = UIApplicationMain(argc, argv, nil, nil); - - return retVal; - } -} diff --git a/framework/CocoaPods/CorePlot.h b/framework/CocoaPods/CorePlot.h index 3a7b2c66a..c3660a97e 100644 --- a/framework/CocoaPods/CorePlot.h +++ b/framework/CocoaPods/CorePlot.h @@ -1,6 +1,6 @@ #import "TargetConditionals.h" -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #import #import #else @@ -38,19 +38,19 @@ #import "CPTLineCap.h" #import "CPTLineStyle.h" #import "CPTMutableLineStyle.h" -#import "CPTMutableNumericData.h" #import "CPTMutableNumericData+TypeConversion.h" +#import "CPTMutableNumericData.h" #import "CPTMutablePlotRange.h" #import "CPTMutableShadow.h" #import "CPTMutableTextStyle.h" -#import "CPTNumericData.h" #import "CPTNumericData+TypeConversion.h" +#import "CPTNumericData.h" #import "CPTNumericDataType.h" +#import "CPTPathExtensions.h" #import "CPTPieChart.h" +#import "CPTPlatformSpecificCategories.h" #import "CPTPlatformSpecificDefines.h" #import "CPTPlatformSpecificFunctions.h" -#import "CPTPlatformSpecificCategories.h" -#import "CPTPathExtensions.h" #import "CPTPlot.h" #import "CPTPlotArea.h" #import "CPTPlotAreaFrame.h" diff --git a/framework/CorePlot-CocoaTouch.h b/framework/CorePlot-CocoaTouch.h index 9be2b42d5..5b8bd9349 100644 --- a/framework/CorePlot-CocoaTouch.h +++ b/framework/CorePlot-CocoaTouch.h @@ -32,19 +32,19 @@ #import "CPTLineCap.h" #import "CPTLineStyle.h" #import "CPTMutableLineStyle.h" -#import "CPTMutableNumericData.h" #import "CPTMutableNumericData+TypeConversion.h" +#import "CPTMutableNumericData.h" #import "CPTMutablePlotRange.h" #import "CPTMutableShadow.h" #import "CPTMutableTextStyle.h" -#import "CPTNumericData.h" #import "CPTNumericData+TypeConversion.h" +#import "CPTNumericData.h" #import "CPTNumericDataType.h" +#import "CPTPathExtensions.h" #import "CPTPieChart.h" +#import "CPTPlatformSpecificCategories.h" #import "CPTPlatformSpecificDefines.h" #import "CPTPlatformSpecificFunctions.h" -#import "CPTPlatformSpecificCategories.h" -#import "CPTPathExtensions.h" #import "CPTPlot.h" #import "CPTPlotArea.h" #import "CPTPlotAreaFrame.h" diff --git a/framework/CorePlot-CocoaTouch.xcodeproj/project.pbxproj b/framework/CorePlot-CocoaTouch.xcodeproj/project.pbxproj deleted file mode 100644 index 993f75e21..000000000 --- a/framework/CorePlot-CocoaTouch.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1339 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 47; - objects = { - -/* Begin PBXAggregateTarget section */ - 0799D97A137318CF0026072C /* Universal Library */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 0799D97D137318CF0026072C /* Build configuration list for PBXAggregateTarget "Universal Library" */; - buildPhases = ( - 0799D97F137318D80026072C /* ShellScript */, - ); - dependencies = ( - ); - name = "Universal Library"; - productName = "Universal Library"; - }; - C3566B8010EED04900FB3866 /* Documentation */ = { - isa = PBXAggregateTarget; - buildConfigurationList = C3566B8410EED06800FB3866 /* Build configuration list for PBXAggregateTarget "Documentation" */; - buildPhases = ( - C3566B7F10EED04900FB3866 /* ShellScript */, - ); - dependencies = ( - ); - name = Documentation; - productName = Documentation; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 070CB82A0FC9DE4B00F3152B /* CPTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82990FB89E610035D8DA /* CPTGradient.m */; }; - 070CB82B0FC9DE5500F3152B /* CPTImage.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B829B0FB89E610035D8DA /* CPTImage.m */; }; - 070CB82C0FC9DE5600F3152B /* CPTLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82700FB89E610035D8DA /* CPTLayer.m */; }; - 070CB82D0FC9DE5700F3152B /* CPTLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B829D0FB89E610035D8DA /* CPTLineStyle.m */; }; - 070CB8340FC9DEA800F3152B /* CPTColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 070CB8300FC9DEA800F3152B /* CPTColor.h */; settings = {ATTRIBUTES = (); }; }; - 070CB8350FC9DEA800F3152B /* CPTColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 070CB8310FC9DEA800F3152B /* CPTColor.m */; }; - 070CB8360FC9DEA800F3152B /* CPTColorSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 070CB8320FC9DEA800F3152B /* CPTColorSpace.h */; settings = {ATTRIBUTES = (); }; }; - 070CB8370FC9DEA800F3152B /* CPTColorSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 070CB8330FC9DEA800F3152B /* CPTColorSpace.m */; }; - 070CB8430FC9DED400F3152B /* CPTAxis.h in Headers */ = {isa = PBXBuildFile; fileRef = 070CB8390FC9DED400F3152B /* CPTAxis.h */; settings = {ATTRIBUTES = (); }; }; - 070CB8440FC9DED400F3152B /* CPTAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = 070CB83A0FC9DED400F3152B /* CPTAxis.m */; }; - 070CB8470FC9DED400F3152B /* CPTAxisSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 070CB83D0FC9DED400F3152B /* CPTAxisSet.h */; settings = {ATTRIBUTES = (); }; }; - 070CB8480FC9DED400F3152B /* CPTAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 070CB83E0FC9DED400F3152B /* CPTAxisSet.m */; }; - 070CB85E0FC9DF4700F3152B /* CPTTextLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B829F0FB89E610035D8DA /* CPTTextLayer.m */; }; - 0718DE4D11D1EDBA00AF4851 /* CPTAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0718DE4511D1EDBA00AF4851 /* CPTAnnotation.h */; settings = {ATTRIBUTES = (); }; }; - 0718DE4E11D1EDBA00AF4851 /* CPTAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0718DE4611D1EDBA00AF4851 /* CPTAnnotation.m */; }; - 0718DE4F11D1EDBA00AF4851 /* CPTAnnotationHostLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0718DE4711D1EDBA00AF4851 /* CPTAnnotationHostLayer.h */; settings = {ATTRIBUTES = (); }; }; - 0718DE5011D1EDBA00AF4851 /* CPTAnnotationHostLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0718DE4811D1EDBA00AF4851 /* CPTAnnotationHostLayer.m */; }; - 0718DE5111D1EDBA00AF4851 /* CPTLayerAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0718DE4911D1EDBA00AF4851 /* CPTLayerAnnotation.h */; settings = {ATTRIBUTES = (); }; }; - 0718DE5211D1EDBA00AF4851 /* CPTLayerAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0718DE4A11D1EDBA00AF4851 /* CPTLayerAnnotation.m */; }; - 0718DE5311D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0718DE4B11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.h */; settings = {ATTRIBUTES = (); }; }; - 0718DE5411D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0718DE4C11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.m */; }; - 072E3F9F0FE2FF7300ACF62F /* CPTTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 072E3F9B0FE2FF7300ACF62F /* CPTTheme.h */; settings = {ATTRIBUTES = (); }; }; - 072E3FA00FE2FF7300ACF62F /* CPTTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 072E3F9C0FE2FF7300ACF62F /* CPTTheme.m */; }; - 074D7BC50FD6B65F006011BC /* CPTXYPlotSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 074D7BC30FD6B65E006011BC /* CPTXYPlotSpace.h */; settings = {ATTRIBUTES = (); }; }; - 074D7BC60FD6B65F006011BC /* CPTXYPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 074D7BC40FD6B65F006011BC /* CPTXYPlotSpace.m */; }; - 074FADF9112024C500394B90 /* CPTConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 074FADF7112024C500394B90 /* CPTConstraints.h */; settings = {ATTRIBUTES = (); }; }; - 074FADFA112024C500394B90 /* CPTConstraints.m in Sources */ = {isa = PBXBuildFile; fileRef = 074FADF8112024C500394B90 /* CPTConstraints.m */; }; - 0772B4F310E26A12009CD04C /* CPTTradingRangePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 0772B4F110E26A12009CD04C /* CPTTradingRangePlot.h */; settings = {ATTRIBUTES = (); }; }; - 0772B4F410E26A12009CD04C /* CPTTradingRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772B4F210E26A12009CD04C /* CPTTradingRangePlot.m */; }; - 077F28550FE18048000BCA52 /* CPTBorderedLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 077F28510FE18048000BCA52 /* CPTBorderedLayer.h */; settings = {ATTRIBUTES = (); }; }; - 077F28560FE18048000BCA52 /* CPTBorderedLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 077F28520FE18048000BCA52 /* CPTBorderedLayer.m */; }; - 077F28570FE18048000BCA52 /* CPTPathExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 077F28530FE18048000BCA52 /* CPTPathExtensions.h */; settings = {ATTRIBUTES = (); }; }; - 077F28580FE18048000BCA52 /* CPTPathExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 077F28540FE18048000BCA52 /* CPTPathExtensions.m */; }; - 0789EFBE0FB9F97F00C0A613 /* CPTPlatformSpecificCategories.h in Headers */ = {isa = PBXBuildFile; fileRef = 0789EFB80FB9F97F00C0A613 /* CPTPlatformSpecificCategories.h */; settings = {ATTRIBUTES = (); }; }; - 0789EFBF0FB9F97F00C0A613 /* CPTPlatformSpecificCategories.m in Sources */ = {isa = PBXBuildFile; fileRef = 0789EFB90FB9F97F00C0A613 /* CPTPlatformSpecificCategories.m */; }; - 0789EFC00FB9F97F00C0A613 /* CPTPlatformSpecificDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0789EFBA0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.h */; settings = {ATTRIBUTES = (); }; }; - 0789EFC10FB9F97F00C0A613 /* CPTPlatformSpecificDefines.m in Sources */ = {isa = PBXBuildFile; fileRef = 0789EFBB0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.m */; }; - 0789EFC20FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0789EFBC0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.h */; settings = {ATTRIBUTES = (); }; }; - 0789EFC30FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0789EFBD0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.m */; }; - 07A2E71E102DFAD300809BC5 /* CPTTimeFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 07A2E71C102DFAD300809BC5 /* CPTTimeFormatter.h */; settings = {ATTRIBUTES = (); }; }; - 07A2E71F102DFAD300809BC5 /* CPTTimeFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 07A2E71D102DFAD300809BC5 /* CPTTimeFormatter.m */; }; - 07A5E24C104E47E900B7AB80 /* CPTTextLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B829E0FB89E610035D8DA /* CPTTextLayer.h */; settings = {ATTRIBUTES = (); }; }; - 07A62FB50FE2234900CD765C /* CPTTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07A62FB30FE2234900CD765C /* CPTTextStyle.h */; settings = {ATTRIBUTES = (); }; }; - 07A62FB60FE2234900CD765C /* CPTTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07A62FB40FE2234900CD765C /* CPTTextStyle.m */; }; - 07AEF30310BBF99A0012BEFF /* CPTResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = 07AEF30110BBF99A0012BEFF /* CPTResponder.h */; settings = {ATTRIBUTES = (); }; }; - 07B69AB912B6281100F4C16C /* CPTMutableTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B69AB712B6281100F4C16C /* CPTMutableTextStyle.h */; settings = {ATTRIBUTES = (); }; }; - 07B69ABA12B6281100F4C16C /* CPTMutableTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69AB812B6281100F4C16C /* CPTMutableTextStyle.m */; }; - 07B69B7112B62E9600F4C16C /* CPTMutableLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B69B6F12B62E9600F4C16C /* CPTMutableLineStyle.h */; settings = {ATTRIBUTES = (); }; }; - 07B69B7212B62E9600F4C16C /* CPTMutableLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69B7012B62E9600F4C16C /* CPTMutableLineStyle.m */; }; - 07FCF2D4115B54DE00E46606 /* _CPTSlateTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 07FCF2D2115B54DE00E46606 /* _CPTSlateTheme.m */; }; - BC4FAF29100D7DF300811DD3 /* NSDecimalNumberExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82B10FB89E610035D8DA /* NSDecimalNumberExtensions.h */; settings = {ATTRIBUTES = (); }; }; - BC74A2C210FC087800E7E90D /* CPTPieChart.h in Headers */ = {isa = PBXBuildFile; fileRef = BC74A2C010FC087800E7E90D /* CPTPieChart.h */; settings = {ATTRIBUTES = (); }; }; - BC74A2C310FC087800E7E90D /* CPTPieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74A2C110FC087800E7E90D /* CPTPieChart.m */; }; - BC79F1D50FD1DC1A00510976 /* CPTGraphHostingView.h in Headers */ = {isa = PBXBuildFile; fileRef = BC79F1D30FD1DC1A00510976 /* CPTGraphHostingView.h */; settings = {ATTRIBUTES = (); }; }; - BC79F1D60FD1DC1A00510976 /* CPTGraphHostingView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC79F1D40FD1DC1A00510976 /* CPTGraphHostingView.m */; }; - BC89A79A1024AB19009D5261 /* CorePlotProbes.d in Sources */ = {isa = PBXBuildFile; fileRef = BC89A7991024AB19009D5261 /* CorePlotProbes.d */; }; - BC9B834E0FB8A1400035D8DA /* CPTPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82D30FB89E610035D8DA /* CPTPlot.m */; }; - BC9B834F0FB8A1400035D8DA /* CPTScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82D50FB89E610035D8DA /* CPTScatterPlot.m */; }; - BC9B83500FB8A1400035D8DA /* CPTBarPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82DB0FB89E610035D8DA /* CPTBarPlot.m */; }; - BC9B83510FB8A1400035D8DA /* CPTPlotSymbol.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82D10FB89E610035D8DA /* CPTPlotSymbol.m */; }; - BC9B83520FB8A1400035D8DA /* CPTPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82C70FB89E610035D8DA /* CPTPlotSpace.m */; }; - BC9B83550FB8A1400035D8DA /* CPTPlotAreaFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82C20FB89E610035D8DA /* CPTPlotAreaFrame.m */; }; - BC9B83560FB8A1400035D8DA /* CPTGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82B70FB89E610035D8DA /* CPTGraph.m */; }; - BC9B83570FB8A1400035D8DA /* CPTXYGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82B90FB89E610035D8DA /* CPTXYGraph.m */; }; - BC9B835A0FB8A1400035D8DA /* NSDecimalNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82B20FB89E610035D8DA /* NSDecimalNumberExtensions.m */; }; - BC9B835B0FB8A1400035D8DA /* NSNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82B40FB89E610035D8DA /* NSNumberExtensions.m */; }; - BC9B835D0FB8A1400035D8DA /* CPTDefinitions.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82A40FB89E610035D8DA /* CPTDefinitions.m */; }; - BC9B835E0FB8A1400035D8DA /* CPTExceptions.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82A60FB89E610035D8DA /* CPTExceptions.m */; }; - BC9B835F0FB8A1400035D8DA /* CPTUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82A80FB89E610035D8DA /* CPTUtilities.m */; }; - BC9B83600FB8A1400035D8DA /* CPTPlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82AC0FB89E610035D8DA /* CPTPlotRange.m */; }; - BC9B83610FB8A1400035D8DA /* CPTFill.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82890FB89E610035D8DA /* CPTFill.m */; }; - BC9B83620FB8A1400035D8DA /* _CPTFillColor.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B828B0FB89E610035D8DA /* _CPTFillColor.m */; }; - BC9B83630FB8A1400035D8DA /* _CPTFillGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B828D0FB89E610035D8DA /* _CPTFillGradient.m */; }; - BC9B83640FB8A1400035D8DA /* _CPTFillImage.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B828F0FB89E610035D8DA /* _CPTFillImage.m */; }; - BC9B836E0FB8A1700035D8DA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC9B82690FB89BD10035D8DA /* QuartzCore.framework */; }; - BC9B836F0FB8A1700035D8DA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - BC9B83700FB8A1700035D8DA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - BC9B83710FB8A1700035D8DA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; - BC9B83C30FB8AC4B0035D8DA /* CorePlot-CocoaTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B83C20FB8AC4B0035D8DA /* CorePlot-CocoaTouch.h */; settings = {ATTRIBUTES = (); }; }; - BCC7EA451006BF5700B39451 /* _CPTPlainBlackTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC7EA3F1006BF5700B39451 /* _CPTPlainBlackTheme.h */; settings = {ATTRIBUTES = (); }; }; - BCC7EA461006BF5700B39451 /* _CPTPlainBlackTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC7EA401006BF5700B39451 /* _CPTPlainBlackTheme.m */; }; - BCC7EA471006BF5700B39451 /* _CPTPlainWhiteTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC7EA411006BF5700B39451 /* _CPTPlainWhiteTheme.h */; settings = {ATTRIBUTES = (); }; }; - BCC7EA481006BF5700B39451 /* _CPTPlainWhiteTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC7EA421006BF5700B39451 /* _CPTPlainWhiteTheme.m */; }; - BCC7EA491006BF5700B39451 /* _CPTStocksTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC7EA431006BF5700B39451 /* _CPTStocksTheme.h */; settings = {ATTRIBUTES = (); }; }; - BCC7EA4A1006BF5700B39451 /* _CPTStocksTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC7EA441006BF5700B39451 /* _CPTStocksTheme.m */; }; - C304565313F4AC9A004D04BC /* _CPTDarkGradientTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = C304565213F4AC9A004D04BC /* _CPTDarkGradientTheme.h */; settings = {ATTRIBUTES = (); }; }; - C30550E91399BE2000E0151F /* CPTLegendEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = C30550E71399BE2000E0151F /* CPTLegendEntry.h */; settings = {ATTRIBUTES = (); }; }; - C30550EA1399BE2000E0151F /* CPTLegendEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = C30550E81399BE2000E0151F /* CPTLegendEntry.m */; }; - C30C85AB1047428100181766 /* CPTPlotGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C30C85A91047428100181766 /* CPTPlotGroup.h */; settings = {ATTRIBUTES = (); }; }; - C30C85AC1047428100181766 /* CPTPlotGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C30C85AA1047428100181766 /* CPTPlotGroup.m */; }; - C318F4C111EA18A400595FF9 /* CPTLimitBand.h in Headers */ = {isa = PBXBuildFile; fileRef = C318F4BF11EA18A400595FF9 /* CPTLimitBand.h */; settings = {ATTRIBUTES = (); }; }; - C318F4C211EA18A400595FF9 /* CPTLimitBand.m in Sources */ = {isa = PBXBuildFile; fileRef = C318F4C011EA18A400595FF9 /* CPTLimitBand.m */; }; - C31A40BF17ABD6C60020C5C6 /* CPTFunctionDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C31A40BD17ABD6C60020C5C6 /* CPTFunctionDataSource.h */; }; - C31A40C017ABD6C60020C5C6 /* CPTFunctionDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = C31A40BE17ABD6C60020C5C6 /* CPTFunctionDataSource.m */; }; - C3286C0715D8769800A436A8 /* _CPTMaskLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3286C0515D8769800A436A8 /* _CPTMaskLayer.h */; settings = {ATTRIBUTES = (); }; }; - C3286C0815D8769800A436A8 /* _CPTMaskLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3286C0615D8769800A436A8 /* _CPTMaskLayer.m */; }; - C32EE1BD13EC4AF900038266 /* CPTShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C32EE1BB13EC4AF900038266 /* CPTShadow.h */; settings = {ATTRIBUTES = (); }; }; - C32EE1BE13EC4AF900038266 /* CPTShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1BC13EC4AF900038266 /* CPTShadow.m */; }; - C32EE1C813EC4C7200038266 /* CPTMutableShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C32EE1C613EC4C7200038266 /* CPTMutableShadow.h */; settings = {ATTRIBUTES = (); }; }; - C32EE1C913EC4C7200038266 /* CPTMutableShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1C713EC4C7200038266 /* CPTMutableShadow.m */; }; - C3392A361225F63B008DA6BD /* CPTNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3392A351225F63B008DA6BD /* CPTNumericData+TypeConversion.m */; }; - C3408C4615FC1CA8004F1D70 /* _CPTBorderLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3408C4415FC1CA8004F1D70 /* _CPTBorderLayer.h */; settings = {ATTRIBUTES = (); }; }; - C3408C4715FC1CA8004F1D70 /* _CPTBorderLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3408C4515FC1CA8004F1D70 /* _CPTBorderLayer.m */; }; - C3436C4F13F4AC4400739AC2 /* _CPTDarkGradientTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = C3436C4E13F4AC4400739AC2 /* _CPTDarkGradientTheme.m */; }; - C3436C5113F4AC6000739AC2 /* _CPTSlateTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = C3436C5013F4AC6000739AC2 /* _CPTSlateTheme.h */; settings = {ATTRIBUTES = (); }; }; - C349DCB0151AAFAB00BFD6A7 /* CPTCalendarFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = C349DCAE151AAFAB00BFD6A7 /* CPTCalendarFormatter.h */; settings = {ATTRIBUTES = (); }; }; - C349DCB1151AAFAB00BFD6A7 /* CPTCalendarFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C349DCAF151AAFAB00BFD6A7 /* CPTCalendarFormatter.m */; }; - C35A65A511025EDF00FE24BB /* CPTPlotArea.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65A311025EDF00FE24BB /* CPTPlotArea.h */; settings = {ATTRIBUTES = (); }; }; - C35A65A611025EDF00FE24BB /* CPTPlotArea.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65A411025EDF00FE24BB /* CPTPlotArea.m */; }; - C35A65B311025F8A00FE24BB /* CPTGridLines.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65B111025F8A00FE24BB /* CPTGridLines.h */; settings = {ATTRIBUTES = (); }; }; - C35A65B411025F8A00FE24BB /* CPTGridLines.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65B211025F8A00FE24BB /* CPTGridLines.m */; }; - C35A65B911025FA900FE24BB /* CPTAxisLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65B511025FA900FE24BB /* CPTAxisLabel.h */; settings = {ATTRIBUTES = (); }; }; - C35A65BA11025FA900FE24BB /* CPTAxisLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65B611025FA900FE24BB /* CPTAxisLabel.m */; }; - C35A65BB11025FA900FE24BB /* CPTAxisTitle.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65B711025FA900FE24BB /* CPTAxisTitle.h */; settings = {ATTRIBUTES = (); }; }; - C35A65BC11025FA900FE24BB /* CPTAxisTitle.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65B811025FA900FE24BB /* CPTAxisTitle.m */; }; - C35A65BF11025FB300FE24BB /* CPTAxisLabelGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65BD11025FB300FE24BB /* CPTAxisLabelGroup.h */; settings = {ATTRIBUTES = (); }; }; - C35A65C011025FB300FE24BB /* CPTAxisLabelGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65BE11025FB300FE24BB /* CPTAxisLabelGroup.m */; }; - C35A65C711025FCC00FE24BB /* CPTXYAxis.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65C111025FCC00FE24BB /* CPTXYAxis.h */; settings = {ATTRIBUTES = (); }; }; - C35A65C811025FCC00FE24BB /* CPTXYAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65C211025FCC00FE24BB /* CPTXYAxis.m */; }; - C35A65C911025FCC00FE24BB /* CPTXYAxisSet.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65C311025FCC00FE24BB /* CPTXYAxisSet.h */; settings = {ATTRIBUTES = (); }; }; - C35A65CA11025FCC00FE24BB /* CPTXYAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65C411025FCC00FE24BB /* CPTXYAxisSet.m */; }; - C35A66071102723E00FE24BB /* CPTTextStylePlatformSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A66051102723E00FE24BB /* CPTTextStylePlatformSpecific.h */; settings = {ATTRIBUTES = (); }; }; - C35A66081102723E00FE24BB /* CPTTextStylePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A66061102723E00FE24BB /* CPTTextStylePlatformSpecific.m */; }; - C3791D05191D4C2F001EC514 /* CPTImagePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C3791D03191D4C2F001EC514 /* CPTImagePlatformSpecific.m */; }; - C38DD49711A04B99002A68E7 /* CPTGridLineGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C38DD49511A04B99002A68E7 /* CPTGridLineGroup.h */; settings = {ATTRIBUTES = (); }; }; - C38DD49811A04B99002A68E7 /* CPTGridLineGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C38DD49611A04B99002A68E7 /* CPTGridLineGroup.m */; }; - C3920ACF1395B7680045F3BB /* CPTLegend.h in Headers */ = {isa = PBXBuildFile; fileRef = C3920ACD1395B7680045F3BB /* CPTLegend.h */; settings = {ATTRIBUTES = (); }; }; - C3920AD01395B7680045F3BB /* CPTLegend.m in Sources */ = {isa = PBXBuildFile; fileRef = C3920ACE1395B7680045F3BB /* CPTLegend.m */; }; - C3978E1013CE65C600A420D9 /* NSCoderExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = C3978E0E13CE65C600A420D9 /* NSCoderExtensions.h */; settings = {ATTRIBUTES = (); }; }; - C3978E1113CE65C600A420D9 /* NSCoderExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3978E0F13CE65C600A420D9 /* NSCoderExtensions.m */; }; - C3A695E1146A196100AF5653 /* CPTMutablePlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = C3A695DF146A196100AF5653 /* CPTMutablePlotRange.h */; settings = {ATTRIBUTES = (); }; }; - C3A695E2146A196100AF5653 /* CPTMutablePlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A695E0146A196100AF5653 /* CPTMutablePlotRange.m */; }; - C3B623C0107EC9370009EF0B /* CPTBarPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82DA0FB89E610035D8DA /* CPTBarPlot.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C1107EC9400009EF0B /* CPTDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82A30FB89E610035D8DA /* CPTDefinitions.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C2107EC9430009EF0B /* CPTExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82A50FB89E610035D8DA /* CPTExceptions.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C3107EC94D0009EF0B /* CPTFill.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82880FB89E610035D8DA /* CPTFill.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C4107EC94E0009EF0B /* CPTGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82980FB89E610035D8DA /* CPTGradient.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C5107EC9500009EF0B /* CPTGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82B60FB89E610035D8DA /* CPTGraph.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C6107EC9510009EF0B /* CPTImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B829A0FB89E610035D8DA /* CPTImage.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C7107EC9540009EF0B /* CPTLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B826F0FB89E610035D8DA /* CPTLayer.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C8107EC9570009EF0B /* CPTLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B829C0FB89E610035D8DA /* CPTLineStyle.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C9107EC95C0009EF0B /* CPTPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82D20FB89E610035D8DA /* CPTPlot.h */; settings = {ATTRIBUTES = (); }; }; - C3B623CA107EC95E0009EF0B /* CPTPlotAreaFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82C10FB89E610035D8DA /* CPTPlotAreaFrame.h */; settings = {ATTRIBUTES = (); }; }; - C3B623CB107EC9610009EF0B /* CPTPlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82AB0FB89E610035D8DA /* CPTPlotRange.h */; settings = {ATTRIBUTES = (); }; }; - C3B623CC107EC9620009EF0B /* CPTPlotSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82C60FB89E610035D8DA /* CPTPlotSpace.h */; settings = {ATTRIBUTES = (); }; }; - C3B623CD107EC9630009EF0B /* CPTPlotSymbol.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82D00FB89E610035D8DA /* CPTPlotSymbol.h */; settings = {ATTRIBUTES = (); }; }; - C3B623CF107EC9680009EF0B /* CPTScatterPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82D40FB89E610035D8DA /* CPTScatterPlot.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D1107EC96E0009EF0B /* CPTUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82A70FB89E610035D8DA /* CPTUtilities.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D2107EC9760009EF0B /* CPTXYGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82B80FB89E610035D8DA /* CPTXYGraph.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D3107EC97A0009EF0B /* NSNumberExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82B30FB89E610035D8DA /* NSNumberExtensions.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D4107EC9800009EF0B /* _CPTFillColor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B828A0FB89E610035D8DA /* _CPTFillColor.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D5107EC9820009EF0B /* _CPTFillGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B828C0FB89E610035D8DA /* _CPTFillGradient.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D6107EC9830009EF0B /* _CPTFillImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B828E0FB89E610035D8DA /* _CPTFillImage.h */; settings = {ATTRIBUTES = (); }; }; - C3C68320166138E200340E39 /* CPTAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C68318166138E200340E39 /* CPTAnimation.h */; }; - C3C68321166138E200340E39 /* CPTAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C68319166138E200340E39 /* CPTAnimation.m */; }; - C3C68322166138E200340E39 /* CPTAnimationOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6831A166138E200340E39 /* CPTAnimationOperation.h */; }; - C3C68323166138E200340E39 /* CPTAnimationOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6831B166138E200340E39 /* CPTAnimationOperation.m */; }; - C3C68324166138E200340E39 /* CPTAnimationPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6831C166138E200340E39 /* CPTAnimationPeriod.h */; }; - C3C68325166138E200340E39 /* CPTAnimationPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6831D166138E200340E39 /* CPTAnimationPeriod.m */; }; - C3C68326166138E200340E39 /* _CPTAnimationTimingFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6831E166138E200340E39 /* _CPTAnimationTimingFunctions.h */; }; - C3C68327166138E200340E39 /* _CPTAnimationTimingFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6831F166138E200340E39 /* _CPTAnimationTimingFunctions.m */; }; - C3C683341661391A00340E39 /* _CPTAnimationCGFloatPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C683281661391A00340E39 /* _CPTAnimationCGFloatPeriod.h */; }; - C3C683351661391A00340E39 /* _CPTAnimationCGFloatPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C683291661391A00340E39 /* _CPTAnimationCGFloatPeriod.m */; }; - C3C683361661391A00340E39 /* _CPTAnimationCGPointPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6832A1661391A00340E39 /* _CPTAnimationCGPointPeriod.h */; }; - C3C683371661391A00340E39 /* _CPTAnimationCGPointPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6832B1661391A00340E39 /* _CPTAnimationCGPointPeriod.m */; }; - C3C683381661391A00340E39 /* _CPTAnimationCGRectPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6832C1661391A00340E39 /* _CPTAnimationCGRectPeriod.h */; }; - C3C683391661391A00340E39 /* _CPTAnimationCGRectPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6832D1661391A00340E39 /* _CPTAnimationCGRectPeriod.m */; }; - C3C6833A1661391A00340E39 /* _CPTAnimationCGSizePeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6832E1661391A00340E39 /* _CPTAnimationCGSizePeriod.h */; }; - C3C6833B1661391A00340E39 /* _CPTAnimationCGSizePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6832F1661391A00340E39 /* _CPTAnimationCGSizePeriod.m */; }; - C3C6833C1661391A00340E39 /* _CPTAnimationNSDecimalPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C683301661391A00340E39 /* _CPTAnimationNSDecimalPeriod.h */; }; - C3C6833D1661391A00340E39 /* _CPTAnimationNSDecimalPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C683311661391A00340E39 /* _CPTAnimationNSDecimalPeriod.m */; }; - C3C6833E1661391A00340E39 /* _CPTAnimationPlotRangePeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C683321661391A00340E39 /* _CPTAnimationPlotRangePeriod.h */; }; - C3C6833F1661391A00340E39 /* _CPTAnimationPlotRangePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C683331661391A00340E39 /* _CPTAnimationPlotRangePeriod.m */; }; - C3CAFB3B1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CAFB391229E48200F5C989 /* CPTMutableNumericData+TypeConversion.h */; settings = {ATTRIBUTES = (); }; }; - C3CAFB3C1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CAFB3A1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.m */; }; - C3CCA04813E8D94800CE6DB1 /* _CPTConstraintsFixed.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CCA04413E8D94800CE6DB1 /* _CPTConstraintsFixed.h */; settings = {ATTRIBUTES = (); }; }; - C3CCA04913E8D94800CE6DB1 /* _CPTConstraintsFixed.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA04513E8D94800CE6DB1 /* _CPTConstraintsFixed.m */; }; - C3CCA04A13E8D94800CE6DB1 /* _CPTConstraintsRelative.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CCA04613E8D94800CE6DB1 /* _CPTConstraintsRelative.h */; settings = {ATTRIBUTES = (); }; }; - C3CCA04B13E8D94800CE6DB1 /* _CPTConstraintsRelative.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA04713E8D94800CE6DB1 /* _CPTConstraintsRelative.m */; }; - C3CD282817DE957C008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD282717DE957C008EED1E /* Accelerate.framework */; }; - C3D3AD3413DF8E9D0004EA73 /* CPTLineCap.h in Headers */ = {isa = PBXBuildFile; fileRef = C3D3AD3213DF8E9D0004EA73 /* CPTLineCap.h */; settings = {ATTRIBUTES = (); }; }; - C3D3AD3513DF8E9D0004EA73 /* CPTLineCap.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D3AD3313DF8E9D0004EA73 /* CPTLineCap.m */; }; - C3D68B091221650C00EB4863 /* CPTMutableNumericData.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CADE3D11B188C500D36017 /* CPTMutableNumericData.h */; settings = {ATTRIBUTES = (); }; }; - C3D68B0A1221650D00EB4863 /* CPTMutableNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CADE3E11B188C500D36017 /* CPTMutableNumericData.m */; }; - C3D68B0B1221650E00EB4863 /* CPTNumericData+TypeConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CADE3211B188A800D36017 /* CPTNumericData+TypeConversion.h */; settings = {ATTRIBUTES = (); }; }; - C3D68B0D1221651200EB4863 /* CPTNumericData.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CADE3011B188A800D36017 /* CPTNumericData.h */; settings = {ATTRIBUTES = (); }; }; - C3D68B0E1221651200EB4863 /* CPTNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CADE3111B188A800D36017 /* CPTNumericData.m */; }; - C3D68B0F1221651500EB4863 /* CPTNumericDataType.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CADE3911B188B600D36017 /* CPTNumericDataType.h */; settings = {ATTRIBUTES = (); }; }; - C3D68B101221651600EB4863 /* CPTNumericDataType.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CADE3A11B188B600D36017 /* CPTNumericDataType.m */; }; - C3D9825116BD406600DE7977 /* CorePlot_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = C3D9825016BD406600DE7977 /* CorePlot_Prefix.pch */; }; - C40CFB94107EC1B40057E828 /* _CPTXYTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = C40CFB92107EC1B40057E828 /* _CPTXYTheme.h */; settings = {ATTRIBUTES = (); }; }; - C40CFB95107EC1B40057E828 /* _CPTXYTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = C40CFB93107EC1B40057E828 /* _CPTXYTheme.m */; }; - D0C047BF12D6568500DA8047 /* CPTRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = D0C047BD12D6568500DA8047 /* CPTRangePlot.m */; }; - D0C047C012D6568500DA8047 /* CPTRangePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C047BE12D6568500DA8047 /* CPTRangePlot.h */; settings = {ATTRIBUTES = (); }; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 070CB8300FC9DEA800F3152B /* CPTColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTColor.h; path = Source/CPTColor.h; sourceTree = ""; }; - 070CB8310FC9DEA800F3152B /* CPTColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTColor.m; path = Source/CPTColor.m; sourceTree = ""; }; - 070CB8320FC9DEA800F3152B /* CPTColorSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTColorSpace.h; path = Source/CPTColorSpace.h; sourceTree = ""; }; - 070CB8330FC9DEA800F3152B /* CPTColorSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTColorSpace.m; path = Source/CPTColorSpace.m; sourceTree = ""; }; - 070CB8390FC9DED400F3152B /* CPTAxis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAxis.h; path = Source/CPTAxis.h; sourceTree = ""; }; - 070CB83A0FC9DED400F3152B /* CPTAxis.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAxis.m; path = Source/CPTAxis.m; sourceTree = ""; }; - 070CB83D0FC9DED400F3152B /* CPTAxisSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAxisSet.h; path = Source/CPTAxisSet.h; sourceTree = ""; }; - 070CB83E0FC9DED400F3152B /* CPTAxisSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAxisSet.m; path = Source/CPTAxisSet.m; sourceTree = ""; }; - 0718DE4511D1EDBA00AF4851 /* CPTAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAnnotation.h; path = Source/CPTAnnotation.h; sourceTree = ""; }; - 0718DE4611D1EDBA00AF4851 /* CPTAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAnnotation.m; path = Source/CPTAnnotation.m; sourceTree = ""; }; - 0718DE4711D1EDBA00AF4851 /* CPTAnnotationHostLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAnnotationHostLayer.h; path = Source/CPTAnnotationHostLayer.h; sourceTree = ""; }; - 0718DE4811D1EDBA00AF4851 /* CPTAnnotationHostLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAnnotationHostLayer.m; path = Source/CPTAnnotationHostLayer.m; sourceTree = ""; }; - 0718DE4911D1EDBA00AF4851 /* CPTLayerAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLayerAnnotation.h; path = Source/CPTLayerAnnotation.h; sourceTree = ""; }; - 0718DE4A11D1EDBA00AF4851 /* CPTLayerAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLayerAnnotation.m; path = Source/CPTLayerAnnotation.m; sourceTree = ""; }; - 0718DE4B11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotSpaceAnnotation.h; path = Source/CPTPlotSpaceAnnotation.h; sourceTree = ""; }; - 0718DE4C11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotSpaceAnnotation.m; path = Source/CPTPlotSpaceAnnotation.m; sourceTree = ""; }; - 071F3CDF10FBAB9D00D0A7B6 /* License.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = License.txt; path = ../License.txt; sourceTree = SOURCE_ROOT; }; - 072E3F9B0FE2FF7300ACF62F /* CPTTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTheme.h; path = Source/CPTTheme.h; sourceTree = ""; }; - 072E3F9C0FE2FF7300ACF62F /* CPTTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTTheme.m; path = Source/CPTTheme.m; sourceTree = ""; }; - 074D7BC30FD6B65E006011BC /* CPTXYPlotSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTXYPlotSpace.h; path = Source/CPTXYPlotSpace.h; sourceTree = ""; }; - 074D7BC40FD6B65F006011BC /* CPTXYPlotSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTXYPlotSpace.m; path = Source/CPTXYPlotSpace.m; sourceTree = ""; }; - 074FADF7112024C500394B90 /* CPTConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTConstraints.h; path = Source/CPTConstraints.h; sourceTree = ""; }; - 074FADF8112024C500394B90 /* CPTConstraints.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTConstraints.m; path = Source/CPTConstraints.m; sourceTree = ""; }; - 0772B4F110E26A12009CD04C /* CPTTradingRangePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTradingRangePlot.h; path = Source/CPTTradingRangePlot.h; sourceTree = ""; }; - 0772B4F210E26A12009CD04C /* CPTTradingRangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTTradingRangePlot.m; path = Source/CPTTradingRangePlot.m; sourceTree = ""; }; - 077F28510FE18048000BCA52 /* CPTBorderedLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTBorderedLayer.h; path = Source/CPTBorderedLayer.h; sourceTree = ""; }; - 077F28520FE18048000BCA52 /* CPTBorderedLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTBorderedLayer.m; path = Source/CPTBorderedLayer.m; sourceTree = ""; }; - 077F28530FE18048000BCA52 /* CPTPathExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPathExtensions.h; path = Source/CPTPathExtensions.h; sourceTree = ""; }; - 077F28540FE18048000BCA52 /* CPTPathExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPathExtensions.m; path = Source/CPTPathExtensions.m; sourceTree = ""; }; - 0789EFB80FB9F97F00C0A613 /* CPTPlatformSpecificCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlatformSpecificCategories.h; sourceTree = ""; }; - 0789EFB90FB9F97F00C0A613 /* CPTPlatformSpecificCategories.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlatformSpecificCategories.m; sourceTree = ""; }; - 0789EFBA0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlatformSpecificDefines.h; sourceTree = ""; }; - 0789EFBB0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlatformSpecificDefines.m; sourceTree = ""; }; - 0789EFBC0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlatformSpecificFunctions.h; sourceTree = ""; }; - 0789EFBD0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlatformSpecificFunctions.m; sourceTree = ""; }; - 07A2E71C102DFAD300809BC5 /* CPTTimeFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTimeFormatter.h; path = Source/CPTTimeFormatter.h; sourceTree = ""; }; - 07A2E71D102DFAD300809BC5 /* CPTTimeFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTTimeFormatter.m; path = Source/CPTTimeFormatter.m; sourceTree = ""; }; - 07A62FB30FE2234900CD765C /* CPTTextStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = CPTTextStyle.h; path = Source/CPTTextStyle.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 07A62FB40FE2234900CD765C /* CPTTextStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTTextStyle.m; path = Source/CPTTextStyle.m; sourceTree = ""; }; - 07AEF30110BBF99A0012BEFF /* CPTResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTResponder.h; path = Source/CPTResponder.h; sourceTree = ""; }; - 07B69AB712B6281100F4C16C /* CPTMutableTextStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTMutableTextStyle.h; path = Source/CPTMutableTextStyle.h; sourceTree = ""; }; - 07B69AB812B6281100F4C16C /* CPTMutableTextStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTMutableTextStyle.m; path = Source/CPTMutableTextStyle.m; sourceTree = ""; }; - 07B69B6F12B62E9600F4C16C /* CPTMutableLineStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTMutableLineStyle.h; path = Source/CPTMutableLineStyle.h; sourceTree = ""; }; - 07B69B7012B62E9600F4C16C /* CPTMutableLineStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTMutableLineStyle.m; path = Source/CPTMutableLineStyle.m; sourceTree = ""; }; - 07FCF2D2115B54DE00E46606 /* _CPTSlateTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTSlateTheme.m; path = Source/_CPTSlateTheme.m; sourceTree = ""; }; - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - BC74A2C010FC087800E7E90D /* CPTPieChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPieChart.h; path = Source/CPTPieChart.h; sourceTree = ""; }; - BC74A2C110FC087800E7E90D /* CPTPieChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPieChart.m; path = Source/CPTPieChart.m; sourceTree = ""; }; - BC79F1D30FD1DC1A00510976 /* CPTGraphHostingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTGraphHostingView.h; sourceTree = ""; }; - BC79F1D40FD1DC1A00510976 /* CPTGraphHostingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTGraphHostingView.m; sourceTree = ""; }; - BC89A7991024AB19009D5261 /* CorePlotProbes.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; name = CorePlotProbes.d; path = TestResources/CorePlotProbes.d; sourceTree = ""; }; - BC9B82690FB89BD10035D8DA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - BC9B826F0FB89E610035D8DA /* CPTLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLayer.h; path = Source/CPTLayer.h; sourceTree = ""; }; - BC9B82700FB89E610035D8DA /* CPTLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLayer.m; path = Source/CPTLayer.m; sourceTree = ""; }; - BC9B82880FB89E610035D8DA /* CPTFill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTFill.h; path = Source/CPTFill.h; sourceTree = SOURCE_ROOT; }; - BC9B82890FB89E610035D8DA /* CPTFill.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTFill.m; path = Source/CPTFill.m; sourceTree = SOURCE_ROOT; }; - BC9B828A0FB89E610035D8DA /* _CPTFillColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTFillColor.h; path = Source/_CPTFillColor.h; sourceTree = SOURCE_ROOT; }; - BC9B828B0FB89E610035D8DA /* _CPTFillColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTFillColor.m; path = Source/_CPTFillColor.m; sourceTree = SOURCE_ROOT; }; - BC9B828C0FB89E610035D8DA /* _CPTFillGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTFillGradient.h; path = Source/_CPTFillGradient.h; sourceTree = SOURCE_ROOT; }; - BC9B828D0FB89E610035D8DA /* _CPTFillGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTFillGradient.m; path = Source/_CPTFillGradient.m; sourceTree = SOURCE_ROOT; }; - BC9B828E0FB89E610035D8DA /* _CPTFillImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTFillImage.h; path = Source/_CPTFillImage.h; sourceTree = SOURCE_ROOT; }; - BC9B828F0FB89E610035D8DA /* _CPTFillImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTFillImage.m; path = Source/_CPTFillImage.m; sourceTree = SOURCE_ROOT; }; - BC9B82980FB89E610035D8DA /* CPTGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTGradient.h; path = Source/CPTGradient.h; sourceTree = ""; }; - BC9B82990FB89E610035D8DA /* CPTGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTGradient.m; path = Source/CPTGradient.m; sourceTree = ""; }; - BC9B829A0FB89E610035D8DA /* CPTImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = CPTImage.h; path = Source/CPTImage.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - BC9B829B0FB89E610035D8DA /* CPTImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTImage.m; path = Source/CPTImage.m; sourceTree = ""; }; - BC9B829C0FB89E610035D8DA /* CPTLineStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLineStyle.h; path = Source/CPTLineStyle.h; sourceTree = ""; }; - BC9B829D0FB89E610035D8DA /* CPTLineStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLineStyle.m; path = Source/CPTLineStyle.m; sourceTree = ""; }; - BC9B829E0FB89E610035D8DA /* CPTTextLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTextLayer.h; path = Source/CPTTextLayer.h; sourceTree = ""; }; - BC9B829F0FB89E610035D8DA /* CPTTextLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTTextLayer.m; path = Source/CPTTextLayer.m; sourceTree = ""; }; - BC9B82A30FB89E610035D8DA /* CPTDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTDefinitions.h; path = Source/CPTDefinitions.h; sourceTree = SOURCE_ROOT; }; - BC9B82A40FB89E610035D8DA /* CPTDefinitions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTDefinitions.m; path = Source/CPTDefinitions.m; sourceTree = SOURCE_ROOT; }; - BC9B82A50FB89E610035D8DA /* CPTExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTExceptions.h; path = Source/CPTExceptions.h; sourceTree = SOURCE_ROOT; }; - BC9B82A60FB89E610035D8DA /* CPTExceptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTExceptions.m; path = Source/CPTExceptions.m; sourceTree = SOURCE_ROOT; }; - BC9B82A70FB89E610035D8DA /* CPTUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTUtilities.h; path = Source/CPTUtilities.h; sourceTree = SOURCE_ROOT; }; - BC9B82A80FB89E610035D8DA /* CPTUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTUtilities.m; path = Source/CPTUtilities.m; sourceTree = SOURCE_ROOT; }; - BC9B82AB0FB89E610035D8DA /* CPTPlotRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotRange.h; path = Source/CPTPlotRange.h; sourceTree = SOURCE_ROOT; }; - BC9B82AC0FB89E610035D8DA /* CPTPlotRange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotRange.m; path = Source/CPTPlotRange.m; sourceTree = SOURCE_ROOT; }; - BC9B82B10FB89E610035D8DA /* NSDecimalNumberExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSDecimalNumberExtensions.h; path = Source/NSDecimalNumberExtensions.h; sourceTree = SOURCE_ROOT; }; - BC9B82B20FB89E610035D8DA /* NSDecimalNumberExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSDecimalNumberExtensions.m; path = Source/NSDecimalNumberExtensions.m; sourceTree = SOURCE_ROOT; }; - BC9B82B30FB89E610035D8DA /* NSNumberExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSNumberExtensions.h; path = Source/NSNumberExtensions.h; sourceTree = SOURCE_ROOT; }; - BC9B82B40FB89E610035D8DA /* NSNumberExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSNumberExtensions.m; path = Source/NSNumberExtensions.m; sourceTree = SOURCE_ROOT; }; - BC9B82B60FB89E610035D8DA /* CPTGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTGraph.h; path = Source/CPTGraph.h; sourceTree = SOURCE_ROOT; }; - BC9B82B70FB89E610035D8DA /* CPTGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTGraph.m; path = Source/CPTGraph.m; sourceTree = SOURCE_ROOT; }; - BC9B82B80FB89E610035D8DA /* CPTXYGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTXYGraph.h; path = Source/CPTXYGraph.h; sourceTree = SOURCE_ROOT; }; - BC9B82B90FB89E610035D8DA /* CPTXYGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTXYGraph.m; path = Source/CPTXYGraph.m; sourceTree = SOURCE_ROOT; }; - BC9B82C10FB89E610035D8DA /* CPTPlotAreaFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotAreaFrame.h; path = Source/CPTPlotAreaFrame.h; sourceTree = ""; }; - BC9B82C20FB89E610035D8DA /* CPTPlotAreaFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotAreaFrame.m; path = Source/CPTPlotAreaFrame.m; sourceTree = ""; }; - BC9B82C60FB89E610035D8DA /* CPTPlotSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotSpace.h; path = Source/CPTPlotSpace.h; sourceTree = SOURCE_ROOT; }; - BC9B82C70FB89E610035D8DA /* CPTPlotSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotSpace.m; path = Source/CPTPlotSpace.m; sourceTree = SOURCE_ROOT; }; - BC9B82D00FB89E610035D8DA /* CPTPlotSymbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotSymbol.h; path = Source/CPTPlotSymbol.h; sourceTree = SOURCE_ROOT; }; - BC9B82D10FB89E610035D8DA /* CPTPlotSymbol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotSymbol.m; path = Source/CPTPlotSymbol.m; sourceTree = SOURCE_ROOT; }; - BC9B82D20FB89E610035D8DA /* CPTPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlot.h; path = Source/CPTPlot.h; sourceTree = SOURCE_ROOT; }; - BC9B82D30FB89E610035D8DA /* CPTPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlot.m; path = Source/CPTPlot.m; sourceTree = SOURCE_ROOT; }; - BC9B82D40FB89E610035D8DA /* CPTScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTScatterPlot.h; path = Source/CPTScatterPlot.h; sourceTree = SOURCE_ROOT; }; - BC9B82D50FB89E610035D8DA /* CPTScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTScatterPlot.m; path = Source/CPTScatterPlot.m; sourceTree = SOURCE_ROOT; }; - BC9B82DA0FB89E610035D8DA /* CPTBarPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTBarPlot.h; path = Source/CPTBarPlot.h; sourceTree = SOURCE_ROOT; }; - BC9B82DB0FB89E610035D8DA /* CPTBarPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTBarPlot.m; path = Source/CPTBarPlot.m; sourceTree = SOURCE_ROOT; }; - BC9B83470FB8A0A40035D8DA /* libCorePlot-CocoaTouch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libCorePlot-CocoaTouch.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - BC9B83C20FB8AC4B0035D8DA /* CorePlot-CocoaTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CorePlot-CocoaTouch.h"; sourceTree = SOURCE_ROOT; }; - BCC7EA3F1006BF5700B39451 /* _CPTPlainBlackTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTPlainBlackTheme.h; path = Source/_CPTPlainBlackTheme.h; sourceTree = ""; }; - BCC7EA401006BF5700B39451 /* _CPTPlainBlackTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTPlainBlackTheme.m; path = Source/_CPTPlainBlackTheme.m; sourceTree = ""; }; - BCC7EA411006BF5700B39451 /* _CPTPlainWhiteTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTPlainWhiteTheme.h; path = Source/_CPTPlainWhiteTheme.h; sourceTree = ""; }; - BCC7EA421006BF5700B39451 /* _CPTPlainWhiteTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTPlainWhiteTheme.m; path = Source/_CPTPlainWhiteTheme.m; sourceTree = ""; }; - BCC7EA431006BF5700B39451 /* _CPTStocksTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTStocksTheme.h; path = Source/_CPTStocksTheme.h; sourceTree = ""; }; - BCC7EA441006BF5700B39451 /* _CPTStocksTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTStocksTheme.m; path = Source/_CPTStocksTheme.m; sourceTree = ""; }; - C302230B1BB8B49700514011 /* CorePlotDebug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotDebug.xcconfig; path = xcconfig/CorePlotDebug.xcconfig; sourceTree = ""; }; - C302230C1BB8B49700514011 /* CorePlotRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotRelease.xcconfig; path = xcconfig/CorePlotRelease.xcconfig; sourceTree = ""; }; - C304565213F4AC9A004D04BC /* _CPTDarkGradientTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTDarkGradientTheme.h; path = Source/_CPTDarkGradientTheme.h; sourceTree = ""; }; - C30550E71399BE2000E0151F /* CPTLegendEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLegendEntry.h; path = Source/CPTLegendEntry.h; sourceTree = ""; }; - C30550E81399BE2000E0151F /* CPTLegendEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLegendEntry.m; path = Source/CPTLegendEntry.m; sourceTree = ""; }; - C30C85A91047428100181766 /* CPTPlotGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotGroup.h; path = Source/CPTPlotGroup.h; sourceTree = ""; }; - C30C85AA1047428100181766 /* CPTPlotGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotGroup.m; path = Source/CPTPlotGroup.m; sourceTree = ""; }; - C30E97A014B290650012204A /* DoxygenLayout.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = DoxygenLayout.xml; path = ../documentation/doxygen/DoxygenLayout.xml; sourceTree = ""; }; - C318F4BF11EA18A400595FF9 /* CPTLimitBand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLimitBand.h; path = Source/CPTLimitBand.h; sourceTree = ""; }; - C318F4C011EA18A400595FF9 /* CPTLimitBand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLimitBand.m; path = Source/CPTLimitBand.m; sourceTree = ""; }; - C31908A3199813D400B61898 /* CorePlot.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlot.xcconfig; path = xcconfig/CorePlot.xcconfig; sourceTree = ""; }; - C31A40BD17ABD6C60020C5C6 /* CPTFunctionDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTFunctionDataSource.h; path = Source/CPTFunctionDataSource.h; sourceTree = ""; }; - C31A40BE17ABD6C60020C5C6 /* CPTFunctionDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTFunctionDataSource.m; path = Source/CPTFunctionDataSource.m; sourceTree = ""; }; - C3286C0515D8769800A436A8 /* _CPTMaskLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTMaskLayer.h; path = Source/_CPTMaskLayer.h; sourceTree = ""; }; - C3286C0615D8769800A436A8 /* _CPTMaskLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTMaskLayer.m; path = Source/_CPTMaskLayer.m; sourceTree = ""; }; - C32EE1BB13EC4AF900038266 /* CPTShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTShadow.h; path = Source/CPTShadow.h; sourceTree = ""; }; - C32EE1BC13EC4AF900038266 /* CPTShadow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTShadow.m; path = Source/CPTShadow.m; sourceTree = ""; }; - C32EE1C613EC4C7200038266 /* CPTMutableShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTMutableShadow.h; path = Source/CPTMutableShadow.h; sourceTree = ""; }; - C32EE1C713EC4C7200038266 /* CPTMutableShadow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTMutableShadow.m; path = Source/CPTMutableShadow.m; sourceTree = ""; }; - C3392A351225F63B008DA6BD /* CPTNumericData+TypeConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CPTNumericData+TypeConversion.m"; path = "Source/CPTNumericData+TypeConversion.m"; sourceTree = ""; }; - C3408C4415FC1CA8004F1D70 /* _CPTBorderLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTBorderLayer.h; path = Source/_CPTBorderLayer.h; sourceTree = ""; }; - C3408C4515FC1CA8004F1D70 /* _CPTBorderLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTBorderLayer.m; path = Source/_CPTBorderLayer.m; sourceTree = ""; }; - C3436C4E13F4AC4400739AC2 /* _CPTDarkGradientTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTDarkGradientTheme.m; path = Source/_CPTDarkGradientTheme.m; sourceTree = ""; }; - C3436C5013F4AC6000739AC2 /* _CPTSlateTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTSlateTheme.h; path = Source/_CPTSlateTheme.h; sourceTree = ""; }; - C349DCAE151AAFAB00BFD6A7 /* CPTCalendarFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTCalendarFormatter.h; path = Source/CPTCalendarFormatter.h; sourceTree = ""; }; - C349DCAF151AAFAB00BFD6A7 /* CPTCalendarFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTCalendarFormatter.m; path = Source/CPTCalendarFormatter.m; sourceTree = ""; }; - C34F570C19D8CE4300446248 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; - C3566B8C10EED17400FB3866 /* doxygen touch.config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "doxygen touch.config"; path = "../documentation/doxygen/doxygen touch.config"; sourceTree = SOURCE_ROOT; }; - C3566B8D10EED17400FB3866 /* doxygen-cocoa-touch-tags.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = "doxygen-cocoa-touch-tags.xml"; path = "../documentation/doxygen/doxygen-cocoa-touch-tags.xml"; sourceTree = SOURCE_ROOT; }; - C3566B8E10EED1B000FB3866 /* mainpage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mainpage.h; path = Source/mainpage.h; sourceTree = ""; }; - C35A65A311025EDF00FE24BB /* CPTPlotArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotArea.h; path = Source/CPTPlotArea.h; sourceTree = ""; }; - C35A65A411025EDF00FE24BB /* CPTPlotArea.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotArea.m; path = Source/CPTPlotArea.m; sourceTree = ""; }; - C35A65B111025F8A00FE24BB /* CPTGridLines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTGridLines.h; path = Source/CPTGridLines.h; sourceTree = ""; }; - C35A65B211025F8A00FE24BB /* CPTGridLines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTGridLines.m; path = Source/CPTGridLines.m; sourceTree = ""; }; - C35A65B511025FA900FE24BB /* CPTAxisLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAxisLabel.h; path = Source/CPTAxisLabel.h; sourceTree = ""; }; - C35A65B611025FA900FE24BB /* CPTAxisLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAxisLabel.m; path = Source/CPTAxisLabel.m; sourceTree = ""; }; - C35A65B711025FA900FE24BB /* CPTAxisTitle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAxisTitle.h; path = Source/CPTAxisTitle.h; sourceTree = ""; }; - C35A65B811025FA900FE24BB /* CPTAxisTitle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAxisTitle.m; path = Source/CPTAxisTitle.m; sourceTree = ""; }; - C35A65BD11025FB300FE24BB /* CPTAxisLabelGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAxisLabelGroup.h; path = Source/CPTAxisLabelGroup.h; sourceTree = ""; }; - C35A65BE11025FB300FE24BB /* CPTAxisLabelGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAxisLabelGroup.m; path = Source/CPTAxisLabelGroup.m; sourceTree = ""; }; - C35A65C111025FCC00FE24BB /* CPTXYAxis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTXYAxis.h; path = Source/CPTXYAxis.h; sourceTree = ""; }; - C35A65C211025FCC00FE24BB /* CPTXYAxis.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTXYAxis.m; path = Source/CPTXYAxis.m; sourceTree = ""; }; - C35A65C311025FCC00FE24BB /* CPTXYAxisSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTXYAxisSet.h; path = Source/CPTXYAxisSet.h; sourceTree = ""; }; - C35A65C411025FCC00FE24BB /* CPTXYAxisSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTXYAxisSet.m; path = Source/CPTXYAxisSet.m; sourceTree = ""; }; - C35A66051102723E00FE24BB /* CPTTextStylePlatformSpecific.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTextStylePlatformSpecific.h; path = iPhoneOnly/CPTTextStylePlatformSpecific.h; sourceTree = ""; }; - C35A66061102723E00FE24BB /* CPTTextStylePlatformSpecific.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CPTTextStylePlatformSpecific.m; path = iPhoneOnly/CPTTextStylePlatformSpecific.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3791D03191D4C2F001EC514 /* CPTImagePlatformSpecific.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CPTImagePlatformSpecific.m; path = iPhoneOnly/CPTImagePlatformSpecific.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C38DD49511A04B99002A68E7 /* CPTGridLineGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTGridLineGroup.h; path = Source/CPTGridLineGroup.h; sourceTree = ""; }; - C38DD49611A04B99002A68E7 /* CPTGridLineGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTGridLineGroup.m; path = Source/CPTGridLineGroup.m; sourceTree = ""; }; - C3920ACD1395B7680045F3BB /* CPTLegend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLegend.h; path = Source/CPTLegend.h; sourceTree = ""; }; - C3920ACE1395B7680045F3BB /* CPTLegend.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLegend.m; path = Source/CPTLegend.m; sourceTree = ""; }; - C3978E0E13CE65C600A420D9 /* NSCoderExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSCoderExtensions.h; path = Source/NSCoderExtensions.h; sourceTree = ""; }; - C3978E0F13CE65C600A420D9 /* NSCoderExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSCoderExtensions.m; path = Source/NSCoderExtensions.m; sourceTree = ""; }; - C3A695DF146A196100AF5653 /* CPTMutablePlotRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTMutablePlotRange.h; path = Source/CPTMutablePlotRange.h; sourceTree = ""; }; - C3A695E0146A196100AF5653 /* CPTMutablePlotRange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTMutablePlotRange.m; path = Source/CPTMutablePlotRange.m; sourceTree = ""; }; - C3B25EE11AC23A930063CCD8 /* CorePlot.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CorePlot.h; sourceTree = ""; }; - C3C68318166138E200340E39 /* CPTAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAnimation.h; path = Source/CPTAnimation.h; sourceTree = ""; }; - C3C68319166138E200340E39 /* CPTAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAnimation.m; path = Source/CPTAnimation.m; sourceTree = ""; }; - C3C6831A166138E200340E39 /* CPTAnimationOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAnimationOperation.h; path = Source/CPTAnimationOperation.h; sourceTree = ""; }; - C3C6831B166138E200340E39 /* CPTAnimationOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAnimationOperation.m; path = Source/CPTAnimationOperation.m; sourceTree = ""; }; - C3C6831C166138E200340E39 /* CPTAnimationPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAnimationPeriod.h; path = Source/CPTAnimationPeriod.h; sourceTree = ""; }; - C3C6831D166138E200340E39 /* CPTAnimationPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAnimationPeriod.m; path = Source/CPTAnimationPeriod.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3C6831E166138E200340E39 /* _CPTAnimationTimingFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationTimingFunctions.h; path = Source/_CPTAnimationTimingFunctions.h; sourceTree = ""; }; - C3C6831F166138E200340E39 /* _CPTAnimationTimingFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationTimingFunctions.m; path = Source/_CPTAnimationTimingFunctions.m; sourceTree = ""; }; - C3C683281661391A00340E39 /* _CPTAnimationCGFloatPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationCGFloatPeriod.h; path = Source/_CPTAnimationCGFloatPeriod.h; sourceTree = ""; }; - C3C683291661391A00340E39 /* _CPTAnimationCGFloatPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationCGFloatPeriod.m; path = Source/_CPTAnimationCGFloatPeriod.m; sourceTree = ""; }; - C3C6832A1661391A00340E39 /* _CPTAnimationCGPointPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationCGPointPeriod.h; path = Source/_CPTAnimationCGPointPeriod.h; sourceTree = ""; }; - C3C6832B1661391A00340E39 /* _CPTAnimationCGPointPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationCGPointPeriod.m; path = Source/_CPTAnimationCGPointPeriod.m; sourceTree = ""; }; - C3C6832C1661391A00340E39 /* _CPTAnimationCGRectPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationCGRectPeriod.h; path = Source/_CPTAnimationCGRectPeriod.h; sourceTree = ""; }; - C3C6832D1661391A00340E39 /* _CPTAnimationCGRectPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationCGRectPeriod.m; path = Source/_CPTAnimationCGRectPeriod.m; sourceTree = ""; }; - C3C6832E1661391A00340E39 /* _CPTAnimationCGSizePeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationCGSizePeriod.h; path = Source/_CPTAnimationCGSizePeriod.h; sourceTree = ""; }; - C3C6832F1661391A00340E39 /* _CPTAnimationCGSizePeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationCGSizePeriod.m; path = Source/_CPTAnimationCGSizePeriod.m; sourceTree = ""; }; - C3C683301661391A00340E39 /* _CPTAnimationNSDecimalPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationNSDecimalPeriod.h; path = Source/_CPTAnimationNSDecimalPeriod.h; sourceTree = ""; }; - C3C683311661391A00340E39 /* _CPTAnimationNSDecimalPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationNSDecimalPeriod.m; path = Source/_CPTAnimationNSDecimalPeriod.m; sourceTree = ""; }; - C3C683321661391A00340E39 /* _CPTAnimationPlotRangePeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationPlotRangePeriod.h; path = Source/_CPTAnimationPlotRangePeriod.h; sourceTree = ""; }; - C3C683331661391A00340E39 /* _CPTAnimationPlotRangePeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationPlotRangePeriod.m; path = Source/_CPTAnimationPlotRangePeriod.m; sourceTree = ""; }; - C3CADE2F11B1886B00D36017 /* license.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = license.txt; path = Source/license.txt; sourceTree = ""; }; - C3CADE3011B188A800D36017 /* CPTNumericData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTNumericData.h; path = Source/CPTNumericData.h; sourceTree = ""; }; - C3CADE3111B188A800D36017 /* CPTNumericData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTNumericData.m; path = Source/CPTNumericData.m; sourceTree = ""; }; - C3CADE3211B188A800D36017 /* CPTNumericData+TypeConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CPTNumericData+TypeConversion.h"; path = "Source/CPTNumericData+TypeConversion.h"; sourceTree = ""; }; - C3CADE3411B188A800D36017 /* CPTNumericData+TypeConversions_Generation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = "CPTNumericData+TypeConversions_Generation.py"; path = "Source/CPTNumericData+TypeConversions_Generation.py"; sourceTree = ""; }; - C3CADE3911B188B600D36017 /* CPTNumericDataType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTNumericDataType.h; path = Source/CPTNumericDataType.h; sourceTree = ""; }; - C3CADE3A11B188B600D36017 /* CPTNumericDataType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTNumericDataType.m; path = Source/CPTNumericDataType.m; sourceTree = ""; }; - C3CADE3D11B188C500D36017 /* CPTMutableNumericData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTMutableNumericData.h; path = Source/CPTMutableNumericData.h; sourceTree = ""; }; - C3CADE3E11B188C500D36017 /* CPTMutableNumericData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTMutableNumericData.m; path = Source/CPTMutableNumericData.m; sourceTree = ""; }; - C3CAFB391229E48200F5C989 /* CPTMutableNumericData+TypeConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CPTMutableNumericData+TypeConversion.h"; path = "Source/CPTMutableNumericData+TypeConversion.h"; sourceTree = ""; }; - C3CAFB3A1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CPTMutableNumericData+TypeConversion.m"; path = "Source/CPTMutableNumericData+TypeConversion.m"; sourceTree = ""; }; - C3CCA04413E8D94800CE6DB1 /* _CPTConstraintsFixed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTConstraintsFixed.h; path = Source/_CPTConstraintsFixed.h; sourceTree = ""; }; - C3CCA04513E8D94800CE6DB1 /* _CPTConstraintsFixed.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTConstraintsFixed.m; path = Source/_CPTConstraintsFixed.m; sourceTree = ""; }; - C3CCA04613E8D94800CE6DB1 /* _CPTConstraintsRelative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTConstraintsRelative.h; path = Source/_CPTConstraintsRelative.h; sourceTree = ""; }; - C3CCA04713E8D94800CE6DB1 /* _CPTConstraintsRelative.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTConstraintsRelative.m; path = Source/_CPTConstraintsRelative.m; sourceTree = ""; }; - C3CD282717DE957C008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - C3D3AD3213DF8E9D0004EA73 /* CPTLineCap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLineCap.h; path = Source/CPTLineCap.h; sourceTree = ""; }; - C3D3AD3313DF8E9D0004EA73 /* CPTLineCap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLineCap.m; path = Source/CPTLineCap.m; sourceTree = ""; }; - C3D9825016BD406600DE7977 /* CorePlot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorePlot_Prefix.pch; sourceTree = ""; }; - C40CFB92107EC1B40057E828 /* _CPTXYTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTXYTheme.h; path = Source/_CPTXYTheme.h; sourceTree = ""; }; - C40CFB93107EC1B40057E828 /* _CPTXYTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTXYTheme.m; path = Source/_CPTXYTheme.m; sourceTree = ""; }; - D0C047BD12D6568500DA8047 /* CPTRangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTRangePlot.m; path = Source/CPTRangePlot.m; sourceTree = ""; }; - D0C047BE12D6568500DA8047 /* CPTRangePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTRangePlot.h; path = Source/CPTRangePlot.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - BC9B83450FB8A0A40035D8DA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - BC9B836E0FB8A1700035D8DA /* QuartzCore.framework in Frameworks */, - BC9B836F0FB8A1700035D8DA /* UIKit.framework in Frameworks */, - BC9B83700FB8A1700035D8DA /* Foundation.framework in Frameworks */, - BC9B83710FB8A1700035D8DA /* CoreGraphics.framework in Frameworks */, - C3CD282817DE957C008EED1E /* Accelerate.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 070CB80F0FC9DDD500F3152B /* Drawing */ = { - isa = PBXGroup; - children = ( - 070CB8300FC9DEA800F3152B /* CPTColor.h */, - 070CB8310FC9DEA800F3152B /* CPTColor.m */, - 070CB8320FC9DEA800F3152B /* CPTColorSpace.h */, - 070CB8330FC9DEA800F3152B /* CPTColorSpace.m */, - BC9B82980FB89E610035D8DA /* CPTGradient.h */, - BC9B82990FB89E610035D8DA /* CPTGradient.m */, - BC9B829A0FB89E610035D8DA /* CPTImage.h */, - BC9B829B0FB89E610035D8DA /* CPTImage.m */, - C3D3AD3213DF8E9D0004EA73 /* CPTLineCap.h */, - C3D3AD3313DF8E9D0004EA73 /* CPTLineCap.m */, - BC9B829C0FB89E610035D8DA /* CPTLineStyle.h */, - BC9B829D0FB89E610035D8DA /* CPTLineStyle.m */, - 07B69B6F12B62E9600F4C16C /* CPTMutableLineStyle.h */, - 07B69B7012B62E9600F4C16C /* CPTMutableLineStyle.m */, - 077F28530FE18048000BCA52 /* CPTPathExtensions.h */, - 077F28540FE18048000BCA52 /* CPTPathExtensions.m */, - C32EE1BB13EC4AF900038266 /* CPTShadow.h */, - C32EE1BC13EC4AF900038266 /* CPTShadow.m */, - C32EE1C613EC4C7200038266 /* CPTMutableShadow.h */, - C32EE1C713EC4C7200038266 /* CPTMutableShadow.m */, - BC9B82870FB89E610035D8DA /* Fills */, - C32DDEE3191C674600E0FE84 /* iPhone Specific */, - ); - name = Drawing; - sourceTree = ""; - }; - 070CB8100FC9DDED00F3152B /* Text */ = { - isa = PBXGroup; - children = ( - BC9B829E0FB89E610035D8DA /* CPTTextLayer.h */, - BC9B829F0FB89E610035D8DA /* CPTTextLayer.m */, - 07A62FB30FE2234900CD765C /* CPTTextStyle.h */, - 07A62FB40FE2234900CD765C /* CPTTextStyle.m */, - 07B69AB712B6281100F4C16C /* CPTMutableTextStyle.h */, - 07B69AB812B6281100F4C16C /* CPTMutableTextStyle.m */, - C35A6602110271EB00FE24BB /* iPhone Specific */, - ); - name = Text; - sourceTree = ""; - }; - 070CB8380FC9DEB900F3152B /* Axes */ = { - isa = PBXGroup; - children = ( - 070CB8390FC9DED400F3152B /* CPTAxis.h */, - 070CB83A0FC9DED400F3152B /* CPTAxis.m */, - 070CB83D0FC9DED400F3152B /* CPTAxisSet.h */, - 070CB83E0FC9DED400F3152B /* CPTAxisSet.m */, - C35A65B111025F8A00FE24BB /* CPTGridLines.h */, - C35A65B211025F8A00FE24BB /* CPTGridLines.m */, - C38DD49511A04B99002A68E7 /* CPTGridLineGroup.h */, - C38DD49611A04B99002A68E7 /* CPTGridLineGroup.m */, - C35A65A811025F2000FE24BB /* Labels */, - C35A65A911025F2B00FE24BB /* XY Axes */, - ); - name = Axes; - sourceTree = ""; - }; - 0718DE4411D1ED7D00AF4851 /* Annotations */ = { - isa = PBXGroup; - children = ( - 0718DE4511D1EDBA00AF4851 /* CPTAnnotation.h */, - 0718DE4611D1EDBA00AF4851 /* CPTAnnotation.m */, - 0718DE4711D1EDBA00AF4851 /* CPTAnnotationHostLayer.h */, - 0718DE4811D1EDBA00AF4851 /* CPTAnnotationHostLayer.m */, - 0718DE4911D1EDBA00AF4851 /* CPTLayerAnnotation.h */, - 0718DE4A11D1EDBA00AF4851 /* CPTLayerAnnotation.m */, - 0718DE4B11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.h */, - 0718DE4C11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.m */, - ); - name = Annotations; - sourceTree = ""; - }; - 072E3F980FE2FF3E00ACF62F /* Themes */ = { - isa = PBXGroup; - children = ( - 072E3F9B0FE2FF7300ACF62F /* CPTTheme.h */, - 072E3F9C0FE2FF7300ACF62F /* CPTTheme.m */, - C40CFB92107EC1B40057E828 /* _CPTXYTheme.h */, - C40CFB93107EC1B40057E828 /* _CPTXYTheme.m */, - C304565213F4AC9A004D04BC /* _CPTDarkGradientTheme.h */, - C3436C4E13F4AC4400739AC2 /* _CPTDarkGradientTheme.m */, - BCC7EA3F1006BF5700B39451 /* _CPTPlainBlackTheme.h */, - BCC7EA401006BF5700B39451 /* _CPTPlainBlackTheme.m */, - BCC7EA411006BF5700B39451 /* _CPTPlainWhiteTheme.h */, - BCC7EA421006BF5700B39451 /* _CPTPlainWhiteTheme.m */, - C3436C5013F4AC6000739AC2 /* _CPTSlateTheme.h */, - 07FCF2D2115B54DE00E46606 /* _CPTSlateTheme.m */, - BCC7EA431006BF5700B39451 /* _CPTStocksTheme.h */, - BCC7EA441006BF5700B39451 /* _CPTStocksTheme.m */, - ); - name = Themes; - sourceTree = ""; - }; - 077F28500FE18011000BCA52 /* Layers */ = { - isa = PBXGroup; - children = ( - BC9B826F0FB89E610035D8DA /* CPTLayer.h */, - BC9B82700FB89E610035D8DA /* CPTLayer.m */, - 077F28510FE18048000BCA52 /* CPTBorderedLayer.h */, - 077F28520FE18048000BCA52 /* CPTBorderedLayer.m */, - C3408C4415FC1CA8004F1D70 /* _CPTBorderLayer.h */, - C3408C4515FC1CA8004F1D70 /* _CPTBorderLayer.m */, - C3286C0515D8769800A436A8 /* _CPTMaskLayer.h */, - C3286C0615D8769800A436A8 /* _CPTMaskLayer.m */, - 07AEF30110BBF99A0012BEFF /* CPTResponder.h */, - ); - name = Layers; - sourceTree = ""; - }; - 0789EFB70FB9F97F00C0A613 /* iPhone Specific */ = { - isa = PBXGroup; - children = ( - 0789EFBA0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.h */, - 0789EFBB0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.m */, - 0789EFB80FB9F97F00C0A613 /* CPTPlatformSpecificCategories.h */, - 0789EFB90FB9F97F00C0A613 /* CPTPlatformSpecificCategories.m */, - 0789EFBC0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.h */, - 0789EFBD0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.m */, - BC79F1D30FD1DC1A00510976 /* CPTGraphHostingView.h */, - BC79F1D40FD1DC1A00510976 /* CPTGraphHostingView.m */, - ); - name = "iPhone Specific"; - path = iPhoneOnly; - sourceTree = ""; - }; - 07A2E717102DF9A500809BC5 /* Formatters */ = { - isa = PBXGroup; - children = ( - C349DCAE151AAFAB00BFD6A7 /* CPTCalendarFormatter.h */, - C349DCAF151AAFAB00BFD6A7 /* CPTCalendarFormatter.m */, - 07A2E71C102DFAD300809BC5 /* CPTTimeFormatter.h */, - 07A2E71D102DFAD300809BC5 /* CPTTimeFormatter.m */, - ); - name = Formatters; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - BC9B83470FB8A0A40035D8DA /* libCorePlot-CocoaTouch.a */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - BC9B82520FB89B420035D8DA /* Source */, - 0789EFB70FB9F97F00C0A613 /* iPhone Specific */, - C3566B8610EED12700FB3866 /* Documentation */, - C3B25EE01AC23A930063CCD8 /* CocoaPods */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - indentWidth = 4; - name = CustomTemplate; - sourceTree = ""; - tabWidth = 4; - usesTabs = 0; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - BC89A7991024AB19009D5261 /* CorePlotProbes.d */, - BC9B83C20FB8AC4B0035D8DA /* CorePlot-CocoaTouch.h */, - C3D9825016BD406600DE7977 /* CorePlot_Prefix.pch */, - C302230B1BB8B49700514011 /* CorePlotDebug.xcconfig */, - C302230C1BB8B49700514011 /* CorePlotRelease.xcconfig */, - C31908A3199813D400B61898 /* CorePlot.xcconfig */, - C34F570C19D8CE4300446248 /* CorePlotWarnings.xcconfig */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 071F3CDF10FBAB9D00D0A7B6 /* License.txt */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - BC9B82690FB89BD10035D8DA /* QuartzCore.framework */, - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, - 1D30AB110D05D00D00671497 /* Foundation.framework */, - 288765A40DF7441C002DB57D /* CoreGraphics.framework */, - C3CD282717DE957C008EED1E /* Accelerate.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - BC9B82520FB89B420035D8DA /* Source */ = { - isa = PBXGroup; - children = ( - C3CADE2911B1885200D36017 /* Numeric Data */, - BC9B82A20FB89E610035D8DA /* Types and Functions */, - 077F28500FE18011000BCA52 /* Layers */, - C3C68316166138B500340E39 /* Animation */, - 0718DE4411D1ED7D00AF4851 /* Annotations */, - C3B623A9107EC5460009EF0B /* Layout */, - 070CB8100FC9DDED00F3152B /* Text */, - 070CB80F0FC9DDD500F3152B /* Drawing */, - 07A2E717102DF9A500809BC5 /* Formatters */, - BC9B82B00FB89E610035D8DA /* Categories */, - BC9B82B50FB89E610035D8DA /* Graphs */, - BC9B82C00FB89E610035D8DA /* Plot Areas */, - BC9B82C50FB89E610035D8DA /* Spaces */, - BC9B82CE0FB89E610035D8DA /* Plots */, - 070CB8380FC9DEB900F3152B /* Axes */, - C3920ACC1395B7410045F3BB /* Legends */, - 072E3F980FE2FF3E00ACF62F /* Themes */, - ); - name = Source; - sourceTree = ""; - }; - BC9B82870FB89E610035D8DA /* Fills */ = { - isa = PBXGroup; - children = ( - BC9B82880FB89E610035D8DA /* CPTFill.h */, - BC9B82890FB89E610035D8DA /* CPTFill.m */, - BC9B828A0FB89E610035D8DA /* _CPTFillColor.h */, - BC9B828B0FB89E610035D8DA /* _CPTFillColor.m */, - BC9B828C0FB89E610035D8DA /* _CPTFillGradient.h */, - BC9B828D0FB89E610035D8DA /* _CPTFillGradient.m */, - BC9B828E0FB89E610035D8DA /* _CPTFillImage.h */, - BC9B828F0FB89E610035D8DA /* _CPTFillImage.m */, - ); - name = Fills; - sourceTree = ""; - }; - BC9B82A20FB89E610035D8DA /* Types and Functions */ = { - isa = PBXGroup; - children = ( - BC9B82A30FB89E610035D8DA /* CPTDefinitions.h */, - BC9B82A40FB89E610035D8DA /* CPTDefinitions.m */, - BC9B82A50FB89E610035D8DA /* CPTExceptions.h */, - BC9B82A60FB89E610035D8DA /* CPTExceptions.m */, - BC9B82A70FB89E610035D8DA /* CPTUtilities.h */, - BC9B82A80FB89E610035D8DA /* CPTUtilities.m */, - BC9B82AB0FB89E610035D8DA /* CPTPlotRange.h */, - BC9B82AC0FB89E610035D8DA /* CPTPlotRange.m */, - C3A695DF146A196100AF5653 /* CPTMutablePlotRange.h */, - C3A695E0146A196100AF5653 /* CPTMutablePlotRange.m */, - C31A40BD17ABD6C60020C5C6 /* CPTFunctionDataSource.h */, - C31A40BE17ABD6C60020C5C6 /* CPTFunctionDataSource.m */, - ); - name = "Types and Functions"; - sourceTree = SOURCE_ROOT; - }; - BC9B82B00FB89E610035D8DA /* Categories */ = { - isa = PBXGroup; - children = ( - C3978E0E13CE65C600A420D9 /* NSCoderExtensions.h */, - C3978E0F13CE65C600A420D9 /* NSCoderExtensions.m */, - BC9B82B10FB89E610035D8DA /* NSDecimalNumberExtensions.h */, - BC9B82B20FB89E610035D8DA /* NSDecimalNumberExtensions.m */, - BC9B82B30FB89E610035D8DA /* NSNumberExtensions.h */, - BC9B82B40FB89E610035D8DA /* NSNumberExtensions.m */, - ); - name = Categories; - sourceTree = SOURCE_ROOT; - }; - BC9B82B50FB89E610035D8DA /* Graphs */ = { - isa = PBXGroup; - children = ( - BC9B82B60FB89E610035D8DA /* CPTGraph.h */, - BC9B82B70FB89E610035D8DA /* CPTGraph.m */, - BC9B82B80FB89E610035D8DA /* CPTXYGraph.h */, - BC9B82B90FB89E610035D8DA /* CPTXYGraph.m */, - ); - name = Graphs; - sourceTree = ""; - }; - BC9B82C00FB89E610035D8DA /* Plot Areas */ = { - isa = PBXGroup; - children = ( - BC9B82C10FB89E610035D8DA /* CPTPlotAreaFrame.h */, - BC9B82C20FB89E610035D8DA /* CPTPlotAreaFrame.m */, - C35A65A311025EDF00FE24BB /* CPTPlotArea.h */, - C35A65A411025EDF00FE24BB /* CPTPlotArea.m */, - C318F4BF11EA18A400595FF9 /* CPTLimitBand.h */, - C318F4C011EA18A400595FF9 /* CPTLimitBand.m */, - ); - name = "Plot Areas"; - sourceTree = SOURCE_ROOT; - }; - BC9B82C50FB89E610035D8DA /* Spaces */ = { - isa = PBXGroup; - children = ( - BC9B82C60FB89E610035D8DA /* CPTPlotSpace.h */, - BC9B82C70FB89E610035D8DA /* CPTPlotSpace.m */, - 074D7BC30FD6B65E006011BC /* CPTXYPlotSpace.h */, - 074D7BC40FD6B65F006011BC /* CPTXYPlotSpace.m */, - ); - name = Spaces; - sourceTree = SOURCE_ROOT; - }; - BC9B82CE0FB89E610035D8DA /* Plots */ = { - isa = PBXGroup; - children = ( - C30C85A91047428100181766 /* CPTPlotGroup.h */, - C30C85AA1047428100181766 /* CPTPlotGroup.m */, - BC9B82D20FB89E610035D8DA /* CPTPlot.h */, - BC9B82D30FB89E610035D8DA /* CPTPlot.m */, - BC9B82DA0FB89E610035D8DA /* CPTBarPlot.h */, - BC9B82DB0FB89E610035D8DA /* CPTBarPlot.m */, - BC74A2C010FC087800E7E90D /* CPTPieChart.h */, - BC74A2C110FC087800E7E90D /* CPTPieChart.m */, - D0C047BE12D6568500DA8047 /* CPTRangePlot.h */, - D0C047BD12D6568500DA8047 /* CPTRangePlot.m */, - BC9B82D40FB89E610035D8DA /* CPTScatterPlot.h */, - BC9B82D50FB89E610035D8DA /* CPTScatterPlot.m */, - 0772B4F110E26A12009CD04C /* CPTTradingRangePlot.h */, - 0772B4F210E26A12009CD04C /* CPTTradingRangePlot.m */, - BC9B82CF0FB89E610035D8DA /* Plot Symbols */, - ); - name = Plots; - sourceTree = SOURCE_ROOT; - }; - BC9B82CF0FB89E610035D8DA /* Plot Symbols */ = { - isa = PBXGroup; - children = ( - BC9B82D00FB89E610035D8DA /* CPTPlotSymbol.h */, - BC9B82D10FB89E610035D8DA /* CPTPlotSymbol.m */, - ); - name = "Plot Symbols"; - sourceTree = SOURCE_ROOT; - }; - C32DDEE3191C674600E0FE84 /* iPhone Specific */ = { - isa = PBXGroup; - children = ( - C3791D03191D4C2F001EC514 /* CPTImagePlatformSpecific.m */, - ); - name = "iPhone Specific"; - sourceTree = ""; - }; - C3566B8610EED12700FB3866 /* Documentation */ = { - isa = PBXGroup; - children = ( - C3566B8C10EED17400FB3866 /* doxygen touch.config */, - C3566B8E10EED1B000FB3866 /* mainpage.h */, - C3566B8D10EED17400FB3866 /* doxygen-cocoa-touch-tags.xml */, - C30E97A014B290650012204A /* DoxygenLayout.xml */, - ); - name = Documentation; - sourceTree = ""; - }; - C35A65A811025F2000FE24BB /* Labels */ = { - isa = PBXGroup; - children = ( - C35A65B511025FA900FE24BB /* CPTAxisLabel.h */, - C35A65B611025FA900FE24BB /* CPTAxisLabel.m */, - C35A65B711025FA900FE24BB /* CPTAxisTitle.h */, - C35A65B811025FA900FE24BB /* CPTAxisTitle.m */, - C35A65BD11025FB300FE24BB /* CPTAxisLabelGroup.h */, - C35A65BE11025FB300FE24BB /* CPTAxisLabelGroup.m */, - ); - name = Labels; - sourceTree = ""; - }; - C35A65A911025F2B00FE24BB /* XY Axes */ = { - isa = PBXGroup; - children = ( - C35A65C111025FCC00FE24BB /* CPTXYAxis.h */, - C35A65C211025FCC00FE24BB /* CPTXYAxis.m */, - C35A65C311025FCC00FE24BB /* CPTXYAxisSet.h */, - C35A65C411025FCC00FE24BB /* CPTXYAxisSet.m */, - ); - name = "XY Axes"; - sourceTree = ""; - }; - C35A6602110271EB00FE24BB /* iPhone Specific */ = { - isa = PBXGroup; - children = ( - C35A66051102723E00FE24BB /* CPTTextStylePlatformSpecific.h */, - C35A66061102723E00FE24BB /* CPTTextStylePlatformSpecific.m */, - ); - name = "iPhone Specific"; - sourceTree = ""; - }; - C3920ACC1395B7410045F3BB /* Legends */ = { - isa = PBXGroup; - children = ( - C3920ACD1395B7680045F3BB /* CPTLegend.h */, - C3920ACE1395B7680045F3BB /* CPTLegend.m */, - C30550E71399BE2000E0151F /* CPTLegendEntry.h */, - C30550E81399BE2000E0151F /* CPTLegendEntry.m */, - ); - name = Legends; - sourceTree = ""; - }; - C3B25EE01AC23A930063CCD8 /* CocoaPods */ = { - isa = PBXGroup; - children = ( - C3B25EE11AC23A930063CCD8 /* CorePlot.h */, - ); - path = CocoaPods; - sourceTree = ""; - }; - C3B623A9107EC5460009EF0B /* Layout */ = { - isa = PBXGroup; - children = ( - 074FADF7112024C500394B90 /* CPTConstraints.h */, - 074FADF8112024C500394B90 /* CPTConstraints.m */, - C3CCA04413E8D94800CE6DB1 /* _CPTConstraintsFixed.h */, - C3CCA04513E8D94800CE6DB1 /* _CPTConstraintsFixed.m */, - C3CCA04613E8D94800CE6DB1 /* _CPTConstraintsRelative.h */, - C3CCA04713E8D94800CE6DB1 /* _CPTConstraintsRelative.m */, - ); - name = Layout; - sourceTree = ""; - }; - C3C68316166138B500340E39 /* Animation */ = { - isa = PBXGroup; - children = ( - C3C68318166138E200340E39 /* CPTAnimation.h */, - C3C68319166138E200340E39 /* CPTAnimation.m */, - C3C6831A166138E200340E39 /* CPTAnimationOperation.h */, - C3C6831B166138E200340E39 /* CPTAnimationOperation.m */, - C3C6831C166138E200340E39 /* CPTAnimationPeriod.h */, - C3C6831D166138E200340E39 /* CPTAnimationPeriod.m */, - C3C683281661391A00340E39 /* _CPTAnimationCGFloatPeriod.h */, - C3C683291661391A00340E39 /* _CPTAnimationCGFloatPeriod.m */, - C3C6832A1661391A00340E39 /* _CPTAnimationCGPointPeriod.h */, - C3C6832B1661391A00340E39 /* _CPTAnimationCGPointPeriod.m */, - C3C6832C1661391A00340E39 /* _CPTAnimationCGRectPeriod.h */, - C3C6832D1661391A00340E39 /* _CPTAnimationCGRectPeriod.m */, - C3C6832E1661391A00340E39 /* _CPTAnimationCGSizePeriod.h */, - C3C6832F1661391A00340E39 /* _CPTAnimationCGSizePeriod.m */, - C3C683301661391A00340E39 /* _CPTAnimationNSDecimalPeriod.h */, - C3C683311661391A00340E39 /* _CPTAnimationNSDecimalPeriod.m */, - C3C683321661391A00340E39 /* _CPTAnimationPlotRangePeriod.h */, - C3C683331661391A00340E39 /* _CPTAnimationPlotRangePeriod.m */, - C3C6831E166138E200340E39 /* _CPTAnimationTimingFunctions.h */, - C3C6831F166138E200340E39 /* _CPTAnimationTimingFunctions.m */, - ); - name = Animation; - sourceTree = ""; - }; - C3CADE2911B1885200D36017 /* Numeric Data */ = { - isa = PBXGroup; - children = ( - C3CADE2F11B1886B00D36017 /* license.txt */, - C3CADE3911B188B600D36017 /* CPTNumericDataType.h */, - C3CADE3A11B188B600D36017 /* CPTNumericDataType.m */, - C3CADE3011B188A800D36017 /* CPTNumericData.h */, - C3CADE3111B188A800D36017 /* CPTNumericData.m */, - C3CADE3D11B188C500D36017 /* CPTMutableNumericData.h */, - C3CADE3E11B188C500D36017 /* CPTMutableNumericData.m */, - C3CADE3211B188A800D36017 /* CPTNumericData+TypeConversion.h */, - C3392A351225F63B008DA6BD /* CPTNumericData+TypeConversion.m */, - C3CAFB391229E48200F5C989 /* CPTMutableNumericData+TypeConversion.h */, - C3CAFB3A1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.m */, - C3CADE3411B188A800D36017 /* CPTNumericData+TypeConversions_Generation.py */, - ); - name = "Numeric Data"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - BC9B83430FB8A0A40035D8DA /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - BC9B83C30FB8AC4B0035D8DA /* CorePlot-CocoaTouch.h in Headers */, - 070CB8430FC9DED400F3152B /* CPTAxis.h in Headers */, - 070CB8470FC9DED400F3152B /* CPTAxisSet.h in Headers */, - 070CB8340FC9DEA800F3152B /* CPTColor.h in Headers */, - 070CB8360FC9DEA800F3152B /* CPTColorSpace.h in Headers */, - 0789EFC00FB9F97F00C0A613 /* CPTPlatformSpecificDefines.h in Headers */, - 0789EFBE0FB9F97F00C0A613 /* CPTPlatformSpecificCategories.h in Headers */, - 0789EFC20FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.h in Headers */, - BC79F1D50FD1DC1A00510976 /* CPTGraphHostingView.h in Headers */, - 074D7BC50FD6B65F006011BC /* CPTXYPlotSpace.h in Headers */, - 077F28550FE18048000BCA52 /* CPTBorderedLayer.h in Headers */, - 077F28570FE18048000BCA52 /* CPTPathExtensions.h in Headers */, - 07A62FB50FE2234900CD765C /* CPTTextStyle.h in Headers */, - 072E3F9F0FE2FF7300ACF62F /* CPTTheme.h in Headers */, - 07A2E71E102DFAD300809BC5 /* CPTTimeFormatter.h in Headers */, - 07A5E24C104E47E900B7AB80 /* CPTTextLayer.h in Headers */, - C3B623C0107EC9370009EF0B /* CPTBarPlot.h in Headers */, - BC74A2C210FC087800E7E90D /* CPTPieChart.h in Headers */, - C3B623C1107EC9400009EF0B /* CPTDefinitions.h in Headers */, - C3B623C2107EC9430009EF0B /* CPTExceptions.h in Headers */, - C3B623C3107EC94D0009EF0B /* CPTFill.h in Headers */, - C3B623C4107EC94E0009EF0B /* CPTGradient.h in Headers */, - C3B623C5107EC9500009EF0B /* CPTGraph.h in Headers */, - C3B623C6107EC9510009EF0B /* CPTImage.h in Headers */, - C3B623C7107EC9540009EF0B /* CPTLayer.h in Headers */, - C3B623C8107EC9570009EF0B /* CPTLineStyle.h in Headers */, - C3B623C9107EC95C0009EF0B /* CPTPlot.h in Headers */, - C3B623CA107EC95E0009EF0B /* CPTPlotAreaFrame.h in Headers */, - C3B623CB107EC9610009EF0B /* CPTPlotRange.h in Headers */, - C3B623CC107EC9620009EF0B /* CPTPlotSpace.h in Headers */, - C3B623CD107EC9630009EF0B /* CPTPlotSymbol.h in Headers */, - C3B623CF107EC9680009EF0B /* CPTScatterPlot.h in Headers */, - C3B623D1107EC96E0009EF0B /* CPTUtilities.h in Headers */, - C3B623D2107EC9760009EF0B /* CPTXYGraph.h in Headers */, - 07AEF30310BBF99A0012BEFF /* CPTResponder.h in Headers */, - 0772B4F310E26A12009CD04C /* CPTTradingRangePlot.h in Headers */, - 074FADF9112024C500394B90 /* CPTConstraints.h in Headers */, - C35A65A511025EDF00FE24BB /* CPTPlotArea.h in Headers */, - C35A65B911025FA900FE24BB /* CPTAxisLabel.h in Headers */, - C35A65BB11025FA900FE24BB /* CPTAxisTitle.h in Headers */, - C35A65C711025FCC00FE24BB /* CPTXYAxis.h in Headers */, - C35A65C911025FCC00FE24BB /* CPTXYAxisSet.h in Headers */, - 0718DE4D11D1EDBA00AF4851 /* CPTAnnotation.h in Headers */, - 0718DE4F11D1EDBA00AF4851 /* CPTAnnotationHostLayer.h in Headers */, - 0718DE5111D1EDBA00AF4851 /* CPTLayerAnnotation.h in Headers */, - 0718DE5311D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.h in Headers */, - C318F4C111EA18A400595FF9 /* CPTLimitBand.h in Headers */, - C3D68B091221650C00EB4863 /* CPTMutableNumericData.h in Headers */, - C3D68B0B1221650E00EB4863 /* CPTNumericData+TypeConversion.h in Headers */, - C3D68B0D1221651200EB4863 /* CPTNumericData.h in Headers */, - C3D68B0F1221651500EB4863 /* CPTNumericDataType.h in Headers */, - C3CAFB3B1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.h in Headers */, - 07B69AB912B6281100F4C16C /* CPTMutableTextStyle.h in Headers */, - 07B69B7112B62E9600F4C16C /* CPTMutableLineStyle.h in Headers */, - D0C047C012D6568500DA8047 /* CPTRangePlot.h in Headers */, - C3920ACF1395B7680045F3BB /* CPTLegend.h in Headers */, - C30550E91399BE2000E0151F /* CPTLegendEntry.h in Headers */, - C3D3AD3413DF8E9D0004EA73 /* CPTLineCap.h in Headers */, - C32EE1BD13EC4AF900038266 /* CPTShadow.h in Headers */, - C32EE1C813EC4C7200038266 /* CPTMutableShadow.h in Headers */, - C3A695E1146A196100AF5653 /* CPTMutablePlotRange.h in Headers */, - C349DCB0151AAFAB00BFD6A7 /* CPTCalendarFormatter.h in Headers */, - C35A66071102723E00FE24BB /* CPTTextStylePlatformSpecific.h in Headers */, - C3286C0715D8769800A436A8 /* _CPTMaskLayer.h in Headers */, - C3408C4615FC1CA8004F1D70 /* _CPTBorderLayer.h in Headers */, - BCC7EA451006BF5700B39451 /* _CPTPlainBlackTheme.h in Headers */, - BCC7EA471006BF5700B39451 /* _CPTPlainWhiteTheme.h in Headers */, - BCC7EA491006BF5700B39451 /* _CPTStocksTheme.h in Headers */, - C40CFB94107EC1B40057E828 /* _CPTXYTheme.h in Headers */, - C3B623D4107EC9800009EF0B /* _CPTFillColor.h in Headers */, - C3B623D5107EC9820009EF0B /* _CPTFillGradient.h in Headers */, - C3B623D6107EC9830009EF0B /* _CPTFillImage.h in Headers */, - C3CCA04813E8D94800CE6DB1 /* _CPTConstraintsFixed.h in Headers */, - C3CCA04A13E8D94800CE6DB1 /* _CPTConstraintsRelative.h in Headers */, - C3436C5113F4AC6000739AC2 /* _CPTSlateTheme.h in Headers */, - C304565313F4AC9A004D04BC /* _CPTDarkGradientTheme.h in Headers */, - C35A65BF11025FB300FE24BB /* CPTAxisLabelGroup.h in Headers */, - C38DD49711A04B99002A68E7 /* CPTGridLineGroup.h in Headers */, - C35A65B311025F8A00FE24BB /* CPTGridLines.h in Headers */, - C30C85AB1047428100181766 /* CPTPlotGroup.h in Headers */, - C3978E1013CE65C600A420D9 /* NSCoderExtensions.h in Headers */, - BC4FAF29100D7DF300811DD3 /* NSDecimalNumberExtensions.h in Headers */, - C3B623D3107EC97A0009EF0B /* NSNumberExtensions.h in Headers */, - C3C68320166138E200340E39 /* CPTAnimation.h in Headers */, - C3C68322166138E200340E39 /* CPTAnimationOperation.h in Headers */, - C3C68324166138E200340E39 /* CPTAnimationPeriod.h in Headers */, - C3C68326166138E200340E39 /* _CPTAnimationTimingFunctions.h in Headers */, - C3C683341661391A00340E39 /* _CPTAnimationCGFloatPeriod.h in Headers */, - C3C683361661391A00340E39 /* _CPTAnimationCGPointPeriod.h in Headers */, - C3C683381661391A00340E39 /* _CPTAnimationCGRectPeriod.h in Headers */, - C3C6833A1661391A00340E39 /* _CPTAnimationCGSizePeriod.h in Headers */, - C3C6833C1661391A00340E39 /* _CPTAnimationNSDecimalPeriod.h in Headers */, - C3C6833E1661391A00340E39 /* _CPTAnimationPlotRangePeriod.h in Headers */, - C3D9825116BD406600DE7977 /* CorePlot_Prefix.pch in Headers */, - C31A40BF17ABD6C60020C5C6 /* CPTFunctionDataSource.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - BC9B83460FB8A0A40035D8DA /* CorePlot-CocoaTouch */ = { - isa = PBXNativeTarget; - buildConfigurationList = BC9B834A0FB8A0AA0035D8DA /* Build configuration list for PBXNativeTarget "CorePlot-CocoaTouch" */; - buildPhases = ( - BC9B83430FB8A0A40035D8DA /* Headers */, - BC9B83440FB8A0A40035D8DA /* Sources */, - BC9B83450FB8A0A40035D8DA /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "CorePlot-CocoaTouch"; - productName = "CorePlot-CocoaTouch"; - productReference = BC9B83470FB8A0A40035D8DA /* libCorePlot-CocoaTouch.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0700; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CorePlot-CocoaTouch" */; - compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - BC9B83460FB8A0A40035D8DA /* CorePlot-CocoaTouch */, - C3566B8010EED04900FB3866 /* Documentation */, - 0799D97A137318CF0026072C /* Universal Library */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXShellScriptBuildPhase section */ - 0799D97F137318D80026072C /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\nUFW_TARGET=${PROJECT}\nUFW_BUILD_DIR=\"${BUILD_DIR}\"\n\nif [ -z ${SDK_NAME} ]; then\n# Use the latest iphoneos SDK available\nUFW_GREP_RESULT=$(xcodebuild -showsdks | grep -o \"iphoneos.*$\")\nwhile read -r line; do\nUFW_SDK_VERSION=\"${line}\"\ndone <<< \"${UFW_GREP_RESULT}\"\nelse\n# Use the SDK specified by XCode\nUFW_SDK_VERSION=\"${SDK_NAME}\"\nfi\n\nUFW_SDK_VERSION=$(echo \"${UFW_SDK_VERSION}\" | grep -o \"[0-9].*$\")\nUFW_IPHONE_DIR=\"${UFW_BUILD_DIR}/Release-iphoneos\"\nUFW_SIMULATOR_DIR=\"${UFW_BUILD_DIR}/Release-iphonesimulator\"\nUFW_UNIVERSAL_DIR=\"${UFW_BUILD_DIR}/Release-universal\"\nUFW_HEADER_DIR=\"${UFW_UNIVERSAL_DIR}/CorePlotHeaders\"\nUFW_EXE_PATH=\"lib${PROJECT}.a\"\n\n# Build Framework\n\nrm -rf \"${UFW_UNIVERSAL_DIR}\"\n\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot-CocoaTouch.xcodeproj -configuration Release -sdk iphoneos${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot-CocoaTouch.xcodeproj -configuration Release -sdk iphonesimulator${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\n\nmkdir -p \"${UFW_UNIVERSAL_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\nlipo -create -output \"${UFW_UNIVERSAL_DIR}/${UFW_EXE_PATH}\" \"${UFW_IPHONE_DIR}/${UFW_EXE_PATH}\" \"${UFW_SIMULATOR_DIR}/${UFW_EXE_PATH}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: lipo failed\"; exit 1; fi\n\n# copy header files\nmkdir -p \"${UFW_HEADER_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\ncp \"${SOURCE_ROOT}/CorePlot-CocoaTouch.h\" \"${UFW_HEADER_DIR}\"\ncp \"${SOURCE_ROOT}/iPhoneOnly/\"[!_]*.h \"${UFW_HEADER_DIR}/\"\ncp \"${SOURCE_ROOT}/Source/\"[!_]*.h \"${UFW_HEADER_DIR}/\"\n\nrm \"${UFW_HEADER_DIR}/\"*Tests.*"; - }; - C3566B7F10EED04900FB3866 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# Build the doxygen documentation for the project and load the docset into Xcode.\n\n# Use the following to adjust the value of the $DOXYGEN_PATH User-Defined Setting:\n# Binary install location: /Applications/Doxygen.app/Contents/Resources/doxygen\n# Source build install location: /usr/local/bin/doxygen\n\n# Graphical class diagrams require Graphviz.\n# Graphviz.app is available free online\n# http://www.graphviz.org/Download_macos.php\n\n# If the config file doesn't exist, run 'doxygen -g \"${SOURCE_ROOT}/../documentation/doxygen/doxygen touch.config\"' to \n# a get default file.\n\nDOXYGEN_FOLDER=\"${SOURCE_ROOT}/../documentation/doxygen\"\n\nif ! [ -f \"${DOXYGEN_FOLDER}/doxygen.config\" ]\nthen\n echo doxygen config file does not exist\n ${DOXYGEN_PATH} -g \"${DOXYGEN_FOLDER}/doxygen.config\"\nfi\n\n# Run doxygen on the updated config file.\n# Note: doxygen creates a Makefile that does most of the heavy lifting.\n${DOXYGEN_PATH} \"${SOURCE_ROOT}/../documentation/doxygen/doxygen touch.config\"\n\n# make a copy of the html docs\nDOCS_FOLDER=\"${SOURCE_ROOT}/../documentation/html/iOS\"\nmkdir -p \"${DOCS_FOLDER}\"\ncp -R \"${SOURCE_ROOT}/CorePlotTouchDocs.docset/html/\" \"${DOCS_FOLDER}\"\nrm -f \"${DOCS_FOLDER}/Info.plist\"\nrm -f \"${DOCS_FOLDER}/Makefile\"\nrm -f \"${DOCS_FOLDER}/Nodes.xml\"\nrm -f \"${DOCS_FOLDER}/Tokens.xml\"\n\n# fix nodes.xml so the docset gets the correct index page\nsed -i 's|index.html|index.html' \"${SOURCE_ROOT}/CorePlotTouchDocs.docset/html/nodes.xml\"\n\n# make will invoke docsetutil. Take a look at the Makefile to see how this is done.\nmake -C \"${SOURCE_ROOT}/CorePlotTouchDocs.docset/html\" install\n\n# add publisher info to the docset\nDOCSET_FOLDER=\"/Users/${USER}/Library/Developer/Shared/Documentation/DocSets/com.CorePlotTouch.Framework.docset\"\n\nfind \"${DOCSET_FOLDER}/Contents/\" -type f -name Info.plist | xargs perl -pi -e 's/\\<\\/dict\\>/\\t\\DocSetPublisherIdentifier\\<\\/key\\>\\n\\t\\com.CorePlot.documentation\\<\\/string\\>\\n\\t\\DocSetPublisherName\\<\\/key\\>\\n\\t\\Core Plot\\<\\/string\\>\\n\\t\\NSHumanReadableCopyright\\<\\/key\\>\\n\\t\\Copyright © 2013 Core Plot. All rights reserved.\\<\\/string\\>\\n\\t\\isJavaScriptEnabled\\<\\/key\\>\\n\\t\\\\n\\<\\/dict\\>\\n/g'\n\n# add docset icon\ncp \"${DOXYGEN_FOLDER}/icon.png\" \"${DOCSET_FOLDER}\"\n\n# make a copy of the docset\nrm -Rf \"${SOURCE_ROOT}/CorePlotTouchDocs.docset\"\ncp -R \"${DOCSET_FOLDER}\" \"${SOURCE_ROOT}\"\n\n# Construct a temporary applescript file to tell Xcode to load a docset.\nrm -f \"${TEMP_DIR}/loadDocSet.scpt\"\n\necho \"tell application \\\"Xcode\\\"\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\necho \"load documentation set with path \\\"/Users/${USER}/Library/Developer/Shared/Documentation/DocSets/\\\"\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\necho \"end tell\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\n\n# Run the load-docset applescript command.\nosascript \"${TEMP_DIR}/loadDocSet.scpt\"\n\nexit 0"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - BC9B83440FB8A0A40035D8DA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BC9B834E0FB8A1400035D8DA /* CPTPlot.m in Sources */, - BC9B834F0FB8A1400035D8DA /* CPTScatterPlot.m in Sources */, - BC9B83500FB8A1400035D8DA /* CPTBarPlot.m in Sources */, - BC9B83510FB8A1400035D8DA /* CPTPlotSymbol.m in Sources */, - BC9B83520FB8A1400035D8DA /* CPTPlotSpace.m in Sources */, - BC9B83550FB8A1400035D8DA /* CPTPlotAreaFrame.m in Sources */, - BC9B83560FB8A1400035D8DA /* CPTGraph.m in Sources */, - BC9B83570FB8A1400035D8DA /* CPTXYGraph.m in Sources */, - BC9B835A0FB8A1400035D8DA /* NSDecimalNumberExtensions.m in Sources */, - BC9B835B0FB8A1400035D8DA /* NSNumberExtensions.m in Sources */, - BC9B835D0FB8A1400035D8DA /* CPTDefinitions.m in Sources */, - BC9B835E0FB8A1400035D8DA /* CPTExceptions.m in Sources */, - BC9B835F0FB8A1400035D8DA /* CPTUtilities.m in Sources */, - BC9B83600FB8A1400035D8DA /* CPTPlotRange.m in Sources */, - BC9B83610FB8A1400035D8DA /* CPTFill.m in Sources */, - BC9B83620FB8A1400035D8DA /* _CPTFillColor.m in Sources */, - BC9B83630FB8A1400035D8DA /* _CPTFillGradient.m in Sources */, - BC9B83640FB8A1400035D8DA /* _CPTFillImage.m in Sources */, - C3791D05191D4C2F001EC514 /* CPTImagePlatformSpecific.m in Sources */, - 0789EFBF0FB9F97F00C0A613 /* CPTPlatformSpecificCategories.m in Sources */, - 0789EFC10FB9F97F00C0A613 /* CPTPlatformSpecificDefines.m in Sources */, - 0789EFC30FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.m in Sources */, - 070CB82A0FC9DE4B00F3152B /* CPTGradient.m in Sources */, - 070CB82B0FC9DE5500F3152B /* CPTImage.m in Sources */, - 070CB82C0FC9DE5600F3152B /* CPTLayer.m in Sources */, - 070CB82D0FC9DE5700F3152B /* CPTLineStyle.m in Sources */, - 070CB8350FC9DEA800F3152B /* CPTColor.m in Sources */, - 070CB8370FC9DEA800F3152B /* CPTColorSpace.m in Sources */, - 070CB8440FC9DED400F3152B /* CPTAxis.m in Sources */, - 070CB8480FC9DED400F3152B /* CPTAxisSet.m in Sources */, - 070CB85E0FC9DF4700F3152B /* CPTTextLayer.m in Sources */, - BC79F1D60FD1DC1A00510976 /* CPTGraphHostingView.m in Sources */, - 074D7BC60FD6B65F006011BC /* CPTXYPlotSpace.m in Sources */, - 077F28560FE18048000BCA52 /* CPTBorderedLayer.m in Sources */, - 077F28580FE18048000BCA52 /* CPTPathExtensions.m in Sources */, - 07A62FB60FE2234900CD765C /* CPTTextStyle.m in Sources */, - 072E3FA00FE2FF7300ACF62F /* CPTTheme.m in Sources */, - BCC7EA461006BF5700B39451 /* _CPTPlainBlackTheme.m in Sources */, - BCC7EA481006BF5700B39451 /* _CPTPlainWhiteTheme.m in Sources */, - BCC7EA4A1006BF5700B39451 /* _CPTStocksTheme.m in Sources */, - BC89A79A1024AB19009D5261 /* CorePlotProbes.d in Sources */, - 07A2E71F102DFAD300809BC5 /* CPTTimeFormatter.m in Sources */, - C30C85AC1047428100181766 /* CPTPlotGroup.m in Sources */, - C40CFB95107EC1B40057E828 /* _CPTXYTheme.m in Sources */, - 0772B4F410E26A12009CD04C /* CPTTradingRangePlot.m in Sources */, - BC74A2C310FC087800E7E90D /* CPTPieChart.m in Sources */, - 074FADFA112024C500394B90 /* CPTConstraints.m in Sources */, - 07FCF2D4115B54DE00E46606 /* _CPTSlateTheme.m in Sources */, - C35A65A611025EDF00FE24BB /* CPTPlotArea.m in Sources */, - C35A65B411025F8A00FE24BB /* CPTGridLines.m in Sources */, - C35A65BA11025FA900FE24BB /* CPTAxisLabel.m in Sources */, - C35A65BC11025FA900FE24BB /* CPTAxisTitle.m in Sources */, - C35A65C011025FB300FE24BB /* CPTAxisLabelGroup.m in Sources */, - C35A65C811025FCC00FE24BB /* CPTXYAxis.m in Sources */, - C35A65CA11025FCC00FE24BB /* CPTXYAxisSet.m in Sources */, - C35A66081102723E00FE24BB /* CPTTextStylePlatformSpecific.m in Sources */, - C38DD49811A04B99002A68E7 /* CPTGridLineGroup.m in Sources */, - 0718DE4E11D1EDBA00AF4851 /* CPTAnnotation.m in Sources */, - 0718DE5011D1EDBA00AF4851 /* CPTAnnotationHostLayer.m in Sources */, - 0718DE5211D1EDBA00AF4851 /* CPTLayerAnnotation.m in Sources */, - 0718DE5411D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.m in Sources */, - C318F4C211EA18A400595FF9 /* CPTLimitBand.m in Sources */, - C3D68B0A1221650D00EB4863 /* CPTMutableNumericData.m in Sources */, - C3D68B0E1221651200EB4863 /* CPTNumericData.m in Sources */, - C3D68B101221651600EB4863 /* CPTNumericDataType.m in Sources */, - C3392A361225F63B008DA6BD /* CPTNumericData+TypeConversion.m in Sources */, - C3CAFB3C1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.m in Sources */, - 07B69ABA12B6281100F4C16C /* CPTMutableTextStyle.m in Sources */, - 07B69B7212B62E9600F4C16C /* CPTMutableLineStyle.m in Sources */, - D0C047BF12D6568500DA8047 /* CPTRangePlot.m in Sources */, - C3920AD01395B7680045F3BB /* CPTLegend.m in Sources */, - C30550EA1399BE2000E0151F /* CPTLegendEntry.m in Sources */, - C3978E1113CE65C600A420D9 /* NSCoderExtensions.m in Sources */, - C3D3AD3513DF8E9D0004EA73 /* CPTLineCap.m in Sources */, - C3CCA04913E8D94800CE6DB1 /* _CPTConstraintsFixed.m in Sources */, - C3CCA04B13E8D94800CE6DB1 /* _CPTConstraintsRelative.m in Sources */, - C32EE1BE13EC4AF900038266 /* CPTShadow.m in Sources */, - C32EE1C913EC4C7200038266 /* CPTMutableShadow.m in Sources */, - C3436C4F13F4AC4400739AC2 /* _CPTDarkGradientTheme.m in Sources */, - C3A695E2146A196100AF5653 /* CPTMutablePlotRange.m in Sources */, - C349DCB1151AAFAB00BFD6A7 /* CPTCalendarFormatter.m in Sources */, - C3286C0815D8769800A436A8 /* _CPTMaskLayer.m in Sources */, - C3408C4715FC1CA8004F1D70 /* _CPTBorderLayer.m in Sources */, - C3C68321166138E200340E39 /* CPTAnimation.m in Sources */, - C3C68323166138E200340E39 /* CPTAnimationOperation.m in Sources */, - C3C68325166138E200340E39 /* CPTAnimationPeriod.m in Sources */, - C3C68327166138E200340E39 /* _CPTAnimationTimingFunctions.m in Sources */, - C3C683351661391A00340E39 /* _CPTAnimationCGFloatPeriod.m in Sources */, - C3C683371661391A00340E39 /* _CPTAnimationCGPointPeriod.m in Sources */, - C3C683391661391A00340E39 /* _CPTAnimationCGRectPeriod.m in Sources */, - C3C6833B1661391A00340E39 /* _CPTAnimationCGSizePeriod.m in Sources */, - C3C6833D1661391A00340E39 /* _CPTAnimationNSDecimalPeriod.m in Sources */, - C3C6833F1661391A00340E39 /* _CPTAnimationPlotRangePeriod.m in Sources */, - C31A40C017ABD6C60020C5C6 /* CPTFunctionDataSource.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 0799D97B137318CF0026072C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = UniversalLibrary; - }; - name = Debug; - }; - 0799D97C137318CF0026072C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = UniversalLibrary; - }; - name = Release; - }; - BC9B83480FB8A0A50035D8DA /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C302230B1BB8B49700514011 /* CorePlotDebug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_SYMBOL_SEPARATION = YES; - INSTALL_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; - PRODUCT_NAME = "CorePlot-CocoaTouch"; - PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)"; - }; - name = Debug; - }; - BC9B83490FB8A0A50035D8DA /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C302230C1BB8B49700514011 /* CorePlotRelease.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - GCC_ENABLE_SYMBOL_SEPARATION = YES; - INSTALL_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; - PRODUCT_NAME = "CorePlot-CocoaTouch"; - PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)"; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - MACH_O_TYPE = staticlib; - SDKROOT = iphoneos; - SYMROOT = "$(PROJECT_DIR)/../build"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEPLOYMENT_POSTPROCESSING = YES; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - MACH_O_TYPE = staticlib; - SDKROOT = iphoneos; - SYMROOT = "$(PROJECT_DIR)/../build"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - C3566B8110EED04A00FB3866 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - PRODUCT_NAME = Documentation; - }; - name = Debug; - }; - C3566B8210EED04A00FB3866 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; - PRODUCT_NAME = Documentation; - ZERO_LINK = NO; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 0799D97D137318CF0026072C /* Build configuration list for PBXAggregateTarget "Universal Library" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 0799D97B137318CF0026072C /* Debug */, - 0799D97C137318CF0026072C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - BC9B834A0FB8A0AA0035D8DA /* Build configuration list for PBXNativeTarget "CorePlot-CocoaTouch" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - BC9B83480FB8A0A50035D8DA /* Debug */, - BC9B83490FB8A0A50035D8DA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CorePlot-CocoaTouch" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C3566B8410EED06800FB3866 /* Build configuration list for PBXAggregateTarget "Documentation" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C3566B8110EED04A00FB3866 /* Debug */, - C3566B8210EED04A00FB3866 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/framework/CorePlot-CocoaTouch.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/framework/CorePlot-CocoaTouch.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 8937881b3..000000000 --- a/framework/CorePlot-CocoaTouch.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/framework/CorePlot-CocoaTouch.xcodeproj/xcshareddata/xcschemes/CorePlot-CocoaTouch.xcscheme b/framework/CorePlot-CocoaTouch.xcodeproj/xcshareddata/xcschemes/CorePlot-CocoaTouch.xcscheme deleted file mode 100644 index fd055e090..000000000 --- a/framework/CorePlot-CocoaTouch.xcodeproj/xcshareddata/xcschemes/CorePlot-CocoaTouch.xcscheme +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/framework/CorePlot-CocoaTouch.xcodeproj/xcshareddata/xcschemes/Universal Library.xcscheme b/framework/CorePlot-CocoaTouch.xcodeproj/xcshareddata/xcschemes/Universal Library.xcscheme deleted file mode 100644 index 1df3e4a8e..000000000 --- a/framework/CorePlot-CocoaTouch.xcodeproj/xcshareddata/xcschemes/Universal Library.xcscheme +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/framework/CorePlot.h b/framework/CorePlot.h index aaa221bb3..fbf2740c2 100644 --- a/framework/CorePlot.h +++ b/framework/CorePlot.h @@ -1,6 +1,6 @@ #import "TargetConditionals.h" -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #import #import diff --git a/framework/CorePlot.xcodeproj/project.pbxproj b/framework/CorePlot.xcodeproj/project.pbxproj index dbef056a7..f6971f390 100644 --- a/framework/CorePlot.xcodeproj/project.pbxproj +++ b/framework/CorePlot.xcodeproj/project.pbxproj @@ -18,6 +18,17 @@ name = "Documentation-Mac"; productName = Documentation; }; + C37EA5C41BC83E900091C8F7 /* Universal tvOS Framework */ = { + isa = PBXAggregateTarget; + buildConfigurationList = C37EA5C61BC83E900091C8F7 /* Build configuration list for PBXAggregateTarget "Universal tvOS Framework" */; + buildPhases = ( + C37EA5C51BC83E900091C8F7 /* ShellScript */, + ); + dependencies = ( + ); + name = "Universal tvOS Framework"; + productName = Documentation; + }; C38A09911A4618B600D45436 /* Documentation-iOS */ = { isa = PBXAggregateTarget; buildConfigurationList = C38A09931A4618B600D45436 /* Build configuration list for PBXAggregateTarget "Documentation-iOS" */; @@ -177,7 +188,6 @@ BC74A33110FC402600E7E90D /* CPTPieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74A32F10FC402600E7E90D /* CPTPieChart.m */; }; BC79F1360FD1CD6600510976 /* CPTGraphHostingView.h in Headers */ = {isa = PBXBuildFile; fileRef = BC79F1340FD1CD6600510976 /* CPTGraphHostingView.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC79F1370FD1CD6600510976 /* CPTGraphHostingView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC79F1350FD1CD6600510976 /* CPTGraphHostingView.m */; }; - BC89A64110239D1D009D5261 /* CorePlotProbes.d in Sources */ = {isa = PBXBuildFile; fileRef = BC89A64010239D1D009D5261 /* CorePlotProbes.d */; }; BCFC7C3710921FDB00DAECAA /* CPTAxisTitle.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFC7C3510921FDB00DAECAA /* CPTAxisTitle.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCFC7C3810921FDB00DAECAA /* CPTAxisTitle.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFC7C3610921FDB00DAECAA /* CPTAxisTitle.m */; }; C30550ED1399BE5400E0151F /* CPTLegendEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = C30550EB1399BE5400E0151F /* CPTLegendEntry.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -186,10 +196,8 @@ C318F4AE11EA188700595FF9 /* CPTLimitBand.m in Sources */ = {isa = PBXBuildFile; fileRef = C318F4AC11EA188700595FF9 /* CPTLimitBand.m */; }; C3226A521A69F6DA00F77249 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A511A69F6DA00F77249 /* QuartzCore.framework */; }; C3226A541A69F6DF00F77249 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A531A69F6DF00F77249 /* UIKit.framework */; }; - C3226A561A69F6F000F77249 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A551A69F6F000F77249 /* Accelerate.framework */; }; C3226A581A69F6FA00F77249 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; C3226A5C1A69F72900F77249 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A531A69F6DF00F77249 /* UIKit.framework */; }; - C3226A5D1A69F72F00F77249 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A551A69F6F000F77249 /* Accelerate.framework */; }; C3226A5E1A69F73800F77249 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A511A69F6DA00F77249 /* QuartzCore.framework */; }; C3226A5F1A69F75400F77249 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; C3286C0015D8740100A436A8 /* _CPTMaskLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3286BFE15D8740100A436A8 /* _CPTMaskLayer.h */; settings = {ATTRIBUTES = (); }; }; @@ -225,15 +233,233 @@ C34F0D59121CB3F00020FDD3 /* CPTDataSourceTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */; }; C36E89BA11EE7F97003DE309 /* CPTPlotRangeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C36E89B911EE7F97003DE309 /* CPTPlotRangeTests.m */; }; C370D5971A753F1C00AF4312 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; + C377B3BB1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */; }; + C377B3BC1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */; }; + C377B3BD1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */; }; + C377B3BE1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */; }; C3791D09191D4C4C001EC514 /* CPTImagePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C3791D07191D4C4C001EC514 /* CPTImagePlatformSpecific.m */; }; + C37EA5CB1BC83F2A0091C8F7 /* CPTGraphHostingView.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B281A46265300D45436 /* CPTGraphHostingView.m */; }; + C37EA5CC1BC83F2A0091C8F7 /* CPTLayerAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BBA11D10183000B8DAB /* CPTLayerAnnotation.m */; }; + C37EA5CD1BC83F2A0091C8F7 /* CPTLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7EB0F4B4F9600F9BCBB /* CPTLayer.m */; }; + C37EA5CE1BC83F2A0091C8F7 /* CPTTimeFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 07A2E6FB102DF47900809BC5 /* CPTTimeFormatter.m */; }; + C37EA5CF1BC83F2A0091C8F7 /* CPTColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 079FC0B30FB975500037E990 /* CPTColor.m */; }; + C37EA5D01BC83F2A0091C8F7 /* NSCoderExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3978E0513CE653B00A420D9 /* NSCoderExtensions.m */; }; + C37EA5D11BC83F2A0091C8F7 /* CPTMutableNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF11104D819100B554F9 /* CPTMutableNumericData.m */; }; + C37EA5D21BC83F2A0091C8F7 /* CPTNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3392A371225F667008DA6BD /* CPTNumericData+TypeConversion.m */; }; + C37EA5D31BC83F2A0091C8F7 /* CPTTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772C9260FE2F71600EC4C16 /* CPTTheme.m */; }; + C37EA5D41BC83F2A0091C8F7 /* CPTDefinitions.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0DF20F2B7BFB002FCEA7 /* CPTDefinitions.m */; }; + C37EA5D51BC83F2A0091C8F7 /* _CPTFillImage.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601D0FAE096C00072842 /* _CPTFillImage.m */; }; + C37EA5D61BC83F2A0091C8F7 /* CPTPlotSpaceAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BB011D1016B000B8DAB /* CPTPlotSpaceAnnotation.m */; }; + C37EA5D71BC83F2A0091C8F7 /* CPTXYAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = 0783DD540FBF097E006C3696 /* CPTXYAxis.m */; }; + C37EA5D81BC83F2A0091C8F7 /* CPTBarPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 0799E0940F2BB5F300790525 /* CPTBarPlot.m */; }; + C37EA5D91BC83F2A0091C8F7 /* CPTAxisTitle.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFC7C3610921FDB00DAECAA /* CPTAxisTitle.m */; }; + C37EA5DA1BC83F2A0091C8F7 /* CPTPlatformSpecificDefines.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B1B1A46264500D45436 /* CPTPlatformSpecificDefines.m */; }; + C37EA5DB1BC83F2A0091C8F7 /* _CPTStocksTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55023110059F22005DF982 /* _CPTStocksTheme.m */; }; + C37EA5DC1BC83F2A0091C8F7 /* CPTImagePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0A591A4620B800D45436 /* CPTImagePlatformSpecific.m */; }; + C37EA5DD1BC83F2A0091C8F7 /* _CPTAnimationCGFloatPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB16165DB52C00739006 /* _CPTAnimationCGFloatPeriod.m */; }; + C37EA5DE1BC83F2A0091C8F7 /* CPTExceptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 07321BC00F37370D00F423D8 /* CPTExceptions.m */; }; + C37EA5DF1BC83F2A0091C8F7 /* _CPTDarkGradientTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772C92E0FE2F89000EC4C16 /* _CPTDarkGradientTheme.m */; }; + C37EA5E01BC83F2A0091C8F7 /* _CPTPlainBlackTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55022D10059F22005DF982 /* _CPTPlainBlackTheme.m */; }; + C37EA5E11BC83F2A0091C8F7 /* CPTNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EEFB104D80C400B554F9 /* CPTNumericData.m */; }; + C37EA5E31BC83F2A0091C8F7 /* CPTXYAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 07975C420F3B816600DE45DC /* CPTXYAxisSet.m */; }; + C37EA5E41BC83F2A0091C8F7 /* CPTLimitBand.m in Sources */ = {isa = PBXBuildFile; fileRef = C318F4AC11EA188700595FF9 /* CPTLimitBand.m */; }; + C37EA5E51BC83F2A0091C8F7 /* CPTGridLines.m in Sources */ = {isa = PBXBuildFile; fileRef = C32B391710AA4C78000470D4 /* CPTGridLines.m */; }; + C37EA5E61BC83F2A0091C8F7 /* CPTPathExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 070622310FDF1B250066A6C4 /* CPTPathExtensions.m */; }; + C37EA5E71BC83F2A0091C8F7 /* CPTXYPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 90AF4FB90F36D39700753D26 /* CPTXYPlotSpace.m */; }; + C37EA5E81BC83F2A0091C8F7 /* CPTPlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 32484B400F530E8B002151AD /* CPTPlotRange.m */; }; + C37EA5E91BC83F2A0091C8F7 /* CPTImage.m in Sources */ = {isa = PBXBuildFile; fileRef = C3AFC9D00FB62969005DFFDC /* CPTImage.m */; }; + C37EA5EA1BC83F2A0091C8F7 /* CPTPlotSymbol.m in Sources */ = {isa = PBXBuildFile; fileRef = C34AFE6A11021D010041675A /* CPTPlotSymbol.m */; }; + C37EA5EB1BC83F2A0091C8F7 /* CPTAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D830F2B7340002FCEA7 /* CPTAxisSet.m */; }; + C37EA5EC1BC83F2A0091C8F7 /* CPTPlotGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F31DE71045EB470058520A /* CPTPlotGroup.m */; }; + C37EA5ED1BC83F2A0091C8F7 /* CPTAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C2847016584EB9006BA43C /* CPTAnimation.m */; }; + C37EA5EE1BC83F2A0091C8F7 /* _CPTAnimationNSDecimalPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C00B71DCB2085A92BE0A9 /* _CPTAnimationNSDecimalPeriod.m */; }; + C37EA5EF1BC83F2A0091C8F7 /* _CPTAnimationPlotRangePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C091B8592D9F32AC384CB /* _CPTAnimationPlotRangePeriod.m */; }; + C37EA5F01BC83F2A0091C8F7 /* CPTPlotAreaFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D770F2B723A002FCEA7 /* CPTPlotAreaFrame.m */; }; + C37EA5F11BC83F2A0091C8F7 /* CPTAxisLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 073FB02F0FC991A3007A728E /* CPTAxisLabel.m */; }; + C37EA5F21BC83F2A0091C8F7 /* CPTShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1B513EC4AA800038266 /* CPTShadow.m */; }; + C37EA5F31BC83F2A0091C8F7 /* _CPTAnimationCGPointPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C0AE447398AF62D584F9C /* _CPTAnimationCGPointPeriod.m */; }; + C37EA5F41BC83F2A0091C8F7 /* CPTPlatformSpecificFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B1D1A46264500D45436 /* CPTPlatformSpecificFunctions.m */; }; + C37EA5F51BC83F2A0091C8F7 /* CPTMutableShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1C013EC4BE700038266 /* CPTMutableShadow.m */; }; + C37EA5F61BC83F2A0091C8F7 /* _CPTAnimationCGRectPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C0C3DB583ED8FC2EFD9DB /* _CPTAnimationCGRectPeriod.m */; }; + C37EA5F71BC83F2A0091C8F7 /* CPTPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D7B0F2B72B0002FCEA7 /* CPTPlotSpace.m */; }; + C37EA5F81BC83F2A0091C8F7 /* CPTLineCap.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D3AD2C13DF8DCE0004EA73 /* CPTLineCap.m */; }; + C37EA5F91BC83F2A0091C8F7 /* CPTScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D960F2B73CA002FCEA7 /* CPTScatterPlot.m */; }; + C37EA5FA1BC83F2A0091C8F7 /* _CPTSlateTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 07FCF2C5115B54AE00E46606 /* _CPTSlateTheme.m */; }; + C37EA5FB1BC83F2A0091C8F7 /* CPTAnimationPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB12165DB50300739006 /* CPTAnimationPeriod.m */; }; + C37EA5FC1BC83F2A0091C8F7 /* CPTTextStylePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0A541A461F9700D45436 /* CPTTextStylePlatformSpecific.m */; }; + C37EA5FD1BC83F2A0091C8F7 /* _CPTBorderLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3408C3D15FC1C3E004F1D70 /* _CPTBorderLayer.m */; }; + C37EA5FE1BC83F2A0091C8F7 /* CPTLegendEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = C30550EC1399BE5400E0151F /* CPTLegendEntry.m */; }; + C37EA5FF1BC83F2A0091C8F7 /* CPTTradingRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772B43810E24D5C009CD04C /* CPTTradingRangePlot.m */; }; + C37EA6001BC83F2A0091C8F7 /* CPTTextLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7E60F4B4F8200F9BCBB /* CPTTextLayer.m */; }; + C37EA6011BC83F2A0091C8F7 /* _CPTConstraintsRelative.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA03C13E8D85800CE6DB1 /* _CPTConstraintsRelative.m */; }; + C37EA6021BC83F2A0091C8F7 /* CPTAnnotationHostLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 072161EA11D1F6BD009CC871 /* CPTAnnotationHostLayer.m */; }; + C37EA6031BC83F2A0091C8F7 /* CPTAnimationOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB0D165DB4D500739006 /* CPTAnimationOperation.m */; }; + C37EA6041BC83F2A0091C8F7 /* _CPTFillGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = C34260190FAE096C00072842 /* _CPTFillGradient.m */; }; + C37EA6051BC83F2A0091C8F7 /* _CPTMaskLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3286BFF15D8740100A436A8 /* _CPTMaskLayer.m */; }; + C37EA6061BC83F2A0091C8F7 /* CPTCalendarFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C349DCB3151AAFBF00BFD6A7 /* CPTCalendarFormatter.m */; }; + C37EA6071BC83F2A0091C8F7 /* CPTAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BB511D10177000B8DAB /* CPTAnnotation.m */; }; + C37EA6081BC83F2A0091C8F7 /* _CPTFillColor.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601C0FAE096C00072842 /* _CPTFillColor.m */; }; + C37EA6091BC83F2A0091C8F7 /* _CPTAnimationTimingFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C2847416585085006BA43C /* _CPTAnimationTimingFunctions.m */; }; + C37EA60A1BC83F2A0091C8F7 /* CPTMutableLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69B1612B62ABB00F4C16C /* CPTMutableLineStyle.m */; }; + C37EA60B1BC83F2A0091C8F7 /* NSDecimalNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7EF0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.m */; }; + C37EA60C1BC83F2A0091C8F7 /* CPTLegend.m in Sources */ = {isa = PBXBuildFile; fileRef = C3920AC31395B6500045F3BB /* CPTLegend.m */; }; + C37EA60D1BC83F2A0091C8F7 /* CPTAxisLabelGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C032C810B8DEDC003A11B6 /* CPTAxisLabelGroup.m */; }; + C37EA60E1BC83F2A0091C8F7 /* CPTFill.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601A0FAE096C00072842 /* CPTFill.m */; }; + C37EA60F1BC83F2A0091C8F7 /* CPTMutableNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CAFB251229E41F00F5C989 /* CPTMutableNumericData+TypeConversion.m */; }; + C37EA6101BC83F2A0091C8F7 /* CPTRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = D0C0477B12D6560900DA8047 /* CPTRangePlot.m */; }; + C37EA6111BC83F2A0091C8F7 /* CPTGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D710F2B718F002FCEA7 /* CPTGraph.m */; }; + C37EA6121BC83F2A0091C8F7 /* CPTMutablePlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A695E4146A19BC00AF5653 /* CPTMutablePlotRange.m */; }; + C37EA6131BC83F2A0091C8F7 /* _CPTPlainWhiteTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55022F10059F22005DF982 /* _CPTPlainWhiteTheme.m */; }; + C37EA6141BC83F2A0091C8F7 /* CPTGridLineGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C38DD49211A04B7A002A68E7 /* CPTGridLineGroup.m */; }; + C37EA6151BC83F2A0091C8F7 /* CPTNumericDataType.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EEFD104D80C400B554F9 /* CPTNumericDataType.m */; }; + C37EA6161BC83F2A0091C8F7 /* CPTPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D7F0F2B72F6002FCEA7 /* CPTPlot.m */; }; + C37EA6171BC83F2A0091C8F7 /* CPTPlatformSpecificCategories.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B191A46264500D45436 /* CPTPlatformSpecificCategories.m */; }; + C37EA6181BC83F2A0091C8F7 /* CPTConstraints.m in Sources */ = {isa = PBXBuildFile; fileRef = 070064E8111F2BAA003DE087 /* CPTConstraints.m */; }; + C37EA6191BC83F2A0091C8F7 /* CPTTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69A5C12B6215000F4C16C /* CPTTextStyle.m */; }; + C37EA61A1BC83F2A0091C8F7 /* CPTFunctionDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1D17A9E07B00A52FF2 /* CPTFunctionDataSource.m */; }; + C37EA61B1BC83F2A0091C8F7 /* NSNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 078F42DA0FACC075006E670B /* NSNumberExtensions.m */; }; + C37EA61C1BC83F2A0091C8F7 /* CPTBorderedLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0706223B0FDF215C0066A6C4 /* CPTBorderedLayer.m */; }; + C37EA61D1BC83F2A0091C8F7 /* CPTLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 906156BD0F375598001B75FC /* CPTLineStyle.m */; }; + C37EA61E1BC83F2A0091C8F7 /* _CPTAnimationCGSizePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C087BF0913A6BA2363E40 /* _CPTAnimationCGSizePeriod.m */; }; + C37EA61F1BC83F2A0091C8F7 /* CPTPieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74A32F10FC402600E7E90D /* CPTPieChart.m */; }; + C37EA6201BC83F2A0091C8F7 /* CPTColorSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 079FC0BC0FB9762B0037E990 /* CPTColorSpace.m */; }; + C37EA6211BC83F2A0091C8F7 /* CPTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 07CA112E0FAC8F85000861CE /* CPTGradient.m */; }; + C37EA6221BC83F2A0091C8F7 /* CPTUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 07321BC50F37382D00F423D8 /* CPTUtilities.m */; }; + C37EA6231BC83F2A0091C8F7 /* _CPTXYTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = C3DA34CA107AD7710051DA02 /* _CPTXYTheme.m */; }; + C37EA6241BC83F2A0091C8F7 /* CPTXYGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 07983EF50F2F9A3D008C8618 /* CPTXYGraph.m */; }; + C37EA6251BC83F2A0091C8F7 /* CPTPlotArea.m in Sources */ = {isa = PBXBuildFile; fileRef = C34BF5BB10A67633007F0894 /* CPTPlotArea.m */; }; + C37EA6261BC83F2A0091C8F7 /* _CPTConstraintsFixed.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA03A13E8D85800CE6DB1 /* _CPTConstraintsFixed.m */; }; + C37EA6271BC83F2A0091C8F7 /* CPTAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = 07975C480F3B818800DE45DC /* CPTAxis.m */; }; + C37EA6281BC83F2A0091C8F7 /* CPTMutableTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07C4679A0FE1A24C00299939 /* CPTMutableTextStyle.m */; }; + C37EA62B1BC83F2A0091C8F7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; + C37EA62C1BC83F2A0091C8F7 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A511A69F6DA00F77249 /* QuartzCore.framework */; }; + C37EA62D1BC83F2A0091C8F7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A531A69F6DF00F77249 /* UIKit.framework */; }; + C37EA62F1BC83F2A0091C8F7 /* CPTLimitBand.h in Headers */ = {isa = PBXBuildFile; fileRef = C318F4AB11EA188700595FF9 /* CPTLimitBand.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6301BC83F2A0091C8F7 /* CPTDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0DF10F2B7BFB002FCEA7 /* CPTDefinitions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6311BC83F2A0091C8F7 /* CPTPlotSymbol.h in Headers */ = {isa = PBXBuildFile; fileRef = C34AFE6911021D010041675A /* CPTPlotSymbol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6321BC83F2A0091C8F7 /* CPTTradingRangePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 0772B43710E24D5C009CD04C /* CPTTradingRangePlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6331BC83F2A0091C8F7 /* CPTGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D700F2B718F002FCEA7 /* CPTGraph.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6341BC83F2A0091C8F7 /* CPTGridLines.h in Headers */ = {isa = PBXBuildFile; fileRef = C32B391610AA4C78000470D4 /* CPTGridLines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6351BC83F2A0091C8F7 /* CPTTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B69A5B12B6215000F4C16C /* CPTTextStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6361BC83F2A0091C8F7 /* CPTMutablePlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = C3A695E3146A19BC00AF5653 /* CPTMutablePlotRange.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6371BC83F2A0091C8F7 /* CPTPieChart.h in Headers */ = {isa = PBXBuildFile; fileRef = BC74A32E10FC402600E7E90D /* CPTPieChart.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6381BC83F2A0091C8F7 /* CPTMutableNumericData+TypeConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CAFB241229E41F00F5C989 /* CPTMutableNumericData+TypeConversion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6391BC83F2A0091C8F7 /* CPTAxisLabelGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C032C710B8DEDC003A11B6 /* CPTAxisLabelGroup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA63A1BC83F2A0091C8F7 /* CPTPlotSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D7A0F2B72B0002FCEA7 /* CPTPlotSpace.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA63B1BC83F2A0091C8F7 /* CPTGraphHostingView.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B271A46265300D45436 /* CPTGraphHostingView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA63C1BC83F2A0091C8F7 /* CPTColorSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 079FC0BB0FB9762B0037E990 /* CPTColorSpace.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA63D1BC83F2A0091C8F7 /* CPTXYPlotSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 0799E0970F2BB6E800790525 /* CPTXYPlotSpace.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA63E1BC83F2A0091C8F7 /* CPTLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 906156BC0F375598001B75FC /* CPTLineStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA63F1BC83F2A0091C8F7 /* CPTPathExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 070622300FDF1B250066A6C4 /* CPTPathExtensions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6401BC83F2A0091C8F7 /* _CPTBorderLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3408C3C15FC1C3E004F1D70 /* _CPTBorderLayer.h */; }; + C37EA6411BC83F2A0091C8F7 /* CPTNumericData.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EEFA104D80C400B554F9 /* CPTNumericData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6421BC83F2A0091C8F7 /* CPTLineCap.h in Headers */ = {isa = PBXBuildFile; fileRef = C3D3AD2B13DF8DCE0004EA73 /* CPTLineCap.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6431BC83F2A0091C8F7 /* _CPTFillGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = C342601E0FAE096C00072842 /* _CPTFillGradient.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6441BC83F2A0091C8F7 /* CPTNumericDataType.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EEFC104D80C400B554F9 /* CPTNumericDataType.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6451BC83F2A0091C8F7 /* CPTAnimationPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C9CB11165DB50300739006 /* CPTAnimationPeriod.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6461BC83F2A0091C8F7 /* _CPTPlainWhiteTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC55022E10059F22005DF982 /* _CPTPlainWhiteTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6471BC83F2A0091C8F7 /* CPTBorderedLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0706223A0FDF215C0066A6C4 /* CPTBorderedLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6481BC83F2A0091C8F7 /* CPTAxisSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D820F2B7340002FCEA7 /* CPTAxisSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6491BC83F2A0091C8F7 /* CPTScatterPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D950F2B73CA002FCEA7 /* CPTScatterPlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA64A1BC83F2A0091C8F7 /* CPTMutableShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C32EE1BF13EC4BE700038266 /* CPTMutableShadow.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA64B1BC83F2A0091C8F7 /* _CPTPlainBlackTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC55022C10059F22005DF982 /* _CPTPlainBlackTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA64C1BC83F2A0091C8F7 /* _CPTAnimationNSDecimalPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0685ACE3281299F10F73 /* _CPTAnimationNSDecimalPeriod.h */; }; + C37EA64D1BC83F2A0091C8F7 /* CPTCalendarFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = C349DCB2151AAFBF00BFD6A7 /* CPTCalendarFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA64E1BC83F2A0091C8F7 /* CPTTextLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CD7E7E50F4B4F8200F9BCBB /* CPTTextLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA64F1BC83F2A0091C8F7 /* CPTResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = 07AEF1FD10BBE1F10012BEFF /* CPTResponder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6501BC83F2A0091C8F7 /* CPTLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CD7E7EA0F4B4F9600F9BCBB /* CPTLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6511BC83F2A0091C8F7 /* CPTPlotAreaFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D760F2B723A002FCEA7 /* CPTPlotAreaFrame.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6521BC83F2A0091C8F7 /* CPTXYAxis.h in Headers */ = {isa = PBXBuildFile; fileRef = 0783DD530FBF097E006C3696 /* CPTXYAxis.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6531BC83F2A0091C8F7 /* _CPTStocksTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC55023010059F22005DF982 /* _CPTStocksTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6541BC83F2A0091C8F7 /* CPTImage.h in Headers */ = {isa = PBXBuildFile; fileRef = C3AFC9CF0FB62969005DFFDC /* CPTImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6551BC83F2A0091C8F7 /* CPTTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 0772C9250FE2F71600EC4C16 /* CPTTheme.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6561BC83F2A0091C8F7 /* CPTPlatformSpecificCategories.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B181A46264500D45436 /* CPTPlatformSpecificCategories.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6571BC83F2A0091C8F7 /* NSNumberExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 078F42D90FACC075006E670B /* NSNumberExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6581BC83F2A0091C8F7 /* _CPTConstraintsRelative.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CCA03B13E8D85800CE6DB1 /* _CPTConstraintsRelative.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6591BC83F2A0091C8F7 /* CPTAnimationOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C9CB0C165DB4D500739006 /* CPTAnimationOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA65A1BC83F2A0091C8F7 /* _CPTDarkGradientTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 0772C92D0FE2F89000EC4C16 /* _CPTDarkGradientTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA65B1BC83F2A0091C8F7 /* CPTRangePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C0477C12D6560900DA8047 /* CPTRangePlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA65C1BC83F2A0091C8F7 /* _CPTAnimationCGSizePeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0563E082D1C1E249FA6F /* _CPTAnimationCGSizePeriod.h */; }; + C37EA65D1BC83F2A0091C8F7 /* CPTPlotGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C3F31DE81045EB470058520A /* CPTPlotGroup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA65E1BC83F2A0091C8F7 /* CPTLegend.h in Headers */ = {isa = PBXBuildFile; fileRef = C3920AC21395B6500045F3BB /* CPTLegend.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA65F1BC83F2A0091C8F7 /* _CPTFillImage.h in Headers */ = {isa = PBXBuildFile; fileRef = C34260180FAE096C00072842 /* _CPTFillImage.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6601BC83F2A0091C8F7 /* _CPTAnimationCGRectPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0E876AE37EB30019586B /* _CPTAnimationCGRectPeriod.h */; }; + C37EA6611BC83F2A0091C8F7 /* CPTPlotSpaceAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E10BAF11D1016B000B8DAB /* CPTPlotSpaceAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6621BC83F2A0091C8F7 /* CPTConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 070064E7111F2BAA003DE087 /* CPTConstraints.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6631BC83F2A0091C8F7 /* NSCoderExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = C3978E0413CE653B00A420D9 /* NSCoderExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6641BC83F2A0091C8F7 /* CPTNumericData+TypeConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EEF7104D80C400B554F9 /* CPTNumericData+TypeConversion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6651BC83F2A0091C8F7 /* _CPTFillColor.h in Headers */ = {isa = PBXBuildFile; fileRef = C342601B0FAE096C00072842 /* _CPTFillColor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6661BC83F2A0091C8F7 /* _CPTXYTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = C3DA34CB107AD7710051DA02 /* _CPTXYTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6671BC83F2A0091C8F7 /* CPTLayerAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E10BB911D10183000B8DAB /* CPTLayerAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6681BC83F2A0091C8F7 /* _CPTAnimationCGFloatPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C9CB15165DB52C00739006 /* _CPTAnimationCGFloatPeriod.h */; }; + C37EA6691BC83F2A0091C8F7 /* CPTAxisTitle.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFC7C3510921FDB00DAECAA /* CPTAxisTitle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA66A1BC83F2A0091C8F7 /* _CPTSlateTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 07FCF2C4115B54AE00E46606 /* _CPTSlateTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA66B1BC83F2A0091C8F7 /* CPTMutableNumericData.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EF10104D819100B554F9 /* CPTMutableNumericData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA66C1BC83F2A0091C8F7 /* CPTGridLineGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C38DD49111A04B7A002A68E7 /* CPTGridLineGroup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA66D1BC83F2A0091C8F7 /* CorePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 070CF7AE0F3CA7AB0001FFF4 /* CorePlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA66E1BC83F2A0091C8F7 /* CPTMutableLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B69B1512B62ABB00F4C16C /* CPTMutableLineStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA66F1BC83F2A0091C8F7 /* CPTAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C2846F16584EB9006BA43C /* CPTAnimation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6701BC83F2A0091C8F7 /* CPTExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 07321BBF0F37370D00F423D8 /* CPTExceptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6711BC83F2A0091C8F7 /* CPTPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D7E0F2B72F6002FCEA7 /* CPTPlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6721BC83F2A0091C8F7 /* CPTShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C32EE1B413EC4AA800038266 /* CPTShadow.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6731BC83F2A0091C8F7 /* CPTAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E10BB411D10177000B8DAB /* CPTAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6741BC83F2A0091C8F7 /* CPTColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 079FC0B20FB975500037E990 /* CPTColor.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6751BC83F2A0091C8F7 /* CPTTextStylePlatformSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0A531A461F9700D45436 /* CPTTextStylePlatformSpecific.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6761BC83F2A0091C8F7 /* CPTFill.h in Headers */ = {isa = PBXBuildFile; fileRef = C342601F0FAE096C00072842 /* CPTFill.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6771BC83F2A0091C8F7 /* CPTPlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 32484B3F0F530E8B002151AD /* CPTPlotRange.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6781BC83F2A0091C8F7 /* CPTXYAxisSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 07975C410F3B816600DE45DC /* CPTXYAxisSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6791BC83F2A0091C8F7 /* CPTTimeFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 07A2E6FA102DF47900809BC5 /* CPTTimeFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA67A1BC83F2A0091C8F7 /* CPTLegendEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = C30550EB1399BE5400E0151F /* CPTLegendEntry.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA67B1BC83F2A0091C8F7 /* CPTPlotArea.h in Headers */ = {isa = PBXBuildFile; fileRef = C34BF5BA10A67633007F0894 /* CPTPlotArea.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA67C1BC83F2A0091C8F7 /* _CPTMaskLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3286BFE15D8740100A436A8 /* _CPTMaskLayer.h */; }; + C37EA67D1BC83F2A0091C8F7 /* _CPTAnimationPlotRangePeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0E16290C226BC4BE3936 /* _CPTAnimationPlotRangePeriod.h */; }; + C37EA67E1BC83F2A0091C8F7 /* CPTFunctionDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C3F97F1C17A9E07B00A52FF2 /* CPTFunctionDataSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA67F1BC83F2A0091C8F7 /* CPTGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 07CA112D0FAC8F85000861CE /* CPTGradient.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6801BC83F2A0091C8F7 /* _CPTAnimationCGPointPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0E154E8598EDE2EDEF2F /* _CPTAnimationCGPointPeriod.h */; }; + C37EA6811BC83F2A0091C8F7 /* NSDecimalNumberExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CD7E7EE0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6821BC83F2A0091C8F7 /* CPTAxis.h in Headers */ = {isa = PBXBuildFile; fileRef = 07975C470F3B818800DE45DC /* CPTAxis.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6831BC83F2A0091C8F7 /* CPTPlatformSpecificFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B1C1A46264500D45436 /* CPTPlatformSpecificFunctions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6841BC83F2A0091C8F7 /* CPTAnnotationHostLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 072161E911D1F6BD009CC871 /* CPTAnnotationHostLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6851BC83F2A0091C8F7 /* CPTAxisLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 073FB02E0FC991A3007A728E /* CPTAxisLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6861BC83F2A0091C8F7 /* CPTDebugQuickLook.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB93181B729BD200004527 /* CPTDebugQuickLook.h */; }; + C37EA6871BC83F2A0091C8F7 /* _CPTAnimationTimingFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C2847316585085006BA43C /* _CPTAnimationTimingFunctions.h */; }; + C37EA6881BC83F2A0091C8F7 /* CPTMutableTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C467990FE1A24C00299939 /* CPTMutableTextStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6891BC83F2A0091C8F7 /* CPTXYGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 07983EF40F2F9A3D008C8618 /* CPTXYGraph.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA68A1BC83F2A0091C8F7 /* CPTPlatformSpecificDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B1A1A46264500D45436 /* CPTPlatformSpecificDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA68B1BC83F2A0091C8F7 /* CPTBarPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 0799E0930F2BB5F300790525 /* CPTBarPlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA68C1BC83F2A0091C8F7 /* CPTUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 07321BC40F37382D00F423D8 /* CPTUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA68D1BC83F2A0091C8F7 /* _CPTConstraintsFixed.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CCA03913E8D85800CE6DB1 /* _CPTConstraintsFixed.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6981BC83F2D0091C8F7 /* CPTMutableNumericDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CADDC611B167AD00D36017 /* CPTMutableNumericDataTests.m */; }; + C37EA6991BC83F2D0091C8F7 /* CPTColorSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979AE13D2337E00145DFF /* CPTColorSpaceTests.m */; }; + C37EA69A1BC83F2D0091C8F7 /* CPTFillTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979BA13D2347300145DFF /* CPTFillTests.m */; }; + C37EA69B1BC83F2D0091C8F7 /* CPTUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E9630F4B625900F9BCBB /* CPTUtilitiesTests.m */; }; + C37EA69C1BC83F2D0091C8F7 /* CPTGradientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B113D233C000145DFF /* CPTGradientTests.m */; }; + C37EA69D1BC83F2D0091C8F7 /* CPTDarkGradientThemeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E1FE6051100F27EF00895A91 /* CPTDarkGradientThemeTests.m */; }; + C37EA69E1BC83F2D0091C8F7 /* CPTAxisLabelTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD23FFB0FFBE78400ADD2E2 /* CPTAxisLabelTests.m */; }; + C37EA69F1BC83F2D0091C8F7 /* CPTThemeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E1620CBD100F03A100A84E77 /* CPTThemeTests.m */; }; + C37EA6A01BC83F2D0091C8F7 /* CPTColorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979AB13D2332500145DFF /* CPTColorTests.m */; }; + C37EA6A11BC83F2D0091C8F7 /* CPTPlotSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979A313D2136600145DFF /* CPTPlotSpaceTests.m */; }; + C37EA6A21BC83F2D0091C8F7 /* CPTImageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B413D2340000145DFF /* CPTImageTests.m */; }; + C37EA6A31BC83F2D0091C8F7 /* CPTDataSourceTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */; }; + C37EA6A41BC83F2D0091C8F7 /* CPTNumericDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF06104D80D400B554F9 /* CPTNumericDataTests.m */; }; + C37EA6A51BC83F2D0091C8F7 /* CPTDerivedXYGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = E1FE611A100F3FB700895A91 /* CPTDerivedXYGraph.m */; }; + C37EA6A61BC83F2D0091C8F7 /* CPTXYPlotSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C422A630FB1FCD5000CAA43 /* CPTXYPlotSpaceTests.m */; }; + C37EA6A71BC83F2D0091C8F7 /* CPTTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0730F64D109494D100E95162 /* CPTTestCase.m */; }; + C37EA6A81BC83F2D0091C8F7 /* CPTPlotRangeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C36E89B911EE7F97003DE309 /* CPTPlotRangeTests.m */; }; + C37EA6A91BC83F2D0091C8F7 /* CPTNumericDataTypeConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF08104D80D400B554F9 /* CPTNumericDataTypeConversionTests.m */; }; + C37EA6AA1BC83F2D0091C8F7 /* CPTMutableNumericDataTypeConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CB561B122A9E9F00FBFB61 /* CPTMutableNumericDataTypeConversionTests.m */; }; + C37EA6AB1BC83F2D0091C8F7 /* CPTLineStyleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B713D2344000145DFF /* CPTLineStyleTests.m */; }; + C37EA6AC1BC83F2D0091C8F7 /* CPTTextStyleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C36468A90FE5533F0064B186 /* CPTTextStyleTests.m */; }; + C37EA6AD1BC83F2D0091C8F7 /* CPTTimeFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979A813D2328000145DFF /* CPTTimeFormatterTests.m */; }; + C37EA6AE1BC83F2D0091C8F7 /* CPTLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C1C07F1790D3B400E8B1B7 /* CPTLayerTests.m */; }; + C37EA6AF1BC83F2D0091C8F7 /* CPTScatterPlotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 07FEBD61110B7E8B00E44D37 /* CPTScatterPlotTests.m */; }; + C37EA6B11BC83F2D0091C8F7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; C38A09831A46185300D45436 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C38A09781A46185200D45436 /* CorePlot.framework */; }; C38A09C51A4619A900D45436 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C38A09BA1A4619A900D45436 /* libCorePlot-CocoaTouch.a */; }; C38A09D11A461C1100D45436 /* CPTTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0730F64D109494D100E95162 /* CPTTestCase.m */; }; C38A09D21A461C1300D45436 /* CPTTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0730F64D109494D100E95162 /* CPTTestCase.m */; }; C38A09D31A461C1800D45436 /* CPTDataSourceTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */; }; C38A09D41A461C1900D45436 /* CPTDataSourceTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */; }; - C38A09D51A461C1E00D45436 /* CorePlotProbes.d in Sources */ = {isa = PBXBuildFile; fileRef = BC89A64010239D1D009D5261 /* CorePlotProbes.d */; }; - C38A09D61A461C2B00D45436 /* CorePlotProbes.d in Sources */ = {isa = PBXBuildFile; fileRef = BC89A64010239D1D009D5261 /* CorePlotProbes.d */; }; C38A09D81A461C5800D45436 /* CPTNumericDataType.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EEFC104D80C400B554F9 /* CPTNumericDataType.h */; settings = {ATTRIBUTES = (Public, ); }; }; C38A09D91A461C6B00D45436 /* CPTNumericDataType.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EEFD104D80C400B554F9 /* CPTNumericDataType.m */; }; C38A09DA1A461C6C00D45436 /* CPTNumericDataType.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EEFD104D80C400B554F9 /* CPTNumericDataType.m */; }; @@ -562,6 +788,14 @@ C3A695E5146A19BC00AF5653 /* CPTMutablePlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = C3A695E3146A19BC00AF5653 /* CPTMutablePlotRange.h */; settings = {ATTRIBUTES = (Public, ); }; }; C3A695E6146A19BC00AF5653 /* CPTMutablePlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A695E4146A19BC00AF5653 /* CPTMutablePlotRange.m */; }; C3AFC9D10FB62969005DFFDC /* CPTImage.h in Headers */ = {isa = PBXBuildFile; fileRef = C3AFC9CF0FB62969005DFFDC /* CPTImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C3B4D4971BC9983300450C37 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C37EA6921BC83F2A0091C8F7 /* CorePlot.framework */; }; + C3BB3C8E1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB3C8C1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h */; }; + C3BB3C8F1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB3C8C1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h */; }; + C3BB3C901C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB3C8C1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h */; }; + C3BB3C911C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */; }; + C3BB3C921C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */; }; + C3BB3C931C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */; }; + C3BB3C941C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */; }; C3BB93191B729BD200004527 /* CPTDebugQuickLook.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB93181B729BD200004527 /* CPTDebugQuickLook.h */; }; C3BB931A1B729BD200004527 /* CPTDebugQuickLook.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB93181B729BD200004527 /* CPTDebugQuickLook.h */; }; C3BFFD1112274CB500DE22AC /* CPTNumericDataTypeConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF08104D80D400B554F9 /* CPTNumericDataTypeConversionTests.m */; }; @@ -608,12 +842,10 @@ C3D979BB13D2347400145DFF /* CPTFillTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979BA13D2347300145DFF /* CPTFillTests.m */; }; C3DA34CC107AD7710051DA02 /* _CPTXYTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = C3DA34CA107AD7710051DA02 /* _CPTXYTheme.m */; }; C3DA34CD107AD7710051DA02 /* _CPTXYTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = C3DA34CB107AD7710051DA02 /* _CPTXYTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; - C3EE4E681A6C13260098F4E6 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A551A69F6F000F77249 /* Accelerate.framework */; }; C3EE4E691A6C133D0098F4E6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A511A69F6DA00F77249 /* QuartzCore.framework */; }; C3EE4E6A1A6C134B0098F4E6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; C3EE4E6B1A6C13560098F4E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A531A69F6DF00F77249 /* UIKit.framework */; }; C3EE4E6E1A6C15890098F4E6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07BF0D630F2B70B8002FCEA7 /* QuartzCore.framework */; }; - C3EE4E6F1A6C15920098F4E6 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3BB7D1416322F7E00BC9515 /* Accelerate.framework */; }; C3EE4E981A6C1E890098F4E6 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3EE4E971A6C1E890098F4E6 /* Cocoa.framework */; }; C3EE4E9A1A6C1F770098F4E6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07BF0D630F2B70B8002FCEA7 /* QuartzCore.framework */; }; C3EE4E9B1A6C1F8A0098F4E6 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3EE4E971A6C1E890098F4E6 /* Cocoa.framework */; }; @@ -647,6 +879,13 @@ remoteGlobalIDString = C38A09B91A4619A900D45436; remoteInfo = "CorePlot-CocoaTouch"; }; + C3B4D4951BC997F600450C37 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C37EA5C91BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -718,9 +957,9 @@ 07B69A5B12B6215000F4C16C /* CPTTextStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTTextStyle.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 07B69A5C12B6215000F4C16C /* CPTTextStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTTextStyle.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 07B69B1512B62ABB00F4C16C /* CPTMutableLineStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTMutableLineStyle.h; sourceTree = ""; }; - 07B69B1612B62ABB00F4C16C /* CPTMutableLineStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTMutableLineStyle.m; sourceTree = ""; }; + 07B69B1612B62ABB00F4C16C /* CPTMutableLineStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTMutableLineStyle.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 07BF0D630F2B70B8002FCEA7 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 07BF0D700F2B718F002FCEA7 /* CPTGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTGraph.h; sourceTree = ""; }; + 07BF0D700F2B718F002FCEA7 /* CPTGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTGraph.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 07BF0D710F2B718F002FCEA7 /* CPTGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTGraph.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 07BF0D760F2B723A002FCEA7 /* CPTPlotAreaFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotAreaFrame.h; sourceTree = ""; }; 07BF0D770F2B723A002FCEA7 /* CPTPlotAreaFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotAreaFrame.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; @@ -750,7 +989,6 @@ 07FCF2C5115B54AE00E46606 /* _CPTSlateTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTSlateTheme.m; sourceTree = ""; }; 07FEBD60110B7E8B00E44D37 /* CPTScatterPlotTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTScatterPlotTests.h; sourceTree = ""; }; 07FEBD61110B7E8B00E44D37 /* CPTScatterPlotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTScatterPlotTests.m; sourceTree = ""; }; - 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 32484B3F0F530E8B002151AD /* CPTPlotRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTPlotRange.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 32484B400F530E8B002151AD /* CPTPlotRange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotRange.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 32DBCF5E0370ADEE00C91783 /* CorePlot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorePlot_Prefix.pch; sourceTree = ""; }; @@ -767,21 +1005,20 @@ 4C97EF07104D80D400B554F9 /* CPTNumericDataTypeConversionTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTNumericDataTypeConversionTests.h; sourceTree = ""; }; 4C97EF08104D80D400B554F9 /* CPTNumericDataTypeConversionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTNumericDataTypeConversionTests.m; sourceTree = ""; }; 4C97EF10104D819100B554F9 /* CPTMutableNumericData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTMutableNumericData.h; sourceTree = ""; }; - 4C97EF11104D819100B554F9 /* CPTMutableNumericData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTMutableNumericData.m; sourceTree = ""; }; + 4C97EF11104D819100B554F9 /* CPTMutableNumericData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTMutableNumericData.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 4C97EF4C104D843E00B554F9 /* license.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = license.txt; sourceTree = ""; }; - 4C9A745D0FB24C7200918464 /* CPTDataSourceTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTDataSourceTestCase.h; sourceTree = ""; }; - 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTDataSourceTestCase.m; sourceTree = ""; }; + 4C9A745D0FB24C7200918464 /* CPTDataSourceTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTDataSourceTestCase.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTDataSourceTestCase.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 4CD23FFA0FFBE78400ADD2E2 /* CPTAxisLabelTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAxisLabelTests.h; sourceTree = ""; }; 4CD23FFB0FFBE78400ADD2E2 /* CPTAxisLabelTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTAxisLabelTests.m; sourceTree = ""; }; 4CD7E7E50F4B4F8200F9BCBB /* CPTTextLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTTextLayer.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 4CD7E7E60F4B4F8200F9BCBB /* CPTTextLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTTextLayer.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 4CD7E7EA0F4B4F9600F9BCBB /* CPTLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLayer.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 4CD7E7EB0F4B4F9600F9BCBB /* CPTLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTLayer.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 4CD7E7EB0F4B4F9600F9BCBB /* CPTLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTLayer.m; sourceTree = ""; }; 4CD7E7EE0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDecimalNumberExtensions.h; sourceTree = ""; }; 4CD7E7EF0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDecimalNumberExtensions.m; sourceTree = ""; }; 4CD7E9620F4B625900F9BCBB /* CPTUtilitiesTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTUtilitiesTests.h; sourceTree = ""; }; 4CD7E9630F4B625900F9BCBB /* CPTUtilitiesTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTUtilitiesTests.m; sourceTree = ""; }; - 8DC2EF5A0486A6940098B216 /* CorePlot-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "CorePlot-Info.plist"; sourceTree = ""; }; 8DC2EF5B0486A6940098B216 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9021E5690FC69B2900443472 /* doxygen.config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; lineEnding = 0; name = doxygen.config; path = ../documentation/doxygen/doxygen.config; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = ""; }; 906156BC0F375598001B75FC /* CPTLineStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLineStyle.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -807,7 +1044,6 @@ BC74A32F10FC402600E7E90D /* CPTPieChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPieChart.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; BC79F1340FD1CD6600510976 /* CPTGraphHostingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTGraphHostingView.h; sourceTree = ""; }; BC79F1350FD1CD6600510976 /* CPTGraphHostingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTGraphHostingView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - BC89A64010239D1D009D5261 /* CorePlotProbes.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; name = CorePlotProbes.d; path = TestResources/CorePlotProbes.d; sourceTree = SOURCE_ROOT; }; BCFC7C3510921FDB00DAECAA /* CPTAxisTitle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAxisTitle.h; sourceTree = ""; }; BCFC7C3610921FDB00DAECAA /* CPTAxisTitle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAxisTitle.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C30550EB1399BE5400E0151F /* CPTLegendEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLegendEntry.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -819,11 +1055,6 @@ C3226A451A69ED0900F77249 /* doxygen touch.config */ = {isa = PBXFileReference; lastKnownFileType = text; lineEnding = 0; name = "doxygen touch.config"; path = "../documentation/doxygen/doxygen touch.config"; sourceTree = ""; xcLanguageSpecificationIdentifier = ""; }; C3226A461A69ED1F00F77249 /* doxygen-cocoa-touch-tags.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = "doxygen-cocoa-touch-tags.xml"; path = "../documentation/doxygen/doxygen-cocoa-touch-tags.xml"; sourceTree = ""; }; C3226A471A69EE9200F77249 /* CorePlot-CocoaTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CorePlot-CocoaTouch.h"; sourceTree = ""; }; - C3226A4C1A69F07600F77249 /* CorePlotTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CorePlotTests-Info.plist"; sourceTree = SOURCE_ROOT; }; - C3226A4D1A69F09A00F77249 /* CorePlot-iOSTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CorePlot-iOSTests-Info.plist"; sourceTree = SOURCE_ROOT; }; - C3226A4E1A69F0AA00F77249 /* CorePlot-CocoaTouchTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CorePlot-CocoaTouchTests-Info.plist"; sourceTree = SOURCE_ROOT; }; - C3226A4F1A69F18C00F77249 /* CorePlot-CocoaTouch-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CorePlot-CocoaTouch-Info.plist"; sourceTree = ""; }; - C3226A501A69F1A700F77249 /* CorePlot_iOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CorePlot_iOS-Info.plist"; sourceTree = ""; }; C3226A511A69F6DA00F77249 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; C3226A531A69F6DF00F77249 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; C3226A551A69F6F000F77249 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Accelerate.framework; sourceTree = DEVELOPER_DIR; }; @@ -847,6 +1078,10 @@ C342601D0FAE096C00072842 /* _CPTFillImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTFillImage.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C342601E0FAE096C00072842 /* _CPTFillGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = _CPTFillGradient.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; C342601F0FAE096C00072842 /* CPTFill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTFill.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C3490DF120E028CF0089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-Info.plist"; sourceTree = ""; }; + C3490DF320E028D30089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-CocoaTouch-Info.plist"; sourceTree = ""; }; + C3490DF520E028D80089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-iOS-Info.plist"; sourceTree = ""; }; + C3490DF720E028DC0089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-tvOS-Info.plist"; sourceTree = ""; }; C349DCB2151AAFBF00BFD6A7 /* CPTCalendarFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTCalendarFormatter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; C349DCB3151AAFBF00BFD6A7 /* CPTCalendarFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTCalendarFormatter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C34AFE6911021D010041675A /* CPTPlotSymbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTPlotSymbol.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -854,11 +1089,20 @@ C34BF5BA10A67633007F0894 /* CPTPlotArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotArea.h; sourceTree = ""; }; C34BF5BB10A67633007F0894 /* CPTPlotArea.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotArea.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C34F570D19D8CE5500446248 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3564CBD22A2D0E1000A54C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; C36468A80FE5533F0064B186 /* CPTTextStyleTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTextStyleTests.h; sourceTree = ""; }; C36468A90FE5533F0064B186 /* CPTTextStyleTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTextStyleTests.m; sourceTree = ""; }; C36E89B811EE7F97003DE309 /* CPTPlotRangeTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotRangeTests.h; sourceTree = ""; }; C36E89B911EE7F97003DE309 /* CPTPlotRangeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlotRangeTests.m; sourceTree = ""; }; + C377B3B91C122AA600891DF8 /* CPTCalendarFormatterTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTCalendarFormatterTests.h; sourceTree = ""; }; + C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTCalendarFormatterTests.m; sourceTree = ""; }; C3791D07191D4C4C001EC514 /* CPTImagePlatformSpecific.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CPTImagePlatformSpecific.m; path = MacOnly/CPTImagePlatformSpecific.m; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C37A406320E02B9D00C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-tvOSTests-Info.plist"; sourceTree = ""; }; + C37A406520E02BA100C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-CocoaTouchTests-Info.plist"; sourceTree = ""; }; + C37A406720E02BA500C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-iOSTests-Info.plist"; sourceTree = ""; }; + C37A406920E02BE900C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlotTests-Info.plist"; sourceTree = ""; }; + C37EA6921BC83F2A0091C8F7 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C37EA6B71BC83F2D0091C8F7 /* UnitTests tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UnitTests tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; C38A09781A46185200D45436 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C38A09821A46185300D45436 /* UnitTests iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UnitTests iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; C38A09BA1A4619A900D45436 /* libCorePlot-CocoaTouch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libCorePlot-CocoaTouch.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -886,12 +1130,14 @@ C3AFC9D00FB62969005DFFDC /* CPTImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTImage.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3B235631009931400970270 /* doxygen-cocoa-tags.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = "doxygen-cocoa-tags.xml"; path = "../documentation/doxygen/doxygen-cocoa-tags.xml"; sourceTree = ""; }; C3B25EDF1AC23A7D0063CCD8 /* CorePlot.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CorePlot.h; sourceTree = ""; }; + C3BB3C8C1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTAnimationNSNumberPeriod.h; sourceTree = ""; }; + C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTAnimationNSNumberPeriod.m; sourceTree = ""; }; C3BB7D1416322F7E00BC9515 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; C3BB93181B729BD200004527 /* CPTDebugQuickLook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTDebugQuickLook.h; sourceTree = ""; }; C3C032C710B8DEDC003A11B6 /* CPTAxisLabelGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAxisLabelGroup.h; sourceTree = ""; }; C3C032C810B8DEDC003A11B6 /* CPTAxisLabelGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAxisLabelGroup.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3C1C07E1790D3B400E8B1B7 /* CPTLayerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTLayerTests.h; sourceTree = ""; }; - C3C1C07F1790D3B400E8B1B7 /* CPTLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTLayerTests.m; sourceTree = ""; }; + C3C1C07E1790D3B400E8B1B7 /* CPTLayerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLayerTests.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C3C1C07F1790D3B400E8B1B7 /* CPTLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTLayerTests.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3C2846F16584EB9006BA43C /* CPTAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTAnimation.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; C3C2847016584EB9006BA43C /* CPTAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAnimation.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3C2847316585085006BA43C /* _CPTAnimationTimingFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTAnimationTimingFunctions.h; sourceTree = ""; }; @@ -967,17 +1213,34 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C3EE4E6F1A6C15920098F4E6 /* Accelerate.framework in Frameworks */, C3EE4E981A6C1E890098F4E6 /* Cocoa.framework in Frameworks */, C3EE4E6E1A6C15890098F4E6 /* QuartzCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; + C37EA6291BC83F2A0091C8F7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C37EA62B1BC83F2A0091C8F7 /* CoreGraphics.framework in Frameworks */, + C37EA62C1BC83F2A0091C8F7 /* QuartzCore.framework in Frameworks */, + C37EA62D1BC83F2A0091C8F7 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C37EA6B01BC83F2D0091C8F7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C37EA6B11BC83F2D0091C8F7 /* CoreGraphics.framework in Frameworks */, + C3B4D4971BC9983300450C37 /* CorePlot.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C38A09741A46185200D45436 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C3226A5D1A69F72F00F77249 /* Accelerate.framework in Frameworks */, C3226A5F1A69F75400F77249 /* CoreGraphics.framework in Frameworks */, C3226A5E1A69F73800F77249 /* QuartzCore.framework in Frameworks */, C3226A5C1A69F72900F77249 /* UIKit.framework in Frameworks */, @@ -997,7 +1260,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C3226A561A69F6F000F77249 /* Accelerate.framework in Frameworks */, C3226A581A69F6FA00F77249 /* CoreGraphics.framework in Frameworks */, C3226A521A69F6DA00F77249 /* QuartzCore.framework in Frameworks */, C3226A541A69F6DF00F77249 /* UIKit.framework in Frameworks */, @@ -1008,7 +1270,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C3EE4E681A6C13260098F4E6 /* Accelerate.framework in Frameworks */, C3EE4E6A1A6C134B0098F4E6 /* CoreGraphics.framework in Frameworks */, C3EE4E691A6C133D0098F4E6 /* QuartzCore.framework in Frameworks */, C3EE4E6B1A6C13560098F4E6 /* UIKit.framework in Frameworks */, @@ -1028,6 +1289,8 @@ C38A09821A46185300D45436 /* UnitTests iOS.xctest */, C38A09BA1A4619A900D45436 /* libCorePlot-CocoaTouch.a */, C38A09C41A4619A900D45436 /* CorePlot-CocoaTouchTests.xctest */, + C37EA6921BC83F2A0091C8F7 /* CorePlot.framework */, + C37EA6B71BC83F2D0091C8F7 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -1355,9 +1618,10 @@ isa = PBXGroup; children = ( 071F3CB810FBAB5900D0A7B6 /* License.txt */, - 8DC2EF5A0486A6940098B216 /* CorePlot-Info.plist */, - C3226A4F1A69F18C00F77249 /* CorePlot-CocoaTouch-Info.plist */, - C3226A501A69F1A700F77249 /* CorePlot_iOS-Info.plist */, + C3490DF220E028CF0089F309 /* CorePlot-Info.plist */, + C3490DF420E028D30089F309 /* CorePlot-CocoaTouch-Info.plist */, + C3490DF620E028D80089F309 /* CorePlot-iOS-Info.plist */, + C3490DF820E028DC0089F309 /* CorePlot-tvOS-Info.plist */, 089C1666FE841158C02AAC07 /* InfoPlist.strings */, ); name = Resources; @@ -1441,7 +1705,6 @@ 0730F64D109494D100E95162 /* CPTTestCase.m */, 4C9A745D0FB24C7200918464 /* CPTDataSourceTestCase.h */, 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */, - BC89A64010239D1D009D5261 /* CorePlotProbes.d */, ); name = Testing; path = Source; @@ -1503,9 +1766,10 @@ C3226A4B1A69F02900F77249 /* Resources */ = { isa = PBXGroup; children = ( - C3226A4C1A69F07600F77249 /* CorePlotTests-Info.plist */, - C3226A4D1A69F09A00F77249 /* CorePlot-iOSTests-Info.plist */, - C3226A4E1A69F0AA00F77249 /* CorePlot-CocoaTouchTests-Info.plist */, + C37A406A20E02BE900C4FF48 /* CorePlotTests-Info.plist */, + C37A406820E02BA500C4FF48 /* CorePlot-iOSTests-Info.plist */, + C37A406620E02BA100C4FF48 /* CorePlot-CocoaTouchTests-Info.plist */, + C37A406420E02B9D00C4FF48 /* CorePlot-tvOSTests-Info.plist */, ); name = Resources; sourceTree = ""; @@ -1671,6 +1935,8 @@ A92C0C3DB583ED8FC2EFD9DB /* _CPTAnimationCGRectPeriod.m */, A92C0685ACE3281299F10F73 /* _CPTAnimationNSDecimalPeriod.h */, A92C00B71DCB2085A92BE0A9 /* _CPTAnimationNSDecimalPeriod.m */, + C3BB3C8C1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h */, + C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */, A92C0E16290C226BC4BE3936 /* _CPTAnimationPlotRangePeriod.h */, A92C091B8592D9F32AC384CB /* _CPTAnimationPlotRangePeriod.m */, C3C2847316585085006BA43C /* _CPTAnimationTimingFunctions.h */, @@ -1682,6 +1948,8 @@ C3D979A513D2159400145DFF /* Tests */ = { isa = PBXGroup; children = ( + C377B3B91C122AA600891DF8 /* CPTCalendarFormatterTests.h */, + C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */, C3D979A713D2328000145DFF /* CPTTimeFormatterTests.h */, C3D979A813D2328000145DFF /* CPTTimeFormatterTests.m */, ); @@ -1775,6 +2043,7 @@ BC55023210059F22005DF982 /* _CPTPlainBlackTheme.h in Headers */, BC55023410059F22005DF982 /* _CPTPlainWhiteTheme.h in Headers */, BC55023610059F22005DF982 /* _CPTStocksTheme.h in Headers */, + C3BB3C8E1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */, 07A2E6FC102DF47900809BC5 /* CPTTimeFormatter.h in Headers */, 4C97EEFE104D80C400B554F9 /* CPTNumericData+TypeConversion.h in Headers */, 4C97EF01104D80C400B554F9 /* CPTNumericData.h in Headers */, @@ -1826,6 +2095,109 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C37EA62E1BC83F2A0091C8F7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C37EA62F1BC83F2A0091C8F7 /* CPTLimitBand.h in Headers */, + C37EA6301BC83F2A0091C8F7 /* CPTDefinitions.h in Headers */, + C37EA6311BC83F2A0091C8F7 /* CPTPlotSymbol.h in Headers */, + C37EA6321BC83F2A0091C8F7 /* CPTTradingRangePlot.h in Headers */, + C37EA6331BC83F2A0091C8F7 /* CPTGraph.h in Headers */, + C37EA6341BC83F2A0091C8F7 /* CPTGridLines.h in Headers */, + C3BB3C901C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */, + C37EA6351BC83F2A0091C8F7 /* CPTTextStyle.h in Headers */, + C37EA6361BC83F2A0091C8F7 /* CPTMutablePlotRange.h in Headers */, + C37EA6371BC83F2A0091C8F7 /* CPTPieChart.h in Headers */, + C37EA6381BC83F2A0091C8F7 /* CPTMutableNumericData+TypeConversion.h in Headers */, + C37EA6391BC83F2A0091C8F7 /* CPTAxisLabelGroup.h in Headers */, + C37EA63A1BC83F2A0091C8F7 /* CPTPlotSpace.h in Headers */, + C37EA63B1BC83F2A0091C8F7 /* CPTGraphHostingView.h in Headers */, + C37EA63C1BC83F2A0091C8F7 /* CPTColorSpace.h in Headers */, + C37EA63D1BC83F2A0091C8F7 /* CPTXYPlotSpace.h in Headers */, + C37EA63E1BC83F2A0091C8F7 /* CPTLineStyle.h in Headers */, + C37EA63F1BC83F2A0091C8F7 /* CPTPathExtensions.h in Headers */, + C37EA6401BC83F2A0091C8F7 /* _CPTBorderLayer.h in Headers */, + C37EA6411BC83F2A0091C8F7 /* CPTNumericData.h in Headers */, + C37EA6421BC83F2A0091C8F7 /* CPTLineCap.h in Headers */, + C37EA6431BC83F2A0091C8F7 /* _CPTFillGradient.h in Headers */, + C37EA6441BC83F2A0091C8F7 /* CPTNumericDataType.h in Headers */, + C37EA6451BC83F2A0091C8F7 /* CPTAnimationPeriod.h in Headers */, + C37EA6461BC83F2A0091C8F7 /* _CPTPlainWhiteTheme.h in Headers */, + C37EA6471BC83F2A0091C8F7 /* CPTBorderedLayer.h in Headers */, + C37EA6481BC83F2A0091C8F7 /* CPTAxisSet.h in Headers */, + C37EA6491BC83F2A0091C8F7 /* CPTScatterPlot.h in Headers */, + C37EA64A1BC83F2A0091C8F7 /* CPTMutableShadow.h in Headers */, + C37EA64B1BC83F2A0091C8F7 /* _CPTPlainBlackTheme.h in Headers */, + C37EA64C1BC83F2A0091C8F7 /* _CPTAnimationNSDecimalPeriod.h in Headers */, + C37EA64D1BC83F2A0091C8F7 /* CPTCalendarFormatter.h in Headers */, + C37EA64E1BC83F2A0091C8F7 /* CPTTextLayer.h in Headers */, + C37EA64F1BC83F2A0091C8F7 /* CPTResponder.h in Headers */, + C37EA6501BC83F2A0091C8F7 /* CPTLayer.h in Headers */, + C37EA6511BC83F2A0091C8F7 /* CPTPlotAreaFrame.h in Headers */, + C37EA6521BC83F2A0091C8F7 /* CPTXYAxis.h in Headers */, + C37EA6531BC83F2A0091C8F7 /* _CPTStocksTheme.h in Headers */, + C37EA6541BC83F2A0091C8F7 /* CPTImage.h in Headers */, + C37EA6551BC83F2A0091C8F7 /* CPTTheme.h in Headers */, + C37EA6561BC83F2A0091C8F7 /* CPTPlatformSpecificCategories.h in Headers */, + C37EA6571BC83F2A0091C8F7 /* NSNumberExtensions.h in Headers */, + C37EA6581BC83F2A0091C8F7 /* _CPTConstraintsRelative.h in Headers */, + C37EA6591BC83F2A0091C8F7 /* CPTAnimationOperation.h in Headers */, + C37EA65A1BC83F2A0091C8F7 /* _CPTDarkGradientTheme.h in Headers */, + C37EA65B1BC83F2A0091C8F7 /* CPTRangePlot.h in Headers */, + C37EA65C1BC83F2A0091C8F7 /* _CPTAnimationCGSizePeriod.h in Headers */, + C37EA65D1BC83F2A0091C8F7 /* CPTPlotGroup.h in Headers */, + C37EA65E1BC83F2A0091C8F7 /* CPTLegend.h in Headers */, + C37EA65F1BC83F2A0091C8F7 /* _CPTFillImage.h in Headers */, + C37EA6601BC83F2A0091C8F7 /* _CPTAnimationCGRectPeriod.h in Headers */, + C37EA6611BC83F2A0091C8F7 /* CPTPlotSpaceAnnotation.h in Headers */, + C37EA6621BC83F2A0091C8F7 /* CPTConstraints.h in Headers */, + C37EA6631BC83F2A0091C8F7 /* NSCoderExtensions.h in Headers */, + C37EA6641BC83F2A0091C8F7 /* CPTNumericData+TypeConversion.h in Headers */, + C37EA6651BC83F2A0091C8F7 /* _CPTFillColor.h in Headers */, + C37EA6661BC83F2A0091C8F7 /* _CPTXYTheme.h in Headers */, + C37EA6671BC83F2A0091C8F7 /* CPTLayerAnnotation.h in Headers */, + C37EA6681BC83F2A0091C8F7 /* _CPTAnimationCGFloatPeriod.h in Headers */, + C37EA6691BC83F2A0091C8F7 /* CPTAxisTitle.h in Headers */, + C37EA66A1BC83F2A0091C8F7 /* _CPTSlateTheme.h in Headers */, + C37EA66B1BC83F2A0091C8F7 /* CPTMutableNumericData.h in Headers */, + C37EA66C1BC83F2A0091C8F7 /* CPTGridLineGroup.h in Headers */, + C37EA66D1BC83F2A0091C8F7 /* CorePlot.h in Headers */, + C37EA66E1BC83F2A0091C8F7 /* CPTMutableLineStyle.h in Headers */, + C37EA66F1BC83F2A0091C8F7 /* CPTAnimation.h in Headers */, + C37EA6701BC83F2A0091C8F7 /* CPTExceptions.h in Headers */, + C37EA6711BC83F2A0091C8F7 /* CPTPlot.h in Headers */, + C37EA6721BC83F2A0091C8F7 /* CPTShadow.h in Headers */, + C37EA6731BC83F2A0091C8F7 /* CPTAnnotation.h in Headers */, + C37EA6741BC83F2A0091C8F7 /* CPTColor.h in Headers */, + C37EA6751BC83F2A0091C8F7 /* CPTTextStylePlatformSpecific.h in Headers */, + C37EA6761BC83F2A0091C8F7 /* CPTFill.h in Headers */, + C37EA6771BC83F2A0091C8F7 /* CPTPlotRange.h in Headers */, + C37EA6781BC83F2A0091C8F7 /* CPTXYAxisSet.h in Headers */, + C37EA6791BC83F2A0091C8F7 /* CPTTimeFormatter.h in Headers */, + C37EA67A1BC83F2A0091C8F7 /* CPTLegendEntry.h in Headers */, + C37EA67B1BC83F2A0091C8F7 /* CPTPlotArea.h in Headers */, + C37EA67C1BC83F2A0091C8F7 /* _CPTMaskLayer.h in Headers */, + C37EA67D1BC83F2A0091C8F7 /* _CPTAnimationPlotRangePeriod.h in Headers */, + C37EA67E1BC83F2A0091C8F7 /* CPTFunctionDataSource.h in Headers */, + C37EA67F1BC83F2A0091C8F7 /* CPTGradient.h in Headers */, + C37EA6801BC83F2A0091C8F7 /* _CPTAnimationCGPointPeriod.h in Headers */, + C37EA6811BC83F2A0091C8F7 /* NSDecimalNumberExtensions.h in Headers */, + C37EA6821BC83F2A0091C8F7 /* CPTAxis.h in Headers */, + C37EA6831BC83F2A0091C8F7 /* CPTPlatformSpecificFunctions.h in Headers */, + C37EA6841BC83F2A0091C8F7 /* CPTAnnotationHostLayer.h in Headers */, + C37EA6851BC83F2A0091C8F7 /* CPTAxisLabel.h in Headers */, + C37EA6861BC83F2A0091C8F7 /* CPTDebugQuickLook.h in Headers */, + C37EA6871BC83F2A0091C8F7 /* _CPTAnimationTimingFunctions.h in Headers */, + C37EA6881BC83F2A0091C8F7 /* CPTMutableTextStyle.h in Headers */, + C37EA6891BC83F2A0091C8F7 /* CPTXYGraph.h in Headers */, + C37EA68A1BC83F2A0091C8F7 /* CPTPlatformSpecificDefines.h in Headers */, + C37EA68B1BC83F2A0091C8F7 /* CPTBarPlot.h in Headers */, + C37EA68C1BC83F2A0091C8F7 /* CPTUtilities.h in Headers */, + C37EA68D1BC83F2A0091C8F7 /* _CPTConstraintsFixed.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C38A09751A46185200D45436 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -1836,6 +2208,7 @@ C38A0AC61A46255C00D45436 /* CPTTradingRangePlot.h in Headers */, C38A0AA71A46240300D45436 /* CPTGraph.h in Headers */, C38A0ADA1A4625B100D45436 /* CPTGridLines.h in Headers */, + C3BB3C8F1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */, C38A0A4A1A461F1500D45436 /* CPTTextStyle.h in Headers */, C38A09FB1A461D0F00D45436 /* CPTMutablePlotRange.h in Headers */, C38A0AC31A46255C00D45436 /* CPTPieChart.h in Headers */, @@ -1968,6 +2341,42 @@ productReference = 8DC2EF5B0486A6940098B216 /* CorePlot.framework */; productType = "com.apple.product-type.framework"; }; + C37EA5C91BC83F2A0091C8F7 /* CorePlot tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C37EA68F1BC83F2A0091C8F7 /* Build configuration list for PBXNativeTarget "CorePlot tvOS" */; + buildPhases = ( + C37EA5CA1BC83F2A0091C8F7 /* Sources */, + C37EA6291BC83F2A0091C8F7 /* Frameworks */, + C37EA62E1BC83F2A0091C8F7 /* Headers */, + C37EA68E1BC83F2A0091C8F7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "CorePlot tvOS"; + productName = "CorePlot-iOS"; + productReference = C37EA6921BC83F2A0091C8F7 /* CorePlot.framework */; + productType = "com.apple.product-type.framework"; + }; + C37EA6941BC83F2D0091C8F7 /* UnitTests tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C37EA6B41BC83F2D0091C8F7 /* Build configuration list for PBXNativeTarget "UnitTests tvOS" */; + buildPhases = ( + C37EA6971BC83F2D0091C8F7 /* Sources */, + C37EA6B01BC83F2D0091C8F7 /* Frameworks */, + C37EA6B31BC83F2D0091C8F7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C3B4D4961BC997F600450C37 /* PBXTargetDependency */, + ); + name = "UnitTests tvOS"; + productName = "CorePlot-iOSTests"; + productReference = C37EA6B71BC83F2D0091C8F7 /* UnitTests tvOS.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; C38A09771A46185200D45436 /* CorePlot iOS */ = { isa = PBXNativeTarget; buildConfigurationList = C38A098F1A46185300D45436 /* Build configuration list for PBXNativeTarget "CorePlot iOS" */; @@ -2046,7 +2455,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 1100; TargetAttributes = { 8DC2EF4F0486A6940098B216 = { DevelopmentTeam = 28ZA45DE7D; @@ -2067,13 +2476,14 @@ }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CorePlot" */; compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + en, + de, + ja, + fr, ); mainGroup = 0867D691FE84028FC02AAC07 /* CorePlot */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; @@ -2086,10 +2496,13 @@ C38A09811A46185300D45436 /* UnitTests iOS */, C38A09B91A4619A900D45436 /* CorePlot-CocoaTouch */, C38A09C31A4619A900D45436 /* CorePlot-CocoaTouchTests */, + C37EA5C91BC83F2A0091C8F7 /* CorePlot tvOS */, + C37EA6941BC83F2D0091C8F7 /* UnitTests tvOS */, 9021E49E0FC5C9DC00443472 /* Documentation-Mac */, C38A09911A4618B600D45436 /* Documentation-iOS */, C38A09961A46193F00D45436 /* Universal Library */, C3A5467F1BC1A817005C1BBC /* Universal iOS Framework */, + C37EA5C41BC83E900091C8F7 /* Universal tvOS Framework */, ); }; /* End PBXProject section */ @@ -2111,6 +2524,20 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C37EA68E1BC83F2A0091C8F7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C37EA6B31BC83F2D0091C8F7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; C38A09761A46185200D45436 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2146,7 +2573,20 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Build the doxygen documentation for the project and load the docset into Xcode.\n\n# Use the following to adjust the value of the $DOXYGEN_PATH User-Defined Setting:\n# Binary install location: /Applications/Doxygen.app/Contents/Resources/doxygen\n# Source build install location: /usr/local/bin/doxygen\n\n# Graphical class diagrams require Graphviz.\n# Graphviz.app is available free online\n# http://www.graphviz.org/Download_macos.php\n\n# If the config file doesn't exist, run 'doxygen -g \"${SOURCE_ROOT}/../documentation/doxygen/doxygen.config\"' to \n# a get default file.\n\nDOXYGEN_FOLDER=\"${SOURCE_ROOT}/../documentation/doxygen\"\n\nif ! [ -f \"${DOXYGEN_FOLDER}/doxygen.config\" ] \nthen \n echo doxygen config file does not exist\n ${DOXYGEN_PATH} -g \"${DOXYGEN_FOLDER}/doxygen.config\"\nfi\n\n# Run doxygen on the updated config file.\n# Note: doxygen creates a Makefile that does most of the heavy lifting.\n${DOXYGEN_PATH} \"${DOXYGEN_FOLDER}/doxygen.config\"\n\n# make a copy of the html docs\nDOCS_FOLDER=\"${SOURCE_ROOT}/../documentation/html/MacOS\"\nmkdir -p \"${DOCS_FOLDER}\"\ncp -R \"${SOURCE_ROOT}/CorePlotDocs.docset/html/\" \"${DOCS_FOLDER}\"\nrm -f \"${DOCS_FOLDER}/Info.plist\"\nrm -f \"${DOCS_FOLDER}/Makefile\"\nrm -f \"${DOCS_FOLDER}/Nodes.xml\"\nrm -f \"${DOCS_FOLDER}/Tokens.xml\"\n\n# fix nodes.xml so the docset gets the correct index page\nsed -i 's|index.html|index.html' \"${SOURCE_ROOT}/CorePlotDocs.docset/html/nodes.xml\"\n\n# make will invoke docsetutil. Take a look at the Makefile to see how this is done.\nmake -C \"${SOURCE_ROOT}/CorePlotDocs.docset/html\" install\n\n# add publisher info to the docset\nDOCSET_FOLDER=\"/Users/${USER}/Library/Developer/Shared/Documentation/DocSets/com.CorePlot.Framework.docset\"\n\nfind \"${DOCSET_FOLDER}/Contents/\" -type f -name Info.plist | xargs perl -pi -e 's/\\<\\/dict\\>/\\t\\DocSetPublisherIdentifier\\<\\/key\\>\\n\\t\\com.CorePlot.documentation\\<\\/string\\>\\n\\t\\DocSetPublisherName\\<\\/key\\>\\n\\t\\Core Plot\\<\\/string\\>\\n\\t\\NSHumanReadableCopyright\\<\\/key\\>\\n\\t\\Copyright © 2013 Core Plot. All rights reserved.\\<\\/string\\>\\n\\t\\isJavaScriptEnabled\\<\\/key\\>\\n\\t\\\\n\\<\\/dict\\>\\n/g'\n\n# add docset icon\ncp \"${DOXYGEN_FOLDER}/icon.png\" \"${DOCSET_FOLDER}\"\n\n# make a copy of the docset\nrm -Rf \"${SOURCE_ROOT}/CorePlotDocs.docset\"\ncp -R \"${DOCSET_FOLDER}\" \"${SOURCE_ROOT}\"\n\n# Construct a temporary applescript file to tell Xcode to load a docset.\nrm -f \"${TEMP_DIR}/loadDocSet.scpt\"\n\necho \"tell application \\\"Xcode\\\"\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\necho \"load documentation set with path \\\"/Users/${USER}/Library/Developer/Shared/Documentation/DocSets/\\\"\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\necho \"end tell\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\n\n# Run the load-docset applescript command.\nosascript \"${TEMP_DIR}/loadDocSet.scpt\"\n\nexit 0"; + shellScript = "# Build the doxygen documentation for the project and load the docset into Xcode.\n\n# Use the following to adjust the value of the $DOXYGEN_PATH User-Defined Setting:\n# Binary install location: /Applications/Doxygen.app/Contents/Resources/doxygen\n# Source build install location: /usr/local/bin/doxygen\n\n# Graphical class diagrams require Graphviz.\n# Graphviz.app is available free online\n# http://www.graphviz.org/Download_macos.php\n\n# If the config file doesn't exist, run 'doxygen -g \"${SOURCE_ROOT}/../documentation/doxygen/doxygen.config\"' to \n# a get default file.\n\nDOXYGEN_FOLDER=\"${SOURCE_ROOT}/../documentation/doxygen\"\n\nif ! [ -f \"${DOXYGEN_FOLDER}/doxygen.config\" ] \nthen \n echo doxygen config file does not exist\n ${DOXYGEN_PATH} -g \"${DOXYGEN_FOLDER}/doxygen.config\"\nfi\n\n# Run doxygen on the updated config file.\n# Note: doxygen creates a Makefile that does most of the heavy lifting.\n${DOXYGEN_PATH} \"${DOXYGEN_FOLDER}/doxygen.config\"\n\n# make a copy of the html docs\nDOCS_FOLDER=\"${SOURCE_ROOT}/../documentation/html/MacOS\"\nmkdir -p \"${DOCS_FOLDER}\"\ncp -R \"${SOURCE_ROOT}/CorePlotDocs.docset/html/\" \"${DOCS_FOLDER}\"\nrm -Rf \"${SOURCE_ROOT}/CorePlotDocs.docset\"\nrm -f \"${DOCS_FOLDER}/Info.plist\"\nrm -f \"${DOCS_FOLDER}/Makefile\"\nrm -f \"${DOCS_FOLDER}/Nodes.xml\"\nrm -f \"${DOCS_FOLDER}/Tokens.xml\"\n\nexit 0"; + }; + C37EA5C51BC83E900091C8F7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\nUFW_TARGET=\"CorePlot tvOS\"\nUFW_BUILD_DIR=\"${PROJECT_DIR}/../build\"\n\nif [ -z ${SDK_NAME} ]; then\n# Use the latest tvOS SDK available\nUFW_GREP_RESULT=$(xcodebuild -showsdks | grep -o \"appletvos.*$\")\nwhile read -r line; do\nUFW_SDK_VERSION=\"${line}\"\ndone <<< \"${UFW_GREP_RESULT}\"\nelse\n# Use the SDK specified by XCode\nUFW_SDK_VERSION=\"${SDK_NAME}\"\nfi\n\nFRAMEWORK_NAME=\"${PROJECT_NAME}\"\nUFW_SDK_VERSION=$(echo \"${UFW_SDK_VERSION}\" | grep -o \"[0-9].*$\")\nUFW_IPHONE_PATH=\"${UFW_BUILD_DIR}/Release-appletvos/${FRAMEWORK_NAME}.framework\"\nUFW_SIMULATOR_PATH=\"${UFW_BUILD_DIR}/Release-appletvsimulator/${FRAMEWORK_NAME}.framework\"\nUFW_UNIVERSAL_DIR=\"${UFW_BUILD_DIR}/Release-appletvuniversal\"\nUFW_FRAMEWORK=\"${UFW_UNIVERSAL_DIR}/${FRAMEWORK_NAME}.framework\"\n\n# Build Framework\n\nrm -rf \"${UFW_UNIVERSAL_DIR}\"\n\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk appletvos${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk appletvsimulator${UFW_SDK_VERSION} build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\n\nmkdir -p \"${UFW_UNIVERSAL_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\ncp -r \"${UFW_IPHONE_PATH}/.\" \"${UFW_FRAMEWORK}\"\n\nlipo -create -output \"${UFW_FRAMEWORK}/${FRAMEWORK_NAME}\" \"${UFW_SIMULATOR_PATH}/${FRAMEWORK_NAME}\" \"${UFW_IPHONE_PATH}/${FRAMEWORK_NAME}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: lipo failed\"; exit 1; fi\n"; }; C38A09921A4618B600D45436 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -2159,7 +2599,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Build the doxygen documentation for the project and load the docset into Xcode.\n\n# Use the following to adjust the value of the $DOXYGEN_PATH User-Defined Setting:\n# Binary install location: /Applications/Doxygen.app/Contents/Resources/doxygen\n# Source build install location: /usr/local/bin/doxygen\n\n# Graphical class diagrams require Graphviz.\n# Graphviz.app is available free online\n# http://www.graphviz.org/Download_macos.php\n\n# If the config file doesn't exist, run 'doxygen -g \"${SOURCE_ROOT}/../documentation/doxygen/doxygen touch.config\"' to\n# a get default file.\n\nDOXYGEN_FOLDER=\"${SOURCE_ROOT}/../documentation/doxygen\"\n\nif ! [ -f \"${DOXYGEN_FOLDER}/doxygen.config\" ]\nthen\necho doxygen config file does not exist\n${DOXYGEN_PATH} -g \"${DOXYGEN_FOLDER}/doxygen.config\"\nfi\n\n# Run doxygen on the updated config file.\n# Note: doxygen creates a Makefile that does most of the heavy lifting.\n${DOXYGEN_PATH} \"${SOURCE_ROOT}/../documentation/doxygen/doxygen touch.config\"\n\n# make a copy of the html docs\nDOCS_FOLDER=\"${SOURCE_ROOT}/../documentation/html/iOS\"\nmkdir -p \"${DOCS_FOLDER}\"\ncp -R \"${SOURCE_ROOT}/CorePlotTouchDocs.docset/html/\" \"${DOCS_FOLDER}\"\nrm -f \"${DOCS_FOLDER}/Info.plist\"\nrm -f \"${DOCS_FOLDER}/Makefile\"\nrm -f \"${DOCS_FOLDER}/Nodes.xml\"\nrm -f \"${DOCS_FOLDER}/Tokens.xml\"\n\n# fix nodes.xml so the docset gets the correct index page\nsed -i 's|index.html|index.html' \"${SOURCE_ROOT}/CorePlotTouchDocs.docset/html/nodes.xml\"\n\n# make will invoke docsetutil. Take a look at the Makefile to see how this is done.\nmake -C \"${SOURCE_ROOT}/CorePlotTouchDocs.docset/html\" install\n\n# add publisher info to the docset\nDOCSET_FOLDER=\"/Users/${USER}/Library/Developer/Shared/Documentation/DocSets/com.CorePlotTouch.Framework.docset\"\n\nfind \"${DOCSET_FOLDER}/Contents/\" -type f -name Info.plist | xargs perl -pi -e 's/\\<\\/dict\\>/\\t\\DocSetPublisherIdentifier\\<\\/key\\>\\n\\t\\com.CorePlot.documentation\\<\\/string\\>\\n\\t\\DocSetPublisherName\\<\\/key\\>\\n\\t\\Core Plot\\<\\/string\\>\\n\\t\\NSHumanReadableCopyright\\<\\/key\\>\\n\\t\\Copyright © 2013 Core Plot. All rights reserved.\\<\\/string\\>\\n\\t\\isJavaScriptEnabled\\<\\/key\\>\\n\\t\\\\n\\<\\/dict\\>\\n/g'\n\n# add docset icon\ncp \"${DOXYGEN_FOLDER}/icon.png\" \"${DOCSET_FOLDER}\"\n\n# make a copy of the docset\nrm -Rf \"${SOURCE_ROOT}/CorePlotTouchDocs.docset\"\ncp -R \"${DOCSET_FOLDER}\" \"${SOURCE_ROOT}\"\n\n# Construct a temporary applescript file to tell Xcode to load a docset.\nrm -f \"${TEMP_DIR}/loadDocSet.scpt\"\n\necho \"tell application \\\"Xcode\\\"\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\necho \"load documentation set with path \\\"/Users/${USER}/Library/Developer/Shared/Documentation/DocSets/\\\"\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\necho \"end tell\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\n\n# Run the load-docset applescript command.\nosascript \"${TEMP_DIR}/loadDocSet.scpt\"\n\nexit 0"; + shellScript = "# Build the doxygen documentation for the project and load the docset into Xcode.\n\n# Use the following to adjust the value of the $DOXYGEN_PATH User-Defined Setting:\n# Binary install location: /Applications/Doxygen.app/Contents/Resources/doxygen\n# Source build install location: /usr/local/bin/doxygen\n\n# Graphical class diagrams require Graphviz.\n# Graphviz.app is available free online\n# http://www.graphviz.org/Download_macos.php\n\n# If the config file doesn't exist, run 'doxygen -g \"${SOURCE_ROOT}/../documentation/doxygen/doxygen touch.config\"' to\n# a get default file.\n\nDOXYGEN_FOLDER=\"${SOURCE_ROOT}/../documentation/doxygen\"\n\nif ! [ -f \"${DOXYGEN_FOLDER}/doxygen.config\" ]\nthen\necho doxygen config file does not exist\n${DOXYGEN_PATH} -g \"${DOXYGEN_FOLDER}/doxygen.config\"\nfi\n\n# Run doxygen on the updated config file.\n# Note: doxygen creates a Makefile that does most of the heavy lifting.\n${DOXYGEN_PATH} \"${SOURCE_ROOT}/../documentation/doxygen/doxygen touch.config\"\n\n# make a copy of the html docs\nDOCS_FOLDER=\"${SOURCE_ROOT}/../documentation/html/iOS\"\nmkdir -p \"${DOCS_FOLDER}\"\ncp -R \"${SOURCE_ROOT}/CorePlotTouchDocs.docset/html/\" \"${DOCS_FOLDER}\"\nrm -Rf \"${SOURCE_ROOT}/CorePlotTouchDocs.docset\"\nrm -f \"${DOCS_FOLDER}/Info.plist\"\nrm -f \"${DOCS_FOLDER}/Makefile\"\nrm -f \"${DOCS_FOLDER}/Nodes.xml\"\nrm -f \"${DOCS_FOLDER}/Tokens.xml\"\n\nexit 0"; }; C38A09971A46193F00D45436 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -2172,7 +2612,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\nUFW_TARGET=\"CorePlot-CocoaTouch\"\nUFW_BUILD_DIR=\"${BUILD_DIR}\"\n\nif [ -z ${SDK_NAME} ]; then\n# Use the latest iphoneos SDK available\nUFW_GREP_RESULT=$(xcodebuild -showsdks | grep -o \"iphoneos.*$\")\nwhile read -r line; do\nUFW_SDK_VERSION=\"${line}\"\ndone <<< \"${UFW_GREP_RESULT}\"\nelse\n# Use the SDK specified by XCode\nUFW_SDK_VERSION=\"${SDK_NAME}\"\nfi\n\nUFW_SDK_VERSION=$(echo \"${UFW_SDK_VERSION}\" | grep -o \"[0-9].*$\")\nUFW_IPHONE_DIR=\"${UFW_BUILD_DIR}/Release-iphoneos\"\nUFW_SIMULATOR_DIR=\"${UFW_BUILD_DIR}/Release-iphonesimulator\"\nUFW_UNIVERSAL_DIR=\"${UFW_BUILD_DIR}/Release-universal\"\nUFW_HEADER_DIR=\"${UFW_UNIVERSAL_DIR}/CorePlotHeaders\"\nUFW_EXE_PATH=\"libCorePlot-CocoaTouch.a\"\n\n# Build Framework\n\nrm -rf \"${UFW_UNIVERSAL_DIR}\"\n\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphoneos${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphonesimulator${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\n\nmkdir -p \"${UFW_UNIVERSAL_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\nlipo -create -output \"${UFW_UNIVERSAL_DIR}/${UFW_EXE_PATH}\" \"${UFW_IPHONE_DIR}/${UFW_EXE_PATH}\" \"${UFW_SIMULATOR_DIR}/${UFW_EXE_PATH}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: lipo failed\"; exit 1; fi\n\n# copy header files\nmkdir -p \"${UFW_HEADER_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\ncp \"${SOURCE_ROOT}/CorePlot-CocoaTouch.h\" \"${UFW_HEADER_DIR}\"\ncp \"${SOURCE_ROOT}/iPhoneOnly/\"[!_]*.h \"${UFW_HEADER_DIR}/\"\ncp \"${SOURCE_ROOT}/Source/\"[!_]*.h \"${UFW_HEADER_DIR}/\"\n\nrm \"${UFW_HEADER_DIR}/\"*Tests.*"; + shellScript = "\nUFW_TARGET=\"CorePlot-CocoaTouch\"\nUFW_BUILD_DIR=\"${PROJECT_DIR}/../build\"\n\nif [ -z ${SDK_NAME} ]; then\n# Use the latest iphoneos SDK available\nUFW_GREP_RESULT=$(xcodebuild -showsdks | grep -o \"iphoneos.*$\")\nwhile read -r line; do\nUFW_SDK_VERSION=\"${line}\"\ndone <<< \"${UFW_GREP_RESULT}\"\nelse\n# Use the SDK specified by XCode\nUFW_SDK_VERSION=\"${SDK_NAME}\"\nfi\n\nUFW_SDK_VERSION=$(echo \"${UFW_SDK_VERSION}\" | grep -o \"[0-9].*$\")\nUFW_IPHONE_DIR=\"${UFW_BUILD_DIR}/Release-iphoneos\"\nUFW_SIMULATOR_DIR=\"${UFW_BUILD_DIR}/Release-iphonesimulator\"\nUFW_UNIVERSAL_DIR=\"${UFW_BUILD_DIR}/Release-universal\"\nUFW_HEADER_DIR=\"${UFW_UNIVERSAL_DIR}/CorePlotHeaders\"\nUFW_EXE_PATH=\"libCorePlot-CocoaTouch.a\"\n\n# Build Framework\n\nrm -rf \"${UFW_UNIVERSAL_DIR}\"\n\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphoneos${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphonesimulator${UFW_SDK_VERSION} build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\n\nmkdir -p \"${UFW_UNIVERSAL_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\nlipo -create -output \"${UFW_UNIVERSAL_DIR}/${UFW_EXE_PATH}\" \"${UFW_IPHONE_DIR}/${UFW_EXE_PATH}\" \"${UFW_SIMULATOR_DIR}/${UFW_EXE_PATH}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: lipo failed\"; exit 1; fi\n\n# copy header files\nmkdir -p \"${UFW_HEADER_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\ncp \"${SOURCE_ROOT}/CorePlot-CocoaTouch.h\" \"${UFW_HEADER_DIR}\"\ncp \"${SOURCE_ROOT}/iPhoneOnly/\"[!_]*.h \"${UFW_HEADER_DIR}/\"\ncp \"${SOURCE_ROOT}/Source/\"[!_]*.h \"${UFW_HEADER_DIR}/\"\n\nrm \"${UFW_HEADER_DIR}/\"*Tests.*\n"; }; C3A546801BC1A817005C1BBC /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -2185,7 +2625,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\nUFW_TARGET=\"CorePlot iOS\"\nUFW_BUILD_DIR=\"${BUILD_DIR}\"\n\nif [ -z ${SDK_NAME} ]; then\n# Use the latest iphoneos SDK available\nUFW_GREP_RESULT=$(xcodebuild -showsdks | grep -o \"iphoneos.*$\")\nwhile read -r line; do\nUFW_SDK_VERSION=\"${line}\"\ndone <<< \"${UFW_GREP_RESULT}\"\nelse\n# Use the SDK specified by XCode\nUFW_SDK_VERSION=\"${SDK_NAME}\"\nfi\n\nFRAMEWORK_NAME=\"${PROJECT_NAME}\"\nUFW_SDK_VERSION=$(echo \"${UFW_SDK_VERSION}\" | grep -o \"[0-9].*$\")\nUFW_IPHONE_PATH=\"${UFW_BUILD_DIR}/Release-iphoneos/${FRAMEWORK_NAME}.framework\"\nUFW_SIMULATOR_PATH=\"${UFW_BUILD_DIR}/Release-iphonesimulator/${FRAMEWORK_NAME}.framework\"\nUFW_UNIVERSAL_DIR=\"${UFW_BUILD_DIR}/Release-iphoneuniversal\"\nUFW_FRAMEWORK=\"${UFW_UNIVERSAL_DIR}/${FRAMEWORK_NAME}.framework\"\n\n# Build Framework\n\nrm -rf \"${UFW_UNIVERSAL_DIR}\"\n\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphoneos${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphonesimulator${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\n\nmkdir -p \"${UFW_UNIVERSAL_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\ncp -r \"${UFW_IPHONE_PATH}/.\" \"${UFW_FRAMEWORK}\"\n\nlipo -create -output \"${UFW_FRAMEWORK}/${FRAMEWORK_NAME}\" \"${UFW_SIMULATOR_PATH}/${FRAMEWORK_NAME}\" \"${UFW_IPHONE_PATH}/${FRAMEWORK_NAME}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: lipo failed\"; exit 1; fi\n"; + shellScript = "\nUFW_TARGET=\"CorePlot iOS\"\nUFW_BUILD_DIR=\"${PROJECT_DIR}/../build\"\n\nif [ -z ${SDK_NAME} ]; then\n# Use the latest iphoneos SDK available\nUFW_GREP_RESULT=$(xcodebuild -showsdks | grep -o \"iphoneos.*$\")\nwhile read -r line; do\nUFW_SDK_VERSION=\"${line}\"\ndone <<< \"${UFW_GREP_RESULT}\"\nelse\n# Use the SDK specified by XCode\nUFW_SDK_VERSION=\"${SDK_NAME}\"\nfi\n\nFRAMEWORK_NAME=\"${PROJECT_NAME}\"\nUFW_SDK_VERSION=$(echo \"${UFW_SDK_VERSION}\" | grep -o \"[0-9].*$\")\nUFW_IPHONE_PATH=\"${UFW_BUILD_DIR}/Release-iphoneos/${FRAMEWORK_NAME}.framework\"\nUFW_SIMULATOR_PATH=\"${UFW_BUILD_DIR}/Release-iphonesimulator/${FRAMEWORK_NAME}.framework\"\nUFW_UNIVERSAL_DIR=\"${UFW_BUILD_DIR}/Release-iphoneuniversal\"\nUFW_FRAMEWORK=\"${UFW_UNIVERSAL_DIR}/${FRAMEWORK_NAME}.framework\"\n\n# Build Framework\n\nrm -rf \"${UFW_UNIVERSAL_DIR}\"\n\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphoneos${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphonesimulator${UFW_SDK_VERSION} build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\n\nmkdir -p \"${UFW_UNIVERSAL_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\ncp -r \"${UFW_IPHONE_PATH}/.\" \"${UFW_FRAMEWORK}\"\n\nlipo -create -output \"${UFW_FRAMEWORK}/${FRAMEWORK_NAME}\" \"${UFW_SIMULATOR_PATH}/${FRAMEWORK_NAME}\" \"${UFW_IPHONE_PATH}/${FRAMEWORK_NAME}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: lipo failed\"; exit 1; fi\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -2215,6 +2655,7 @@ C3D979AF13D2337E00145DFF /* CPTColorSpaceTests.m in Sources */, C3D979B213D233C100145DFF /* CPTGradientTests.m in Sources */, C3D979B513D2340000145DFF /* CPTImageTests.m in Sources */, + C377B3BB1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */, C3D979B813D2344100145DFF /* CPTLineStyleTests.m in Sources */, C3D979BB13D2347400145DFF /* CPTFillTests.m in Sources */, C3C1C0801790D3B400E8B1B7 /* CPTLayerTests.m in Sources */, @@ -2269,7 +2710,6 @@ BC55023310059F22005DF982 /* _CPTPlainBlackTheme.m in Sources */, BC55023510059F22005DF982 /* _CPTPlainWhiteTheme.m in Sources */, BC55023710059F22005DF982 /* _CPTStocksTheme.m in Sources */, - BC89A64110239D1D009D5261 /* CorePlotProbes.d in Sources */, 07A2E6FD102DF47900809BC5 /* CPTTimeFormatter.m in Sources */, 4C97EF02104D80C400B554F9 /* CPTNumericData.m in Sources */, 4C97EF04104D80C400B554F9 /* CPTNumericDataType.m in Sources */, @@ -2300,6 +2740,7 @@ C3920AC51395B6500045F3BB /* CPTLegend.m in Sources */, C30550EE1399BE5400E0151F /* CPTLegendEntry.m in Sources */, C3978E0713CE653C00A420D9 /* NSCoderExtensions.m in Sources */, + C3BB3C911C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */, C3D3AD2E13DF8DCE0004EA73 /* CPTLineCap.m in Sources */, C3CCA03E13E8D85900CE6DB1 /* _CPTConstraintsFixed.m in Sources */, C3CCA04013E8D85900CE6DB1 /* _CPTConstraintsRelative.m in Sources */, @@ -2323,6 +2764,139 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C37EA5CA1BC83F2A0091C8F7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C37EA5CB1BC83F2A0091C8F7 /* CPTGraphHostingView.m in Sources */, + C37EA5CC1BC83F2A0091C8F7 /* CPTLayerAnnotation.m in Sources */, + C37EA5CD1BC83F2A0091C8F7 /* CPTLayer.m in Sources */, + C37EA5CE1BC83F2A0091C8F7 /* CPTTimeFormatter.m in Sources */, + C37EA5CF1BC83F2A0091C8F7 /* CPTColor.m in Sources */, + C37EA5D01BC83F2A0091C8F7 /* NSCoderExtensions.m in Sources */, + C37EA5D11BC83F2A0091C8F7 /* CPTMutableNumericData.m in Sources */, + C37EA5D21BC83F2A0091C8F7 /* CPTNumericData+TypeConversion.m in Sources */, + C37EA5D31BC83F2A0091C8F7 /* CPTTheme.m in Sources */, + C37EA5D41BC83F2A0091C8F7 /* CPTDefinitions.m in Sources */, + C37EA5D51BC83F2A0091C8F7 /* _CPTFillImage.m in Sources */, + C37EA5D61BC83F2A0091C8F7 /* CPTPlotSpaceAnnotation.m in Sources */, + C37EA5D71BC83F2A0091C8F7 /* CPTXYAxis.m in Sources */, + C37EA5D81BC83F2A0091C8F7 /* CPTBarPlot.m in Sources */, + C37EA5D91BC83F2A0091C8F7 /* CPTAxisTitle.m in Sources */, + C37EA5DA1BC83F2A0091C8F7 /* CPTPlatformSpecificDefines.m in Sources */, + C37EA5DB1BC83F2A0091C8F7 /* _CPTStocksTheme.m in Sources */, + C37EA5DC1BC83F2A0091C8F7 /* CPTImagePlatformSpecific.m in Sources */, + C37EA5DD1BC83F2A0091C8F7 /* _CPTAnimationCGFloatPeriod.m in Sources */, + C37EA5DE1BC83F2A0091C8F7 /* CPTExceptions.m in Sources */, + C37EA5DF1BC83F2A0091C8F7 /* _CPTDarkGradientTheme.m in Sources */, + C37EA5E01BC83F2A0091C8F7 /* _CPTPlainBlackTheme.m in Sources */, + C37EA5E11BC83F2A0091C8F7 /* CPTNumericData.m in Sources */, + C37EA5E31BC83F2A0091C8F7 /* CPTXYAxisSet.m in Sources */, + C37EA5E41BC83F2A0091C8F7 /* CPTLimitBand.m in Sources */, + C37EA5E51BC83F2A0091C8F7 /* CPTGridLines.m in Sources */, + C3BB3C941C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */, + C37EA5E61BC83F2A0091C8F7 /* CPTPathExtensions.m in Sources */, + C37EA5E71BC83F2A0091C8F7 /* CPTXYPlotSpace.m in Sources */, + C37EA5E81BC83F2A0091C8F7 /* CPTPlotRange.m in Sources */, + C37EA5E91BC83F2A0091C8F7 /* CPTImage.m in Sources */, + C37EA5EA1BC83F2A0091C8F7 /* CPTPlotSymbol.m in Sources */, + C37EA5EB1BC83F2A0091C8F7 /* CPTAxisSet.m in Sources */, + C37EA5EC1BC83F2A0091C8F7 /* CPTPlotGroup.m in Sources */, + C37EA5ED1BC83F2A0091C8F7 /* CPTAnimation.m in Sources */, + C37EA5EE1BC83F2A0091C8F7 /* _CPTAnimationNSDecimalPeriod.m in Sources */, + C37EA5EF1BC83F2A0091C8F7 /* _CPTAnimationPlotRangePeriod.m in Sources */, + C37EA5F01BC83F2A0091C8F7 /* CPTPlotAreaFrame.m in Sources */, + C37EA5F11BC83F2A0091C8F7 /* CPTAxisLabel.m in Sources */, + C37EA5F21BC83F2A0091C8F7 /* CPTShadow.m in Sources */, + C37EA5F31BC83F2A0091C8F7 /* _CPTAnimationCGPointPeriod.m in Sources */, + C37EA5F41BC83F2A0091C8F7 /* CPTPlatformSpecificFunctions.m in Sources */, + C37EA5F51BC83F2A0091C8F7 /* CPTMutableShadow.m in Sources */, + C37EA5F61BC83F2A0091C8F7 /* _CPTAnimationCGRectPeriod.m in Sources */, + C37EA5F71BC83F2A0091C8F7 /* CPTPlotSpace.m in Sources */, + C37EA5F81BC83F2A0091C8F7 /* CPTLineCap.m in Sources */, + C37EA5F91BC83F2A0091C8F7 /* CPTScatterPlot.m in Sources */, + C37EA5FA1BC83F2A0091C8F7 /* _CPTSlateTheme.m in Sources */, + C37EA5FB1BC83F2A0091C8F7 /* CPTAnimationPeriod.m in Sources */, + C37EA5FC1BC83F2A0091C8F7 /* CPTTextStylePlatformSpecific.m in Sources */, + C37EA5FD1BC83F2A0091C8F7 /* _CPTBorderLayer.m in Sources */, + C37EA5FE1BC83F2A0091C8F7 /* CPTLegendEntry.m in Sources */, + C37EA5FF1BC83F2A0091C8F7 /* CPTTradingRangePlot.m in Sources */, + C37EA6001BC83F2A0091C8F7 /* CPTTextLayer.m in Sources */, + C37EA6011BC83F2A0091C8F7 /* _CPTConstraintsRelative.m in Sources */, + C37EA6021BC83F2A0091C8F7 /* CPTAnnotationHostLayer.m in Sources */, + C37EA6031BC83F2A0091C8F7 /* CPTAnimationOperation.m in Sources */, + C37EA6041BC83F2A0091C8F7 /* _CPTFillGradient.m in Sources */, + C37EA6051BC83F2A0091C8F7 /* _CPTMaskLayer.m in Sources */, + C37EA6061BC83F2A0091C8F7 /* CPTCalendarFormatter.m in Sources */, + C37EA6071BC83F2A0091C8F7 /* CPTAnnotation.m in Sources */, + C37EA6081BC83F2A0091C8F7 /* _CPTFillColor.m in Sources */, + C37EA6091BC83F2A0091C8F7 /* _CPTAnimationTimingFunctions.m in Sources */, + C37EA60A1BC83F2A0091C8F7 /* CPTMutableLineStyle.m in Sources */, + C37EA60B1BC83F2A0091C8F7 /* NSDecimalNumberExtensions.m in Sources */, + C37EA60C1BC83F2A0091C8F7 /* CPTLegend.m in Sources */, + C37EA60D1BC83F2A0091C8F7 /* CPTAxisLabelGroup.m in Sources */, + C37EA60E1BC83F2A0091C8F7 /* CPTFill.m in Sources */, + C37EA60F1BC83F2A0091C8F7 /* CPTMutableNumericData+TypeConversion.m in Sources */, + C37EA6101BC83F2A0091C8F7 /* CPTRangePlot.m in Sources */, + C37EA6111BC83F2A0091C8F7 /* CPTGraph.m in Sources */, + C37EA6121BC83F2A0091C8F7 /* CPTMutablePlotRange.m in Sources */, + C37EA6131BC83F2A0091C8F7 /* _CPTPlainWhiteTheme.m in Sources */, + C37EA6141BC83F2A0091C8F7 /* CPTGridLineGroup.m in Sources */, + C37EA6151BC83F2A0091C8F7 /* CPTNumericDataType.m in Sources */, + C37EA6161BC83F2A0091C8F7 /* CPTPlot.m in Sources */, + C37EA6171BC83F2A0091C8F7 /* CPTPlatformSpecificCategories.m in Sources */, + C37EA6181BC83F2A0091C8F7 /* CPTConstraints.m in Sources */, + C37EA6191BC83F2A0091C8F7 /* CPTTextStyle.m in Sources */, + C37EA61A1BC83F2A0091C8F7 /* CPTFunctionDataSource.m in Sources */, + C37EA61B1BC83F2A0091C8F7 /* NSNumberExtensions.m in Sources */, + C37EA61C1BC83F2A0091C8F7 /* CPTBorderedLayer.m in Sources */, + C37EA61D1BC83F2A0091C8F7 /* CPTLineStyle.m in Sources */, + C37EA61E1BC83F2A0091C8F7 /* _CPTAnimationCGSizePeriod.m in Sources */, + C37EA61F1BC83F2A0091C8F7 /* CPTPieChart.m in Sources */, + C37EA6201BC83F2A0091C8F7 /* CPTColorSpace.m in Sources */, + C37EA6211BC83F2A0091C8F7 /* CPTGradient.m in Sources */, + C37EA6221BC83F2A0091C8F7 /* CPTUtilities.m in Sources */, + C37EA6231BC83F2A0091C8F7 /* _CPTXYTheme.m in Sources */, + C37EA6241BC83F2A0091C8F7 /* CPTXYGraph.m in Sources */, + C37EA6251BC83F2A0091C8F7 /* CPTPlotArea.m in Sources */, + C37EA6261BC83F2A0091C8F7 /* _CPTConstraintsFixed.m in Sources */, + C37EA6271BC83F2A0091C8F7 /* CPTAxis.m in Sources */, + C37EA6281BC83F2A0091C8F7 /* CPTMutableTextStyle.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C37EA6971BC83F2D0091C8F7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C37EA6981BC83F2D0091C8F7 /* CPTMutableNumericDataTests.m in Sources */, + C37EA6991BC83F2D0091C8F7 /* CPTColorSpaceTests.m in Sources */, + C37EA69A1BC83F2D0091C8F7 /* CPTFillTests.m in Sources */, + C37EA69B1BC83F2D0091C8F7 /* CPTUtilitiesTests.m in Sources */, + C37EA69C1BC83F2D0091C8F7 /* CPTGradientTests.m in Sources */, + C37EA69D1BC83F2D0091C8F7 /* CPTDarkGradientThemeTests.m in Sources */, + C37EA69E1BC83F2D0091C8F7 /* CPTAxisLabelTests.m in Sources */, + C37EA69F1BC83F2D0091C8F7 /* CPTThemeTests.m in Sources */, + C37EA6A01BC83F2D0091C8F7 /* CPTColorTests.m in Sources */, + C37EA6A11BC83F2D0091C8F7 /* CPTPlotSpaceTests.m in Sources */, + C37EA6A21BC83F2D0091C8F7 /* CPTImageTests.m in Sources */, + C37EA6A31BC83F2D0091C8F7 /* CPTDataSourceTestCase.m in Sources */, + C37EA6A41BC83F2D0091C8F7 /* CPTNumericDataTests.m in Sources */, + C37EA6A51BC83F2D0091C8F7 /* CPTDerivedXYGraph.m in Sources */, + C37EA6A61BC83F2D0091C8F7 /* CPTXYPlotSpaceTests.m in Sources */, + C37EA6A71BC83F2D0091C8F7 /* CPTTestCase.m in Sources */, + C37EA6A81BC83F2D0091C8F7 /* CPTPlotRangeTests.m in Sources */, + C37EA6A91BC83F2D0091C8F7 /* CPTNumericDataTypeConversionTests.m in Sources */, + C37EA6AA1BC83F2D0091C8F7 /* CPTMutableNumericDataTypeConversionTests.m in Sources */, + C37EA6AB1BC83F2D0091C8F7 /* CPTLineStyleTests.m in Sources */, + C37EA6AC1BC83F2D0091C8F7 /* CPTTextStyleTests.m in Sources */, + C377B3BE1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */, + C37EA6AD1BC83F2D0091C8F7 /* CPTTimeFormatterTests.m in Sources */, + C37EA6AE1BC83F2D0091C8F7 /* CPTLayerTests.m in Sources */, + C37EA6AF1BC83F2D0091C8F7 /* CPTScatterPlotTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C38A09731A46185200D45436 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2350,10 +2924,10 @@ C38A0B061A46261700D45436 /* _CPTDarkGradientTheme.m in Sources */, C38A0B071A46261700D45436 /* _CPTPlainBlackTheme.m in Sources */, C38A09DB1A461C7D00D45436 /* CPTNumericData.m in Sources */, - C38A09D51A461C1E00D45436 /* CorePlotProbes.d in Sources */, C38A0AE71A4625D400D45436 /* CPTXYAxisSet.m in Sources */, C38A0AB21A46241700D45436 /* CPTLimitBand.m in Sources */, C38A0AE11A4625D400D45436 /* CPTGridLines.m in Sources */, + C3BB3C921C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */, C38A0A6D1A4620E200D45436 /* CPTPathExtensions.m in Sources */, C38A0AB91A46250500D45436 /* CPTXYPlotSpace.m in Sources */, C38A09F91A461D0B00D45436 /* CPTPlotRange.m in Sources */, @@ -2449,6 +3023,7 @@ C38A09E61A461CB200D45436 /* CPTMutableNumericDataTypeConversionTests.m in Sources */, C38A0A8B1A46210A00D45436 /* CPTLineStyleTests.m in Sources */, C38A0A501A461F3D00D45436 /* CPTTextStyleTests.m in Sources */, + C377B3BC1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */, C38A0A9B1A46219600D45436 /* CPTTimeFormatterTests.m in Sources */, C38A0A121A461D6A00D45436 /* CPTLayerTests.m in Sources */, C38A0AD81A46257600D45436 /* CPTScatterPlotTests.m in Sources */, @@ -2486,6 +3061,7 @@ C38A0ABA1A46250600D45436 /* CPTPlotSpace.m in Sources */, C38A0A281A461E9B00D45436 /* _CPTAnimationCGRectPeriod.m in Sources */, C38A0AEC1A4625D500D45436 /* CPTAxisLabel.m in Sources */, + C3BB3C931C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */, C38A0A991A46219200D45436 /* CPTCalendarFormatter.m in Sources */, C38A0A3A1A461ED700D45436 /* CPTLayerAnnotation.m in Sources */, C38A0B231A46264500D45436 /* CPTPlatformSpecificDefines.m in Sources */, @@ -2514,7 +3090,6 @@ C38A09FD1A461D1400D45436 /* CPTMutablePlotRange.m in Sources */, C38A09F71A461D0100D45436 /* CPTUtilities.m in Sources */, C38A0A721A4620E200D45436 /* CPTGradient.m in Sources */, - C38A09D61A461C2B00D45436 /* CorePlotProbes.d in Sources */, C38A0A9A1A46219200D45436 /* CPTTimeFormatter.m in Sources */, C38A0A161A461E5800D45436 /* CPTAnimation.m in Sources */, C38A0AAC1A46240A00D45436 /* CPTXYGraph.m in Sources */, @@ -2581,6 +3156,7 @@ C38A09E51A461CAE00D45436 /* CPTMutableNumericDataTests.m in Sources */, C38A0B161A46262000D45436 /* CPTDarkGradientThemeTests.m in Sources */, C38A0A131A461D6B00D45436 /* CPTLayerTests.m in Sources */, + C377B3BD1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */, C38A0A9C1A46219700D45436 /* CPTTimeFormatterTests.m in Sources */, C38A0A511A461F3D00D45436 /* CPTTextStyleTests.m in Sources */, C38A0A8C1A46210A00D45436 /* CPTColorTests.m in Sources */, @@ -2605,17 +3181,94 @@ target = C38A09B91A4619A900D45436 /* CorePlot-CocoaTouch */; targetProxy = C38A09C61A4619A900D45436 /* PBXContainerItemProxy */; }; + C3B4D4961BC997F600450C37 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C37EA5C91BC83F2A0091C8F7 /* CorePlot tvOS */; + targetProxy = C3B4D4951BC997F600450C37 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 089C1666FE841158C02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 089C1667FE841158C02AAC07 /* English */, + C3564CBD22A2D0E1000A54C9 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; + C3490DF220E028CF0089F309 /* CorePlot-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DF120E028CF0089F309 /* Base */, + ); + name = "CorePlot-Info.plist"; + path = Info; + sourceTree = ""; + }; + C3490DF420E028D30089F309 /* CorePlot-CocoaTouch-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DF320E028D30089F309 /* Base */, + ); + name = "CorePlot-CocoaTouch-Info.plist"; + path = Info/Base.lproj; + sourceTree = ""; + }; + C3490DF620E028D80089F309 /* CorePlot-iOS-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DF520E028D80089F309 /* Base */, + ); + name = "CorePlot-iOS-Info.plist"; + path = Info/Base.lproj; + sourceTree = ""; + }; + C3490DF820E028DC0089F309 /* CorePlot-tvOS-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DF720E028DC0089F309 /* Base */, + ); + name = "CorePlot-tvOS-Info.plist"; + path = "/Users/eskroch/Projects/Core Plot/framework/Info/Base.lproj"; + sourceTree = ""; + }; + C37A406420E02B9D00C4FF48 /* CorePlot-tvOSTests-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A406320E02B9D00C4FF48 /* Base */, + ); + name = "CorePlot-tvOSTests-Info.plist"; + path = "/Users/eskroch/Projects/Core Plot/framework/Info"; + sourceTree = ""; + }; + C37A406620E02BA100C4FF48 /* CorePlot-CocoaTouchTests-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A406520E02BA100C4FF48 /* Base */, + ); + name = "CorePlot-CocoaTouchTests-Info.plist"; + path = Info; + sourceTree = SOURCE_ROOT; + }; + C37A406820E02BA500C4FF48 /* CorePlot-iOSTests-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A406720E02BA500C4FF48 /* Base */, + ); + name = "CorePlot-iOSTests-Info.plist"; + path = Info; + sourceTree = SOURCE_ROOT; + }; + C37A406A20E02BE900C4FF48 /* CorePlotTests-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A406920E02BE900C4FF48 /* Base */, + ); + name = "CorePlotTests-Info.plist"; + path = Info; + sourceTree = SOURCE_ROOT; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -2623,13 +3276,11 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - INFOPLIST_FILE = "CorePlotTests-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlotTests-Info.plist"; INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - MACOSX_DEPLOYMENT_TARGET = 10.7; PRODUCT_NAME = UnitTests; SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/MacOnly"; }; name = Debug; }; @@ -2637,14 +3288,11 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; buildSettings = { - COPY_PHASE_STRIP = YES; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - INFOPLIST_FILE = "CorePlotTests-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlotTests-Info.plist"; INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - MACOSX_DEPLOYMENT_TARGET = 10.7; PRODUCT_NAME = UnitTests; SDKROOT = macosx; - ZERO_LINK = NO; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/MacOnly"; }; name = Release; }; @@ -2656,9 +3304,8 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/CorePlot-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-Info.plist"; INSTALL_PATH = "@rpath"; - MACOSX_DEPLOYMENT_TARGET = 10.7; PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = CorePlot; SDKROOT = macosx; @@ -2675,9 +3322,8 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/CorePlot-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-Info.plist"; INSTALL_PATH = "@rpath"; - MACOSX_DEPLOYMENT_TARGET = 10.7; PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = CorePlot; SDKROOT = macosx; @@ -2688,19 +3334,23 @@ }; 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; buildSettings = { - CURRENT_PROJECT_VERSION = 2.0; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CURRENT_PROJECT_VERSION = 2.3; ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; ONLY_ACTIVE_ARCH = YES; - SYMROOT = "$(PROJECT_DIR)/../build"; }; name = Debug; }; 1DEB91B308733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; buildSettings = { - CURRENT_PROJECT_VERSION = 2.0; - SYMROOT = "$(PROJECT_DIR)/../build"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CURRENT_PROJECT_VERSION = 2.3; + GCC_NO_COMMON_BLOCKS = YES; }; name = Release; }; @@ -2729,27 +3379,119 @@ }; name = Release; }; - C38A098B1A46185300D45436 /* Debug */ = { + C37EA5C71BC83E900091C8F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SUPPORTED_PLATFORMS = "appletvsimulator appletvos"; + }; + name = Debug; + }; + C37EA5C81BC83E900091C8F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SUPPORTED_PLATFORMS = "appletvsimulator appletvos"; + ZERO_LINK = NO; + }; + name = Release; + }; + C37EA6901BC83F2A0091C8F7 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-tvOS-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CorePlot; + SDKROOT = appletvos; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Debug; + }; + C37EA6911BC83F2A0091C8F7 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-tvOS-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CorePlot; + SDKROOT = appletvos; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Release; + }; + C37EA6B51BC83F2D0091C8F7 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-tvOSTests-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Debug; + }; + C37EA6B61BC83F2D0091C8F7 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-tvOSTests-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Release; + }; + C38A098B1A46185300D45436 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - INFOPLIST_FILE = "$(SRCROOT)/CorePlot_iOS-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-iOS-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; @@ -2764,19 +3506,14 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = YES; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - INFOPLIST_FILE = "$(SRCROOT)/CorePlot_iOS-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-iOS-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; @@ -2791,31 +3528,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - 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_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 = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - 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_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "CorePlot-iOSTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-iOSTests-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; @@ -2830,27 +3544,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - 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_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 = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "CorePlot-iOSTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-iOSTests-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; @@ -2894,7 +3589,6 @@ DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; GCC_OPTIMIZATION_LEVEL = 0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = "Documentation-iOS copy"; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; @@ -2909,7 +3603,6 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = "Documentation-iOS copy"; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; @@ -2921,19 +3614,9 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - INFOPLIST_FILE = "CorePlot-CocoaTouch-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-CocoaTouch-Info.plist"; INSTALL_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - MACOSX_DEPLOYMENT_TARGET = ""; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -2946,15 +3629,9 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - INFOPLIST_FILE = "CorePlot-CocoaTouch-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-CocoaTouch-Info.plist"; INSTALL_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - MACOSX_DEPLOYMENT_TARGET = ""; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -2967,31 +3644,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - 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_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 = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - 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_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "CorePlot-CocoaTouchTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-CocoaTouchTests-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; @@ -3006,27 +3660,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - 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_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 = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "CorePlot-CocoaTouchTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-CocoaTouchTests-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; @@ -3045,7 +3680,6 @@ DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; GCC_OPTIMIZATION_LEVEL = 0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; @@ -3060,7 +3694,6 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; @@ -3107,6 +3740,33 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + C37EA5C61BC83E900091C8F7 /* Build configuration list for PBXAggregateTarget "Universal tvOS Framework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C37EA5C71BC83E900091C8F7 /* Debug */, + C37EA5C81BC83E900091C8F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C37EA68F1BC83F2A0091C8F7 /* Build configuration list for PBXNativeTarget "CorePlot tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C37EA6901BC83F2A0091C8F7 /* Debug */, + C37EA6911BC83F2A0091C8F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C37EA6B41BC83F2D0091C8F7 /* Build configuration list for PBXNativeTarget "UnitTests tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C37EA6B51BC83F2D0091C8F7 /* Debug */, + C37EA6B61BC83F2D0091C8F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; C38A098F1A46185300D45436 /* Build configuration list for PBXNativeTarget "CorePlot iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..0c67376eb --- /dev/null +++ b/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,5 @@ + + + + + diff --git a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot Mac.xcscheme b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot Mac.xcscheme index 8b30a1edf..6567660c2 100644 --- a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot Mac.xcscheme +++ b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot Mac.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -41,8 +39,6 @@ - - - - + buildForAnalyzing = "YES"> + buildForAnalyzing = "NO"> + shouldUseLaunchSchemeArgsEnv = "YES"> + + + + @@ -56,17 +62,6 @@ - - - - - - - - + buildForAnalyzing = "YES"> + BlueprintIdentifier = "C37EA5C91BC83F2A0091C8F7" + BuildableName = "CorePlot.framework" + BlueprintName = "CorePlot tvOS" + ReferencedContainer = "container:CorePlot.xcodeproj"> + + + + @@ -28,19 +41,27 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - + BlueprintIdentifier = "C37EA5C91BC83F2A0091C8F7" + BuildableName = "CorePlot.framework" + BlueprintName = "CorePlot tvOS" + ReferencedContainer = "container:CorePlot.xcodeproj"> - - + + + + + + - + + BlueprintIdentifier = "C37EA5C91BC83F2A0091C8F7" + BuildableName = "CorePlot.framework" + BlueprintName = "CorePlot tvOS" + ReferencedContainer = "container:CorePlot.xcodeproj"> - - - + - + + BlueprintIdentifier = "C37EA5C91BC83F2A0091C8F7" + BuildableName = "CorePlot.framework" + BlueprintName = "CorePlot tvOS" + ReferencedContainer = "container:CorePlot.xcodeproj"> - + diff --git a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot-CocoaTouch.xcscheme b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot-CocoaTouch.xcscheme index 935a982bb..fe0aaaaef 100644 --- a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot-CocoaTouch.xcscheme +++ b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot-CocoaTouch.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "YES"> + buildForAnalyzing = "NO"> + shouldUseLaunchSchemeArgsEnv = "YES"> + + + + @@ -56,17 +62,6 @@ - - - - - - - - + buildForAnalyzing = "YES"> - - - - + buildForAnalyzing = "YES"> - - - - + buildForAnalyzing = "YES"> - - - - + buildForAnalyzing = "YES"> - - - - + BlueprintIdentifier = "C37EA5C41BC83E900091C8F7" + BuildableName = "Universal tvOS Framework" + BlueprintName = "Universal tvOS Framework" + ReferencedContainer = "container:CorePlot.xcodeproj"> @@ -29,8 +29,6 @@ shouldUseLaunchSchemeArgsEnv = "YES"> - - - - - - - - - - - - diff --git a/framework/CorePlot_Prefix.pch b/framework/CorePlot_Prefix.pch index 7f17851fe..650702d34 100644 --- a/framework/CorePlot_Prefix.pch +++ b/framework/CorePlot_Prefix.pch @@ -7,7 +7,7 @@ #import - #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE + #if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV #import #import #else diff --git a/framework/CorePlot-CocoaTouch-Info.plist b/framework/Info/Base.lproj/CorePlot-CocoaTouch-Info.plist similarity index 100% rename from framework/CorePlot-CocoaTouch-Info.plist rename to framework/Info/Base.lproj/CorePlot-CocoaTouch-Info.plist diff --git a/framework/CorePlot-CocoaTouchTests-Info.plist b/framework/Info/Base.lproj/CorePlot-CocoaTouchTests-Info.plist similarity index 100% rename from framework/CorePlot-CocoaTouchTests-Info.plist rename to framework/Info/Base.lproj/CorePlot-CocoaTouchTests-Info.plist diff --git a/framework/CorePlot-Info.plist b/framework/Info/Base.lproj/CorePlot-Info.plist similarity index 100% rename from framework/CorePlot-Info.plist rename to framework/Info/Base.lproj/CorePlot-Info.plist diff --git a/framework/CorePlot_iOS-Info.plist b/framework/Info/Base.lproj/CorePlot-iOS-Info.plist similarity index 100% rename from framework/CorePlot_iOS-Info.plist rename to framework/Info/Base.lproj/CorePlot-iOS-Info.plist diff --git a/framework/CorePlot-iOSTests-Info.plist b/framework/Info/Base.lproj/CorePlot-iOSTests-Info.plist similarity index 100% rename from framework/CorePlot-iOSTests-Info.plist rename to framework/Info/Base.lproj/CorePlot-iOSTests-Info.plist diff --git a/framework/Info/Base.lproj/CorePlot-tvOS-Info.plist b/framework/Info/Base.lproj/CorePlot-tvOS-Info.plist new file mode 100644 index 000000000..d3de8eefb --- /dev/null +++ b/framework/Info/Base.lproj/CorePlot-tvOS-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/framework/Info/Base.lproj/CorePlot-tvOSTests-Info.plist b/framework/Info/Base.lproj/CorePlot-tvOSTests-Info.plist new file mode 100644 index 000000000..ba72822e8 --- /dev/null +++ b/framework/Info/Base.lproj/CorePlot-tvOSTests-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/framework/CorePlotTests-Info.plist b/framework/Info/Base.lproj/CorePlotTests-Info.plist similarity index 100% rename from framework/CorePlotTests-Info.plist rename to framework/Info/Base.lproj/CorePlotTests-Info.plist diff --git a/framework/MacOnly/CPTGraphHostingView.h b/framework/MacOnly/CPTGraphHostingView.h index 429fdea08..bf185e21a 100644 --- a/framework/MacOnly/CPTGraphHostingView.h +++ b/framework/MacOnly/CPTGraphHostingView.h @@ -2,7 +2,7 @@ @class CPTGraph; -@interface CPTGraphHostingView : NSView +@interface CPTGraphHostingView : NSView /// @name Hosted graph /// @{ diff --git a/framework/MacOnly/CPTGraphHostingView.m b/framework/MacOnly/CPTGraphHostingView.m index 9fc0588ed..531d6b06b 100644 --- a/framework/MacOnly/CPTGraphHostingView.m +++ b/framework/MacOnly/CPTGraphHostingView.m @@ -61,22 +61,32 @@ @implementation CPTGraphHostingView /// @cond --(nonnull instancetype)initWithFrame:(NSRect)frame +-(void)commonInit { - if ( (self = [super initWithFrame:frame]) ) { - hostedGraph = nil; - printRect = NSZeroRect; + self.hostedGraph = nil; + self.printRect = NSZeroRect; - closedHandCursor = [NSCursor closedHandCursor]; - openHandCursor = [NSCursor openHandCursor]; - allowPinchScaling = YES; + self.closedHandCursor = [NSCursor closedHandCursor]; + self.openHandCursor = [NSCursor openHandCursor]; + self.allowPinchScaling = YES; - locationInWindow = NSZeroPoint; - scrollOffset = CGPointZero; + self.locationInWindow = NSZeroPoint; + self.scrollOffset = CGPointZero; - if ( !self.superview.wantsLayer ) { - self.layer = [self makeBackingLayer]; - } + [self addObserver:self + forKeyPath:@"effectiveAppearance" + options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld | NSKeyValueObservingOptionInitial + context:CPTGraphHostingViewKVOContext]; + + if ( !self.superview.wantsLayer ) { + self.layer = [self makeBackingLayer]; + } +} + +-(nonnull instancetype)initWithFrame:(NSRect)frame +{ + if ((self = [super initWithFrame:frame])) { + [self commonInit]; } return self; } @@ -97,6 +107,8 @@ -(void)dealloc [space removeObserver:self forKeyPath:@"isDragging" context:CPTGraphHostingViewKVOContext]; } + [self removeObserver:self forKeyPath:@"effectiveAppearance" context:CPTGraphHostingViewKVOContext]; + [hostedGraph removeFromSuperlayer]; } @@ -124,37 +136,44 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - CPTLayer *mainLayer = [[CPTLayer alloc] initWithFrame:NSRectToCGRect(self.frame)]; - self.layer = mainLayer; + if ((self = [super initWithCoder:coder])) { + [self commonInit]; - hostedGraph = nil; - self.hostedGraph = [coder decodeObjectForKey:@"CPTLayerHostingView.hostedGraph"]; // setup layers + self.hostedGraph = [coder decodeObjectOfClass:[CPTGraph class] + forKey:@"CPTLayerHostingView.hostedGraph"]; // setup layers self.printRect = [coder decodeRectForKey:@"CPTLayerHostingView.printRect"]; - self.closedHandCursor = [coder decodeObjectForKey:@"CPTLayerHostingView.closedHandCursor"]; - self.openHandCursor = [coder decodeObjectForKey:@"CPTLayerHostingView.openHandCursor"]; + self.closedHandCursor = [coder decodeObjectOfClass:[NSCursor class] + forKey:@"CPTLayerHostingView.closedHandCursor"]; + self.openHandCursor = [coder decodeObjectOfClass:[NSCursor class] + forKey:@"CPTLayerHostingView.openHandCursor"]; if ( [coder containsValueForKey:@"CPTLayerHostingView.allowPinchScaling"] ) { self.allowPinchScaling = [coder decodeBoolForKey:@"CPTLayerHostingView.allowPinchScaling"]; } - else { - self.allowPinchScaling = YES; - } - - self.locationInWindow = NSZeroPoint; - self.scrollOffset = CGPointZero; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing /// @cond --(void)drawRect:(NSRect)dirtyRect +-(void)drawRect:(NSRect __unused)dirtyRect { if ( self.hostedGraph ) { if ( ![NSGraphicsContext currentContextDrawingToScreen] ) { @@ -166,19 +185,19 @@ -(void)drawRect:(NSRect)dirtyRect CGRect sourceRect = NSRectToCGRect(self.frame); CGRect destinationRect = NSRectToCGRect(self.printRect); - if ( CGRectEqualToRect(destinationRect, CGRectZero) ) { + if ( CGRectEqualToRect(destinationRect, CGRectZero)) { destinationRect = sourceRect; } // scale the view isotropically so that it fits on the printed page - CGFloat widthScale = ( sourceRect.size.width != CPTFloat(0.0) ) ? destinationRect.size.width / sourceRect.size.width : CPTFloat(1.0); - CGFloat heightScale = ( sourceRect.size.height != CPTFloat(0.0) ) ? destinationRect.size.height / sourceRect.size.height : CPTFloat(1.0); + CGFloat widthScale = (sourceRect.size.width != CPTFloat(0.0)) ? destinationRect.size.width / sourceRect.size.width : CPTFloat(1.0); + CGFloat heightScale = (sourceRect.size.height != CPTFloat(0.0)) ? destinationRect.size.height / sourceRect.size.height : CPTFloat(1.0); CGFloat scale = MIN(widthScale, heightScale); // position the view so that its centered on the printed page CGPoint offset = destinationRect.origin; - offset.x += ( ( destinationRect.size.width - (sourceRect.size.width * scale) ) / CPTFloat(2.0) ); - offset.y += ( ( destinationRect.size.height - (sourceRect.size.height * scale) ) / CPTFloat(2.0) ); + offset.x += ((destinationRect.size.width - (sourceRect.size.width * scale)) / CPTFloat(2.0)); + offset.y += ((destinationRect.size.height - (sourceRect.size.height * scale)) / CPTFloat(2.0)); NSAffineTransform *transform = [NSAffineTransform transform]; [transform translateXBy:offset.x yBy:offset.y]; @@ -210,7 +229,7 @@ -(BOOL)knowsPageRange:(nonnull NSRangePointer)rangePointer return YES; } --(NSRect)rectForPage:(NSInteger)pageNumber +-(NSRect)rectForPage:(NSInteger __unused)pageNumber { return self.printRect; } @@ -222,7 +241,7 @@ -(NSRect)rectForPage:(NSInteger)pageNumber /// @cond --(BOOL)acceptsFirstMouse:(nullable NSEvent *)theEvent +-(BOOL)acceptsFirstMouse:(nullable NSEvent *__unused)theEvent { return YES; } @@ -400,6 +419,8 @@ -(void)scrollWheel:(nonnull NSEvent *)theEvent -(void)viewDidChangeBackingProperties { + [super viewDidChangeBackingProperties]; + NSWindow *myWindow = self.window; if ( myWindow ) { @@ -427,7 +448,7 @@ -(void)resetCursorRects NSCursor *closedCursor = self.closedHandCursor; NSCursor *openCursor = self.openHandCursor; - if ( plotArea && (closedCursor || openCursor) ) { + if ( plotArea && (closedCursor || openCursor)) { BOOL allowsInteraction = NO; BOOL isDragging = NO; @@ -461,8 +482,8 @@ -(void)resetCursorRects **/ -(void)plotSpaceAdded:(nonnull NSNotification *)notification { - CPTDictionary userInfo = notification.userInfo; - CPTPlotSpace *space = userInfo[CPTGraphPlotSpaceNotificationKey]; + CPTDictionary *userInfo = notification.userInfo; + CPTPlotSpace *space = userInfo[CPTGraphPlotSpaceNotificationKey]; [space addObserver:self forKeyPath:@"isDragging" @@ -475,8 +496,8 @@ -(void)plotSpaceAdded:(nonnull NSNotification *)notification **/ -(void)plotSpaceRemoved:(nonnull NSNotification *)notification { - CPTDictionary userInfo = notification.userInfo; - CPTPlotSpace *space = userInfo[CPTGraphPlotSpaceNotificationKey]; + CPTDictionary *userInfo = notification.userInfo; + CPTPlotSpace *space = userInfo[CPTGraphPlotSpaceNotificationKey]; [space removeObserver:self forKeyPath:@"isDragging" context:CPTGraphHostingViewKVOContext]; [self.window invalidateCursorRectsForView:self]; @@ -503,6 +524,11 @@ -(void)viewWillMoveToSuperview:(nullable NSView *)newSuperview self.layer = [self makeBackingLayer]; self.wantsLayer = YES; } + + CPTGraph *theGraph = self.hostedGraph; + if ( theGraph ) { + [self.layer addSublayer:theGraph]; + } } } @@ -513,7 +539,7 @@ -(void)viewWillMoveToSuperview:(nullable NSView *)newSuperview /// @cond --(void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id)object change:(nullable CPTDictionary)change context:(nullable void *)context +-(void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id)object change:(nullable CPTDictionary *)change context:(nullable void *)context { if ( context == CPTGraphHostingViewKVOContext ) { CPTGraph *theGraph = self.hostedGraph; @@ -521,7 +547,7 @@ -(void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id if ( [keyPath isEqualToString:@"isDragging"] && [object isKindOfClass:[CPTPlotSpace class]] ) { [self.window invalidateCursorRectsForView:self]; } - else if ( [keyPath isEqualToString:@"plotAreaFrame"] && (object == theGraph) ) { + else if ( [keyPath isEqualToString:@"plotAreaFrame"] && (object == theGraph)) { CPTPlotAreaFrame *oldPlotAreaFrame = change[NSKeyValueChangeOldKey]; CPTPlotAreaFrame *newPlotAreaFrame = change[NSKeyValueChangeNewKey]; @@ -536,7 +562,7 @@ -(void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id context:CPTGraphHostingViewKVOContext]; } } - else if ( [keyPath isEqualToString:@"plotArea"] && (object == theGraph.plotAreaFrame) ) { + else if ( [keyPath isEqualToString:@"plotArea"] && (object == theGraph.plotAreaFrame)) { CPTPlotArea *oldPlotArea = change[NSKeyValueChangeOldKey]; CPTPlotArea *newPlotArea = change[NSKeyValueChangeNewKey]; @@ -553,6 +579,9 @@ -(void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id object:newPlotArea]; } } + else if ( [keyPath isEqualToString:@"effectiveAppearance"] && (object == self)) { + [self.hostedGraph setNeedsDisplayAllLayers]; + } } else { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; @@ -568,7 +597,7 @@ -(void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id -(void)setHostedGraph:(nullable CPTGraph *)newGraph { - NSParameterAssert( (newGraph == nil) || [newGraph isKindOfClass:[CPTGraph class]] ); + NSParameterAssert((newGraph == nil) || [newGraph isKindOfClass:[CPTGraph class]]); if ( newGraph != hostedGraph ) { self.wantsLayer = YES; diff --git a/framework/MacOnly/CPTImagePlatformSpecific.m b/framework/MacOnly/CPTImagePlatformSpecific.m index 21b1a9ba8..4b845f2ba 100644 --- a/framework/MacOnly/CPTImagePlatformSpecific.m +++ b/framework/MacOnly/CPTImagePlatformSpecific.m @@ -12,7 +12,7 @@ @implementation CPTImage(CPTPlatformSpecificImageExtensions) **/ -(nonnull instancetype)initWithNativeImage:(nullable CPTNativeImage *)anImage { - if ( (self = [self init]) ) { + if ((self = [self init])) { self.nativeImage = anImage; } @@ -40,7 +40,7 @@ -(nonnull instancetype)initForPNGFile:(nonnull NSString *)path imageScale = MAX(imageScale, screen.backingScaleFactor); } - while ( imageScale > CPTFloat(1.0) ) { + while ( imageScale > CPTFloat(1.0)) { NSMutableString *hiDpiPath = [path mutableCopy]; NSUInteger replaceCount = [hiDpiPath replaceOccurrencesOfString:@".png" withString:[NSString stringWithFormat:@"@%dx.png", (int)imageScale] diff --git a/framework/MacOnly/CPTPlatformSpecificCategories.h b/framework/MacOnly/CPTPlatformSpecificCategories.h index 96732d478..2102bc1bf 100644 --- a/framework/MacOnly/CPTPlatformSpecificCategories.h +++ b/framework/MacOnly/CPTPlatformSpecificCategories.h @@ -16,17 +16,6 @@ @end -#pragma mark - CPTColor - -/** @category CPTColor(CPTPlatformSpecificColorExtensions) - * @brief Platform-specific extensions to CPTColor. - **/ -@interface CPTColor(CPTPlatformSpecificColorExtensions) - -@property (nonatomic, readonly, nonnull) NSColor *nsColor; - -@end - #pragma mark - NSAttributedString /** @category NSAttributedString(CPTPlatformSpecificAttributedStringExtensions) @@ -39,4 +28,9 @@ -(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context; /// @} +/// @name Measurement +/// @{ +-(CGSize)sizeAsDrawn; +/// @} + @end diff --git a/framework/MacOnly/CPTPlatformSpecificCategories.m b/framework/MacOnly/CPTPlatformSpecificCategories.m index 1030e5798..8b6229cc5 100644 --- a/framework/MacOnly/CPTPlatformSpecificCategories.m +++ b/framework/MacOnly/CPTPlatformSpecificCategories.m @@ -1,5 +1,7 @@ #import "CPTPlatformSpecificCategories.h" +#import "CPTGraph.h" +#import "CPTGraphHostingView.h" #import "CPTPlatformSpecificFunctions.h" #pragma mark CPTLayer @@ -13,21 +15,48 @@ -(nonnull CPTNativeImage *)imageOfLayer { CGSize boundsSize = self.bounds.size; - NSBitmapImageRep *layerImage = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL - pixelsWide:(NSInteger)boundsSize.width - pixelsHigh:(NSInteger)boundsSize.height - bitsPerSample:8 - samplesPerPixel:4 - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSCalibratedRGBColorSpace - bytesPerRow:(NSInteger)boundsSize.width * 4 - bitsPerPixel:32]; + // Figure out the scale of pixels to points + CGFloat scale = 0.0; + + if ( [self respondsToSelector:@selector(hostingView)] ) { + scale = ((CPTGraph *)self).hostingView.window.backingScaleFactor; + } + if ((scale == 0.0) && [CALayer instancesRespondToSelector:@selector(contentsScale)] ) { + scale = self.contentsScale; + } + if ( scale == 0.0 ) { + NSWindow *myWindow = self.graph.hostingView.window; + + if ( myWindow ) { + scale = myWindow.backingScaleFactor; + } + else { + scale = [NSScreen mainScreen].backingScaleFactor; + } + } + scale = MAX(scale, CPTFloat(1.0)); + + NSBitmapImageRep *layerImage = [[NSBitmapImageRep alloc] + initWithBitmapDataPlanes:NULL + pixelsWide:(NSInteger)(boundsSize.width * scale) + pixelsHigh:(NSInteger)(boundsSize.height * scale) + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpaceName:NSCalibratedRGBColorSpace + bitmapFormat:NSAlphaFirstBitmapFormat + bytesPerRow:0 + bitsPerPixel:0 + ]; + + // Setting the size communicates the dpi; enables proper scaling for Retina screens + layerImage.size = NSSizeFromCGSize(boundsSize); NSGraphicsContext *bitmapContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:layerImage]; CGContextRef context = (CGContextRef)bitmapContext.graphicsPort; - CGContextClearRect( context, CPTRectMake(0.0, 0.0, boundsSize.width, boundsSize.height) ); + CGContextClearRect(context, CPTRectMake(0.0, 0.0, boundsSize.width, boundsSize.height)); CGContextSetAllowsAntialiasing(context, true); CGContextSetShouldSmoothFonts(context, false); [self layoutAndRenderInContext:context]; @@ -41,22 +70,6 @@ -(nonnull CPTNativeImage *)imageOfLayer @end -#pragma mark - CPTColor - -@implementation CPTColor(CPTPlatformSpecificColorExtensions) - -/** @property nsColor - * @brief Gets the color value as an NSColor. - **/ -@dynamic nsColor; - --(nonnull NSColor *)nsColor -{ - return [NSColor colorWithCIColor:[CIColor colorWithCGColor:self.cgColor]]; -} - -@end - #pragma mark - NSAttributedString @implementation NSAttributedString(CPTPlatformSpecificAttributedStringExtensions) @@ -70,9 +83,34 @@ -(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context CPTPushCGContext(context); [self drawWithRect:NSRectFromCGRect(rect) - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine]; + options:CPTStringDrawingOptions]; CPTPopCGContext(); } +/** + * @brief Computes the size of the styled text when drawn rounded up to the nearest whole number in each dimension. + **/ +-(CGSize)sizeAsDrawn +{ + CGRect rect = CGRectZero; + + if ( [self respondsToSelector:@selector(boundingRectWithSize:options:context:)] ) { + rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions + context:nil]; + } + else { + rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions]; + } + + CGSize textSize = rect.size; + + textSize.width = ceil(textSize.width); + textSize.height = ceil(textSize.height); + + return textSize; +} + @end diff --git a/framework/MacOnly/CPTPlatformSpecificDefines.h b/framework/MacOnly/CPTPlatformSpecificDefines.h index 354989f9f..24d77c3c6 100644 --- a/framework/MacOnly/CPTPlatformSpecificDefines.h +++ b/framework/MacOnly/CPTPlatformSpecificDefines.h @@ -1,4 +1,6 @@ /// @file +typedef NSColor CPTNativeColor; ///< Platform-native color. typedef NSImage CPTNativeImage; ///< Platform-native image format. typedef NSEvent CPTNativeEvent; ///< Platform-native OS event. +typedef NSFont CPTNativeFont; ///< Platform-native font. diff --git a/framework/MacOnly/CPTPlatformSpecificFunctions.m b/framework/MacOnly/CPTPlatformSpecificFunctions.m index e32552b18..4e5668a58 100644 --- a/framework/MacOnly/CPTPlatformSpecificFunctions.m +++ b/framework/MacOnly/CPTPlatformSpecificFunctions.m @@ -109,7 +109,7 @@ CPTRGBAColor CPTRGBAColorFromNSColor(NSColor *__nonnull nsColor) #pragma mark - #pragma mark Debugging -CPTNativeImage * __nonnull CPTQuickLookImage(CGRect rect, __nonnull CPTQuickLookImageBlock renderBlock) +CPTNativeImage *__nonnull CPTQuickLookImage(CGRect rect, __nonnull CPTQuickLookImageBlock renderBlock) { NSBitmapImageRep *layerImage = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL diff --git a/framework/MacOnly/CPTTextStylePlatformSpecific.h b/framework/MacOnly/CPTTextStylePlatformSpecific.h index dcb6919af..3dbcb7fc9 100644 --- a/framework/MacOnly/CPTTextStylePlatformSpecific.h +++ b/framework/MacOnly/CPTTextStylePlatformSpecific.h @@ -3,6 +3,15 @@ /** * @brief Enumeration of paragraph alignments. **/ +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 101200) +typedef NS_ENUM (NSInteger, CPTTextAlignment) { + CPTTextAlignmentLeft = NSTextAlignmentLeft, ///< Left alignment. + CPTTextAlignmentCenter = NSTextAlignmentCenter, ///< Center alignment. + CPTTextAlignmentRight = NSTextAlignmentRight, ///< Right alignment. + CPTTextAlignmentJustified = NSTextAlignmentJustified, ///< Justified alignment. + CPTTextAlignmentNatural = NSTextAlignmentNatural ///< Natural alignment of the text's script. +}; +#else typedef NS_ENUM (NSInteger, CPTTextAlignment) { CPTTextAlignmentLeft = NSLeftTextAlignment, ///< Left alignment. CPTTextAlignmentCenter = NSCenterTextAlignment, ///< Center alignment. @@ -10,3 +19,4 @@ typedef NS_ENUM (NSInteger, CPTTextAlignment) { CPTTextAlignmentJustified = NSJustifiedTextAlignment, ///< Justified alignment. CPTTextAlignmentNatural = NSNaturalTextAlignment ///< Natural alignment of the text's script. }; +#endif diff --git a/framework/MacOnly/CPTTextStylePlatformSpecific.m b/framework/MacOnly/CPTTextStylePlatformSpecific.m index 5bc190ba9..21af2ac93 100644 --- a/framework/MacOnly/CPTTextStylePlatformSpecific.m +++ b/framework/MacOnly/CPTTextStylePlatformSpecific.m @@ -6,7 +6,7 @@ @implementation CPTTextStyle(CPTPlatformSpecificTextStyleExtensions) -/** @property nonnull CPTDictionary attributes +/** @property nonnull CPTDictionary *attributes * @brief A dictionary of standard text attributes suitable for formatting an NSAttributedString. * * The dictionary will contain values for the following keys that represent the receiver's text style: @@ -32,7 +32,7 @@ @implementation CPTTextStyle(CPTPlatformSpecificTextStyleExtensions) * @param attributes A dictionary of standard text attributes. * @return A new CPTTextStyle instance. **/ -+(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attributes ++(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary *)attributes { CPTMutableTextStyle *newStyle = [CPTMutableTextStyle textStyle]; @@ -40,6 +40,7 @@ +(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attribute NSFont *styleFont = attributes[NSFontAttributeName]; if ( styleFont ) { + newStyle.font = styleFont; newStyle.fontName = styleFont.fontName; newStyle.fontSize = styleFont.pointSize; } @@ -47,14 +48,14 @@ +(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attribute // Color NSColor *styleColor = attributes[NSForegroundColorAttributeName]; if ( styleColor ) { - // CGColor property is available in Mac OS 10.8 and later + // CGColor property is available in macOS 10.8 and later if ( [styleColor respondsToSelector:@selector(CGColor)] ) { newStyle.color = [CPTColor colorWithCGColor:styleColor.CGColor]; } else { const NSInteger numberOfComponents = styleColor.numberOfComponents; - CGFloat *components = calloc( (size_t)numberOfComponents, sizeof(CGFloat) ); + CGFloat *components = calloc((size_t)numberOfComponents, sizeof(CGFloat)); [styleColor getComponents:components]; CGColorSpaceRef colorSpace = styleColor.colorSpace.CGColorSpace; @@ -82,15 +83,15 @@ +(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attribute /// @cond --(nonnull CPTDictionary)attributes +-(nonnull CPTDictionary *)attributes { - CPTMutableDictionary myAttributes = [NSMutableDictionary dictionary]; + CPTMutableDictionary *myAttributes = [NSMutableDictionary dictionary]; // Font - NSFont *styleFont = nil; + NSFont *styleFont = self.font; NSString *fontName = self.fontName; - if ( fontName ) { + if ((styleFont == nil) && fontName ) { styleFont = [NSFont fontWithName:fontName size:self.fontSize]; } @@ -138,7 +139,7 @@ @implementation CPTMutableTextStyle(CPTPlatformSpecificMutableTextStyleExtension * @param attributes A dictionary of standard text attributes. * @return A new CPTMutableTextStyle instance. **/ -+(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attributes ++(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary *)attributes { CPTMutableTextStyle *newStyle = [CPTMutableTextStyle textStyle]; @@ -146,6 +147,7 @@ +(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attribute NSFont *styleFont = attributes[NSFontAttributeName]; if ( styleFont ) { + newStyle.font = styleFont; newStyle.fontName = styleFont.fontName; newStyle.fontSize = styleFont.pointSize; } @@ -153,14 +155,14 @@ +(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attribute // Color NSColor *styleColor = attributes[NSForegroundColorAttributeName]; if ( styleColor ) { - // CGColor property is available in Mac OS 10.8 and later + // CGColor property is available in macOS 10.8 and later if ( [styleColor respondsToSelector:@selector(CGColor)] ) { newStyle.color = [CPTColor colorWithCGColor:styleColor.CGColor]; } else { const NSInteger numberOfComponents = styleColor.numberOfComponents; - CGFloat *components = calloc( (size_t)numberOfComponents, sizeof(CGFloat) ); + CGFloat *components = calloc((size_t)numberOfComponents, sizeof(CGFloat)); [styleColor getComponents:components]; CGColorSpaceRef colorSpace = styleColor.colorSpace.CGColorSpace; @@ -198,26 +200,25 @@ @implementation NSString(CPTTextStyleExtensions) **/ -(CGSize)sizeWithTextStyle:(nullable CPTTextStyle *)style { - NSFont *theFont = nil; - NSString *fontName = style.fontName; - - if ( fontName ) { - theFont = [NSFont fontWithName:fontName size:style.fontSize]; - } - - CGSize textSize; + CGRect rect = CGRectZero; - if ( theFont ) { - CPTDictionary attributes = @{ - NSFontAttributeName: theFont - }; - - textSize = NSSizeToCGSize([self sizeWithAttributes:attributes]); + if ( [self respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)] ) { + rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions + attributes:style.attributes + context:nil]; } else { - textSize = CGSizeZero; + rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions + attributes:style.attributes]; } + CGSize textSize = rect.size; + + textSize.width = ceil(textSize.width); + textSize.height = ceil(textSize.height); + return textSize; } @@ -242,10 +243,10 @@ -(void)drawInRect:(CGRect)rect withTextStyle:(nullable CPTTextStyle *)style inCo CPTPushCGContext(context); - NSFont *theFont = nil; + NSFont *theFont = style.font; NSString *fontName = style.fontName; - if ( fontName ) { + if ((theFont == nil) && fontName ) { theFont = [NSFont fontWithName:fontName size:style.fontSize]; } @@ -255,13 +256,13 @@ -(void)drawInRect:(CGRect)rect withTextStyle:(nullable CPTTextStyle *)style inCo paragraphStyle.alignment = (NSTextAlignment)style.textAlignment; paragraphStyle.lineBreakMode = style.lineBreakMode; - CPTDictionary attributes = @{ - NSFontAttributeName: theFont, - NSForegroundColorAttributeName: foregroundColor, - NSParagraphStyleAttributeName: paragraphStyle + CPTDictionary *attributes = @{ + NSFontAttributeName: theFont, + NSForegroundColorAttributeName: foregroundColor, + NSParagraphStyleAttributeName: paragraphStyle }; [self drawWithRect:NSRectFromCGRect(rect) - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine + options:CPTStringDrawingOptions attributes:attributes]; } CPTPopCGContext(); diff --git a/framework/Source/CPTAnimation.h b/framework/Source/CPTAnimation.h index 1802cde6c..93f0e48ba 100644 --- a/framework/Source/CPTAnimation.h +++ b/framework/Source/CPTAnimation.h @@ -1,3 +1,5 @@ +#import + @class CPTAnimationOperation; @class CPTAnimationPeriod; @@ -39,10 +41,18 @@ typedef NS_ENUM (NSInteger, CPTAnimationCurve) { CPTAnimationCurveQuinticInOut ///< Quintic in and out animation curve. }; +#pragma mark - + /** * @brief Animation delegate. **/ +#if ((TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 100000)) \ + || (TARGET_OS_MAC && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101200)) +// CAAnimationDelegate is defined by Core Animation in iOS 10.0+, macOS 10.12+, and tvOS 10.0+ +@protocol CPTAnimationDelegate +#else @protocol CPTAnimationDelegate +#endif @optional diff --git a/framework/Source/CPTAnimation.m b/framework/Source/CPTAnimation.m index cc995c3a0..a626f2dc7 100644 --- a/framework/Source/CPTAnimation.m +++ b/framework/Source/CPTAnimation.m @@ -1,39 +1,39 @@ #import "CPTAnimation.h" +#import "_CPTAnimationTimingFunctions.h" #import "CPTAnimationOperation.h" #import "CPTAnimationPeriod.h" #import "CPTDefinitions.h" -#import "_CPTAnimationTimingFunctions.h" +#import "CPTPlotRange.h" static const CGFloat kCPTAnimationFrameRate = CPTFloat(1.0 / 60.0); // 60 frames per second -static NSString *const CPTAnimationOperationKey = @"CPTAnimationOperationKey"; -static NSString *const CPTAnimationValueKey = @"CPTAnimationValueKey"; -static NSString *const CPTAnimationStartedKey = @"CPTAnimationStartedKey"; -static NSString *const CPTAnimationFinishedKey = @"CPTAnimationFinishedKey"; +static NSString *const CPTAnimationOperationKey = @"CPTAnimationOperationKey"; +static NSString *const CPTAnimationValueKey = @"CPTAnimationValueKey"; +static NSString *const CPTAnimationValueClassKey = @"CPTAnimationValueClassKey"; +static NSString *const CPTAnimationStartedKey = @"CPTAnimationStartedKey"; +static NSString *const CPTAnimationFinishedKey = @"CPTAnimationFinishedKey"; /// @cond -typedef NSMutableArray *CPTMutableAnimationArray; +typedef NSMutableArray CPTMutableAnimationArray; @interface CPTAnimation() @property (nonatomic, readwrite, assign) CGFloat timeOffset; -@property (nonatomic, readwrite, strong, nonnull) CPTMutableAnimationArray animationOperations; -@property (nonatomic, readwrite, strong, nonnull) CPTMutableAnimationArray runningAnimationOperations; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableAnimationArray *animationOperations; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableAnimationArray *runningAnimationOperations; @property (nonatomic, readwrite, nullable) dispatch_source_t timer; @property (nonatomic, readwrite, nonnull) dispatch_queue_t animationQueue; +(nonnull SEL)setterFromProperty:(nonnull NSString *)property; -(nullable CPTAnimationTimingFunction)timingFunctionForAnimationCurve:(CPTAnimationCurve)animationCurve; --(void)updateOnMainThreadWithParameters:(nonnull CPTDictionary)parameters; +-(void)updateOnMainThreadWithParameters:(nonnull CPTDictionary *)parameters; -(void)startTimer; -(void)cancelTimer; -(void)update; -dispatch_source_t __nonnull CPTCreateDispatchTimer(CGFloat interval, dispatch_queue_t __nonnull queue, dispatch_block_t __nonnull block); - @end /// @endcond @@ -61,14 +61,14 @@ @implementation CPTAnimation @synthesize defaultAnimationCurve; /** @internal - * @property nonnull CPTMutableAnimationArray animationOperations + * @property nonnull CPTMutableAnimationArray *animationOperations * * @brief The list of animation operations currently running or waiting to run. **/ @synthesize animationOperations; /** @internal - * @property nonnull CPTMutableAnimationArray runningAnimationOperations + * @property nonnull CPTMutableAnimationArray *runningAnimationOperations * @brief The list of running animation operations. **/ @synthesize runningAnimationOperations; @@ -100,7 +100,7 @@ @implementation CPTAnimation **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { animationOperations = [[NSMutableArray alloc] init]; runningAnimationOperations = [[NSMutableArray alloc] init]; timer = NULL; @@ -200,7 +200,7 @@ -(CPTAnimationOperation *)addAnimationOperation:(nonnull CPTAnimationOperation * id boundObject = animationOperation.boundObject; CPTAnimationPeriod *period = animationOperation.period; - if ( animationOperation.delegate || (boundObject && period && ![period.startValue isEqual:period.endValue]) ) { + if ( animationOperation.delegate || (boundObject && period && ![period.startValue isEqual:period.endValue])) { dispatch_async(self.animationQueue, ^{ [self.animationOperations addObject:animationOperation]; @@ -259,12 +259,12 @@ -(void)update { self.timeOffset += kCPTAnimationFrameRate; - CPTMutableAnimationArray theAnimationOperations = self.animationOperations; - CPTMutableAnimationArray runningOperations = self.runningAnimationOperations; - CPTMutableAnimationArray expiredOperations = [[NSMutableArray alloc] init]; + CPTMutableAnimationArray *theAnimationOperations = self.animationOperations; + CPTMutableAnimationArray *runningOperations = self.runningAnimationOperations; + CPTMutableAnimationArray *expiredOperations = [[NSMutableArray alloc] init]; - CGFloat currentTime = self.timeOffset; - CPTStringArray runModes = @[NSRunLoopCommonModes]; + CGFloat currentTime = self.timeOffset; + CPTStringArray *runModes = @[NSRunLoopCommonModes]; dispatch_queue_t mainQueue = dispatch_get_main_queue(); @@ -277,7 +277,7 @@ -(void)update CGFloat duration = period.duration; CGFloat startTime = period.startOffset; CGFloat delay = period.delay; - if ( isnan(delay) ) { + if ( isnan(delay)) { if ( [period canStartWithValueFromObject:animationOperation.boundObject propertyGetter:animationOperation.boundGetter] ) { period.delay = currentTime - startTime; startTime = currentTime; @@ -315,7 +315,7 @@ -(void)update for ( CPTAnimationOperation *operation in runningOperations ) { if ( operation.boundObject == boundObject ) { - if ( (operation.boundGetter == boundGetter) && (operation.boundSetter == boundSetter) ) { + if ((operation.boundGetter == boundGetter) && (operation.boundSetter == boundSetter)) { operation.canceled = YES; } } @@ -330,13 +330,15 @@ -(void)update [period setStartValueFromObject:animationOperation.boundObject propertyGetter:animationOperation.boundGetter]; } + Class valueClass = period.valueClass; CGFloat progress = timingFunction(currentTime - startTime, duration); - CPTDictionary parameters = @{ - CPTAnimationOperationKey: animationOperation, - CPTAnimationValueKey: [period tweenedValueForProgress:progress], - CPTAnimationStartedKey: @(started), - CPTAnimationFinishedKey: @(currentTime >= endTime) + CPTDictionary *parameters = @{ + CPTAnimationOperationKey: animationOperation, + CPTAnimationValueKey: [period tweenedValueForProgress:progress], + CPTAnimationValueClassKey: valueClass ? valueClass : [NSNull null], + CPTAnimationStartedKey: @(started), + CPTAnimationFinishedKey: @(currentTime >= endTime) }; // Used -performSelectorOnMainThread:... instead of GCD to ensure the animation continues to run in all run loop common modes. @@ -364,7 +366,7 @@ -(void)update } // This method must be called from the main thread. --(void)updateOnMainThreadWithParameters:(nonnull CPTDictionary)parameters +-(void)updateOnMainThreadWithParameters:(nonnull CPTDictionary *)parameters { CPTAnimationOperation *animationOperation = parameters[CPTAnimationOperationKey]; @@ -376,6 +378,11 @@ -(void)updateOnMainThreadWithParameters:(nonnull CPTDictionary)parameters if ( !canceled ) { @try { + Class valueClass = parameters[CPTAnimationValueClassKey]; + if ( [valueClass isKindOfClass:[NSNull class]] ) { + valueClass = Nil; + } + id delegate = animationOperation.delegate; NSNumber *started = parameters[CPTAnimationStartedKey]; @@ -393,14 +400,29 @@ -(void)updateOnMainThreadWithParameters:(nonnull CPTDictionary)parameters id boundObject = animationOperation.boundObject; id tweenedValue = parameters[CPTAnimationValueKey]; - if ( [tweenedValue isKindOfClass:[NSDecimalNumber class]] ) { - NSDecimal buffer = ( (NSDecimalNumber *)tweenedValue ).decimalValue; + if ( !valueClass && [tweenedValue isKindOfClass:[NSDecimalNumber class]] ) { + NSDecimal buffer = ((NSDecimalNumber *)tweenedValue).decimalValue; typedef void (*SetterType)(id, SEL, NSDecimal); SetterType setterMethod = (SetterType)[boundObject methodForSelector:boundSetter]; setterMethod(boundObject, boundSetter, buffer); } - else if ( [tweenedValue isKindOfClass:[NSValue class]] ) { + else if ( valueClass && [tweenedValue isKindOfClass:[NSNumber class]] ) { + NSNumber *value = (NSNumber *)tweenedValue; + + typedef void (*NumberSetterType)(id, SEL, NSNumber *); + NumberSetterType setterMethod = (NumberSetterType)[boundObject methodForSelector:boundSetter]; + setterMethod(boundObject, boundSetter, value); + } + else if ( [tweenedValue isKindOfClass:[CPTPlotRange class]] ) { + CPTPlotRange *range = (CPTPlotRange *)tweenedValue; + + typedef void (*RangeSetterType)(id, SEL, CPTPlotRange *); + RangeSetterType setterMethod = (RangeSetterType)[boundObject methodForSelector:boundSetter]; + setterMethod(boundObject, boundSetter, range); + } + else { + // wrapped scalars and structs NSValue *value = (NSValue *)tweenedValue; NSUInteger bufferSize = 0; @@ -410,20 +432,13 @@ -(void)updateOnMainThreadWithParameters:(nonnull CPTDictionary)parameters invocation.target = boundObject; invocation.selector = boundSetter; - void *buffer = malloc(bufferSize); + void *buffer = calloc(1, bufferSize); [value getValue:buffer]; [invocation setArgument:buffer atIndex:2]; free(buffer); [invocation invoke]; } - else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" - id theObject = boundObject; - [theObject performSelector:boundSetter withObject:tweenedValue]; -#pragma clang diagnostic pop - } if ( [delegate respondsToSelector:@selector(animationDidUpdate:)] ) { [delegate animationDidUpdate:animationOperation]; @@ -447,9 +462,17 @@ -(void)updateOnMainThreadWithParameters:(nonnull CPTDictionary)parameters -(void)startTimer { - self.timer = CPTCreateDispatchTimer(kCPTAnimationFrameRate, self.animationQueue, ^{ - [self update]; - }); + dispatch_source_t newTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, self.animationQueue); + + if ( newTimer ) { + dispatch_source_set_timer(newTimer, dispatch_time(DISPATCH_TIME_NOW, 0), (uint64_t)(kCPTAnimationFrameRate * NSEC_PER_SEC), 0); + dispatch_source_set_event_handler(newTimer, ^{ + [self update]; + }); + dispatch_resume(newTimer); + + self.timer = newTimer; + } } -(void)cancelTimer @@ -462,18 +485,6 @@ -(void)cancelTimer } } -dispatch_source_t __nonnull CPTCreateDispatchTimer(CGFloat interval, dispatch_queue_t __nonnull queue, dispatch_block_t __nonnull block) -{ - dispatch_source_t newTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); - - if ( newTimer ) { - dispatch_source_set_timer(newTimer, dispatch_time(DISPATCH_TIME_NOW, 0), (uint64_t)(interval * NSEC_PER_SEC), 0); - dispatch_source_set_event_handler(newTimer, block); - dispatch_resume(newTimer); - } - return newTimer; -} - /// @endcond #pragma mark - Timing Functions diff --git a/framework/Source/CPTAnimationOperation.h b/framework/Source/CPTAnimationOperation.h index 275a316fd..b179bf210 100644 --- a/framework/Source/CPTAnimationOperation.h +++ b/framework/Source/CPTAnimationOperation.h @@ -20,7 +20,7 @@ /// @name Delegate /// @{ -@property (nonatomic, cpt_weak_property, nullable) cpt_weak id delegate; +@property (nonatomic, cpt_weak_property, nullable) id delegate; /// @} /// @name Status diff --git a/framework/Source/CPTAnimationOperation.m b/framework/Source/CPTAnimationOperation.m index 1dedcfb0d..e7047abc5 100644 --- a/framework/Source/CPTAnimationOperation.m +++ b/framework/Source/CPTAnimationOperation.m @@ -31,7 +31,7 @@ @implementation CPTAnimationOperation **/ @synthesize boundSetter; -/** @property nullable cpt_weak iddelegate +/** @property nullable iddelegate * @brief The animation delegate. **/ @synthesize delegate; @@ -77,7 +77,7 @@ @implementation CPTAnimationOperation **/ -(nonnull instancetype)initWithAnimationPeriod:(nonnull CPTAnimationPeriod *)animationPeriod animationCurve:(CPTAnimationCurve)curve object:(nonnull id)object getter:(nonnull SEL)getter setter:(nonnull SEL)setter { - if ( (self = [super init]) ) { + if ((self = [super init])) { period = animationPeriod; animationCurve = curve; boundObject = object; diff --git a/framework/Source/CPTAnimationPeriod.h b/framework/Source/CPTAnimationPeriod.h index 4bd0fc817..cfd21ac63 100644 --- a/framework/Source/CPTAnimationPeriod.h +++ b/framework/Source/CPTAnimationPeriod.h @@ -9,6 +9,7 @@ /// @{ @property (nonatomic, readwrite, copy, nullable) NSValue *startValue; @property (nonatomic, readwrite, copy, nullable) NSValue *endValue; +@property (nonatomic, readonly, nullable) Class valueClass; @property (nonatomic, readwrite) CGFloat duration; @property (nonatomic, readwrite) CGFloat delay; @property (nonatomic, readonly) CGFloat startOffset; @@ -21,6 +22,7 @@ +(nonnull instancetype)periodWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +(nonnull instancetype)periodWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +(nonnull instancetype)periodWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; ++(nonnull instancetype)periodWithStartNumber:(nullable NSNumber *)aStartNumber endNumber:(nonnull NSNumber *)anEndNumber duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +(nonnull instancetype)periodWithStartPlotRange:(nonnull CPTPlotRange *)aStartPlotRange endPlotRange:(nonnull CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; /// @} @@ -31,6 +33,7 @@ -(nonnull instancetype)initWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; -(nonnull instancetype)initWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; -(nonnull instancetype)initWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +-(nonnull instancetype)initWithStartNumber:(nullable NSNumber *)aStartNumber endNumber:(nonnull NSNumber *)anEndNumber duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; -(nonnull instancetype)initWithStartPlotRange:(nonnull CPTPlotRange *)aStartPlotRange endPlotRange:(nonnull CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; /// @} @@ -99,6 +102,13 @@ +(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration; /// @} +/// @name NSNumber Property Animation +/// @{ ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration; +/// @} + /// @name CPTPlotRange Property Animation /// @{ +(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPlotRange:(nonnull CPTPlotRange *)from toPlotRange:(nonnull CPTPlotRange *)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; diff --git a/framework/Source/CPTAnimationPeriod.m b/framework/Source/CPTAnimationPeriod.m index bfc74f27a..3d781b79c 100644 --- a/framework/Source/CPTAnimationPeriod.m +++ b/framework/Source/CPTAnimationPeriod.m @@ -1,21 +1,22 @@ #import "CPTAnimationPeriod.h" -#import "CPTAnimationOperation.h" -#import "CPTPlotRange.h" -#import "NSNumberExtensions.h" #import "_CPTAnimationCGFloatPeriod.h" #import "_CPTAnimationCGPointPeriod.h" #import "_CPTAnimationCGRectPeriod.h" #import "_CPTAnimationCGSizePeriod.h" #import "_CPTAnimationNSDecimalPeriod.h" +#import "_CPTAnimationNSNumberPeriod.h" #import "_CPTAnimationPlotRangePeriod.h" +#import "CPTAnimationOperation.h" +#import "CPTPlotRange.h" +#import "NSNumberExtensions.h" /// @cond @interface CPTAnimationPeriod() -+(nonnull instancetype)periodWithStartValue:(nullable NSValue *)aStartValue endValue:(nullable NSValue *)anEndValue duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; ++(nonnull instancetype)periodWithStartValue:(nullable NSValue *)aStartValue endValue:(nullable NSValue *)anEndValue ofClass:(nullable Class)class duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; --(nonnull instancetype)initWithStartValue:(nullable NSValue *)aStartValue endValue:(nullable NSValue *)anEndValue duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +-(nonnull instancetype)initWithStartValue:(nullable NSValue *)aStartValue endValue:(nullable NSValue *)anEndValue ofClass:(nullable Class)class duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; @property (nonatomic, readwrite) CGFloat startOffset; @@ -33,6 +34,7 @@ -(nonnull instancetype)initWithStartValue:(nullable NSValue *)aStartValue endVal * - @ref CGSize * - @ref CGRect * - @ref NSDecimal + * - @ref NSNumber * - @ref CPTPlotRange (NSValue wrapper not used) * @note The starting and ending values must be the same type. **/ @@ -50,6 +52,11 @@ @implementation CPTAnimationPeriod **/ @synthesize endValue; +/** @property Class valueClass + * @brief The Objective-C class of the animated object. If @nil, the value is a scalar or struct wrapped in an NSValue object. + **/ +@synthesize valueClass; + /** @property CGFloat duration * @brief The duration of the animation, in seconds. **/ @@ -75,13 +82,14 @@ @implementation CPTAnimationPeriod * @brief Creates and returns a new CPTAnimationPeriod instance initialized with the provided start and end values and duration. * @param aStartValue The starting value. If @nil, the animation starts from the current value of the animated property. * @param anEndValue The ending value. + * @param class The Objective-C class of the animated object. If @Nil, the value is a scalar or struct wrapped in an NSValue object. * @param aDuration The animation duration in seconds. * @param aDelay The starting delay in seconds. * @return The initialized object. **/ -+(nonnull instancetype)periodWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anEndValue duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay ++(instancetype)periodWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anEndValue ofClass:(Class)class duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { - return [[self alloc] initWithStartValue:aStartValue endValue:anEndValue duration:aDuration withDelay:aDelay]; + return [[self alloc] initWithStartValue:aStartValue endValue:anEndValue ofClass:class duration:aDuration withDelay:aDelay]; } /// @endcond @@ -100,6 +108,7 @@ +(nonnull instancetype)periodWithStart:(CGFloat)aStart end:(CGFloat)anEnd durati return [_CPTAnimationCGFloatPeriod periodWithStartValue:start endValue:@(anEnd) + ofClass:Nil duration:aDuration withDelay:aDelay]; } @@ -116,12 +125,13 @@ +(nonnull instancetype)periodWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoi { NSValue *start = nil; - if ( !isnan(aStartPoint.x) && !isnan(aStartPoint.y) ) { + if ( !isnan(aStartPoint.x) && !isnan(aStartPoint.y)) { start = [NSValue valueWithBytes:&aStartPoint objCType:@encode(CGPoint)]; } return [_CPTAnimationCGPointPeriod periodWithStartValue:start endValue:[NSValue valueWithBytes:&anEndPoint objCType:@encode(CGPoint)] + ofClass:Nil duration:aDuration withDelay:aDelay]; } @@ -138,12 +148,13 @@ +(nonnull instancetype)periodWithStartSize:(CGSize)aStartSize endSize:(CGSize)an { NSValue *start = nil; - if ( !isnan(aStartSize.width) && !isnan(aStartSize.height) ) { + if ( !isnan(aStartSize.width) && !isnan(aStartSize.height)) { start = [NSValue valueWithBytes:&aStartSize objCType:@encode(CGSize)]; } return [_CPTAnimationCGSizePeriod periodWithStartValue:start endValue:[NSValue valueWithBytes:&anEndSize objCType:@encode(CGSize)] + ofClass:Nil duration:aDuration withDelay:aDelay]; } @@ -160,12 +171,13 @@ +(nonnull instancetype)periodWithStartRect:(CGRect)aStartRect endRect:(CGRect)an { NSValue *start = nil; - if ( !CGRectEqualToRect(aStartRect, CGRectNull) && !isnan(aStartRect.origin.x) && !isnan(aStartRect.origin.y) && !isnan(aStartRect.size.width) && !isnan(aStartRect.size.height) ) { + if ( !CGRectEqualToRect(aStartRect, CGRectNull) && !isnan(aStartRect.origin.x) && !isnan(aStartRect.origin.y) && !isnan(aStartRect.size.width) && !isnan(aStartRect.size.height)) { start = [NSValue valueWithBytes:&aStartRect objCType:@encode(CGRect)]; } return [_CPTAnimationCGRectPeriod periodWithStartValue:start endValue:[NSValue valueWithBytes:&anEndRect objCType:@encode(CGRect)] + ofClass:Nil duration:aDuration withDelay:aDelay]; } @@ -184,10 +196,28 @@ +(nonnull instancetype)periodWithStartDecimal:(NSDecimal)aStartDecimal endDecima return [_CPTAnimationNSDecimalPeriod periodWithStartValue:start endValue:[NSDecimalNumber decimalNumberWithDecimal:anEndDecimal] + ofClass:Nil duration:aDuration withDelay:aDelay]; } +/** + * @brief Creates and returns a new CPTAnimationPeriod instance initialized with the provided start and end values and duration. + * @param aStartNumber The starting value. If @NAN or @nil, the animation starts from the current value of the animated property. + * @param anEndNumber The ending value. + * @param aDuration The animation duration in seconds. + * @param aDelay The starting delay in seconds. + * @return The initialized object. + **/ ++(nonnull instancetype)periodWithStartNumber:(nullable NSNumber *)aStartNumber endNumber:(nonnull NSNumber *)anEndNumber duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +{ + return [_CPTAnimationNSNumberPeriod periodWithStartValue:aStartNumber + endValue:anEndNumber + ofClass:[NSNumber class] + duration:aDuration + withDelay:aDelay]; +} + /** * @brief Creates and returns a new CPTAnimationPeriod instance initialized with the provided start and end plot ranges and duration. * @param aStartPlotRange The starting plot range. If @nil or any component of the range is @NAN, the animation starts from the current value of the animated property. @@ -200,12 +230,13 @@ +(nonnull instancetype)periodWithStartPlotRange:(nonnull CPTPlotRange *)aStartPl { CPTPlotRange *startRange = aStartPlotRange; - if ( isnan(aStartPlotRange.locationDouble) || isnan(aStartPlotRange.lengthDouble) ) { + if ( isnan(aStartPlotRange.locationDouble) || isnan(aStartPlotRange.lengthDouble)) { startRange = nil; } return [_CPTAnimationPlotRangePeriod periodWithStartValue:(NSValue *)startRange endValue:(NSValue *)anEndPlotRange + ofClass:[CPTPlotRange class] duration:aDuration withDelay:aDelay]; } @@ -218,21 +249,24 @@ +(nonnull instancetype)periodWithStartPlotRange:(nonnull CPTPlotRange *)aStartPl * This is the designated initializer. The initialized object will have the following properties: * - @ref startValue = @par{aStartValue} * - @ref endValue = @par{anEndValue} + * - @ref class = @par{class} * - @ref duration = @par{aDuration} * - @ref delay = @par{aDelay} * - @ref startOffset = The animation time clock offset when this method is called. * * @param aStartValue The starting value. If @nil, the animation starts from the current value of the animated property. * @param anEndValue The ending value. + * @param class The Objective-C class of the animated object. If @Nil, the value is a scalar or struct wrapped in an NSValue object. * @param aDuration The animation duration in seconds. * @param aDelay The starting delay in seconds. * @return The initialized object. **/ --(nonnull instancetype)initWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anEndValue duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +-(instancetype)initWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anEndValue ofClass:(Class)class duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { - if ( (self = [super init]) ) { + if ((self = [super init])) { startValue = [aStartValue copy]; endValue = [anEndValue copy]; + valueClass = class; duration = aDuration; delay = aDelay; startOffset = [CPTAnimation sharedInstance].timeOffset; @@ -257,6 +291,7 @@ -(nonnull instancetype)initWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration self = [[_CPTAnimationCGFloatPeriod alloc] initWithStartValue:start endValue:@(anEnd) + ofClass:Nil duration:aDuration withDelay:aDelay]; @@ -275,12 +310,13 @@ -(nonnull instancetype)initWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint { NSValue *start = nil; - if ( !isnan(aStartPoint.x) && !isnan(aStartPoint.y) ) { + if ( !isnan(aStartPoint.x) && !isnan(aStartPoint.y)) { start = [NSValue valueWithBytes:&aStartPoint objCType:@encode(CGPoint)]; } self = [[_CPTAnimationCGPointPeriod alloc] initWithStartValue:start endValue:[NSValue valueWithBytes:&anEndPoint objCType:@encode(CGPoint)] + ofClass:Nil duration:aDuration withDelay:aDelay]; @@ -299,12 +335,13 @@ -(nonnull instancetype)initWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEn { NSValue *start = nil; - if ( !isnan(aStartSize.width) && !isnan(aStartSize.height) ) { + if ( !isnan(aStartSize.width) && !isnan(aStartSize.height)) { start = [NSValue valueWithBytes:&aStartSize objCType:@encode(CGSize)]; } self = [[_CPTAnimationCGSizePeriod alloc] initWithStartValue:start endValue:[NSValue valueWithBytes:&anEndSize objCType:@encode(CGSize)] + ofClass:Nil duration:aDuration withDelay:aDelay]; @@ -323,12 +360,13 @@ -(nonnull instancetype)initWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEn { NSValue *start = nil; - if ( !CGRectEqualToRect(aStartRect, CGRectNull) && !isnan(aStartRect.origin.x) && !isnan(aStartRect.origin.y) && !isnan(aStartRect.size.width) && !isnan(aStartRect.size.height) ) { + if ( !CGRectEqualToRect(aStartRect, CGRectNull) && !isnan(aStartRect.origin.x) && !isnan(aStartRect.origin.y) && !isnan(aStartRect.size.width) && !isnan(aStartRect.size.height)) { start = [NSValue valueWithBytes:&aStartRect objCType:@encode(CGRect)]; } self = [[_CPTAnimationCGRectPeriod alloc] initWithStartValue:start endValue:[NSValue valueWithBytes:&anEndRect objCType:@encode(CGRect)] + ofClass:Nil duration:aDuration withDelay:aDelay]; @@ -349,12 +387,32 @@ -(nonnull instancetype)initWithStartDecimal:(NSDecimal)aStartDecimal endDecimal: self = [[_CPTAnimationNSDecimalPeriod alloc] initWithStartValue:start endValue:[NSDecimalNumber decimalNumberWithDecimal:anEndDecimal] + ofClass:Nil duration:aDuration withDelay:aDelay]; return self; } +/** + * @brief Initializes a newly allocated CPTAnimationPeriod object with the provided start and end values and duration. + * @param aStartNumber The starting value. If @NAN or @nil, the animation starts from the current value of the animated property. + * @param anEndNumber The ending value. + * @param aDuration The animation duration in seconds. + * @param aDelay The starting delay in seconds. + * @return The initialized object. + **/ +-(nonnull instancetype)initWithStartNumber:(nullable NSNumber *)aStartNumber endNumber:(nonnull NSNumber *)anEndNumber duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +{ + self = [[_CPTAnimationNSNumberPeriod alloc] initWithStartValue:aStartNumber + endValue:anEndNumber + ofClass:[NSNumber class] + duration:aDuration + withDelay:aDelay]; + + return self; +} + /** * @brief Initializes a newly allocated CPTAnimationPeriod object with the provided start and end plot ranges and duration. * @param aStartPlotRange The starting plot range. If @nil or any component of the range is @NAN, the animation starts from the current value of the animated property. @@ -367,12 +425,13 @@ -(nonnull instancetype)initWithStartPlotRange:(nonnull CPTPlotRange *)aStartPlot { CPTPlotRange *startRange = aStartPlotRange; - if ( isnan(aStartPlotRange.locationDouble) || isnan(aStartPlotRange.lengthDouble) ) { + if ( isnan(aStartPlotRange.locationDouble) || isnan(aStartPlotRange.lengthDouble)) { startRange = nil; } self = [[_CPTAnimationPlotRangePeriod alloc] initWithStartValue:(NSValue *)startRange endValue:(NSValue *)anEndPlotRange + ofClass:[CPTPlotRange class] duration:aDuration withDelay:aDelay]; @@ -386,7 +445,7 @@ -(nonnull instancetype)initWithStartPlotRange:(nonnull CPTPlotRange *)aStartPlot **/ -(nonnull instancetype)init { - return [self initWithStartValue:nil endValue:nil duration:CPTFloat(0.0) withDelay:CPTFloat(0.0)]; + return [self initWithStartValue:nil endValue:@0.0 ofClass:Nil duration:CPTFloat(0.0) withDelay:CPTFloat(0.0)]; } /// @endcond @@ -399,7 +458,7 @@ -(nonnull instancetype)init * @param boundObject The object to update for each animation frame. * @param boundGetter The getter method for the property to update. **/ --(void)setStartValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter +-(void)setStartValueFromObject:(nonnull id __unused)boundObject propertyGetter:(nonnull SEL __unused)boundGetter { [NSException raise:NSGenericException format:@"The -initializeStartValue method must be implemented by CPTAnimationPeriod subclasses."]; @@ -413,7 +472,7 @@ -(void)setStartValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull S * @param progress The fraction of the animation progress. * @return The computed value. **/ --(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress +-(nonnull NSValue *)tweenedValueForProgress:(CGFloat __unused)progress { [NSException raise:NSGenericException format:@"The -tweenedValueForProgress: method must be implemented by CPTAnimationPeriod subclasses."]; @@ -426,7 +485,7 @@ -(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress * @param boundGetter The getter method for the property to update. * @return @YES if the current value of the bound property is between the start and end value. **/ --(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter +-(BOOL)canStartWithValueFromObject:(nonnull id __unused)boundObject propertyGetter:(nonnull SEL __unused)boundGetter { [NSException raise:NSGenericException format:@"The -canStartWithValueFromObject:propertyGetter: method must be implemented by CPTAnimationPeriod subclasses."]; @@ -826,6 +885,81 @@ +(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull N delegate:nil]; } +// NSNumber + +/** @brief Creates an animation operation with the given properties and adds it to the animation queue. + * @param object The object to animate. + * @param property The name of the property of @par{object} to animate. The property must have both getter and setter methods. + * @param from The starting value. If @NAN or @nil, the animation starts from the current value of the animated property. + * @param to The ending value. + * @param duration The duration of the animation. + * @param delay The starting delay of the animation in seconds. + * @param animationCurve The animation curve used to animate the new operation. + * @param delegate The animation delegate (can be @nil). + * @return The queued animation operation. + **/ ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate +{ + CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartNumber:from + endNumber:to + duration:duration + withDelay:delay]; + + return [self animate:object + property:property + period:period + animationCurve:animationCurve + delegate:delegate + ]; +} + +/** @brief Creates an animation operation with the given properties and adds it to the animation queue. + * @param object The object to animate. + * @param property The name of the property of @par{object} to animate. The property must have both getter and setter methods. + * @param from The starting value. If @NAN or @nil, the animation starts from the current value of the animated property. + * @param to The ending value. + * @param duration The duration of the animation. + * @param animationCurve The animation curve used to animate the new operation. + * @param delegate The animation delegate (can be @nil). + * @return The queued animation operation. + **/ ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate +{ + CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartNumber:from + endNumber:to + duration:duration + withDelay:CPTFloat(0.0)]; + + return [self animate:object + property:property + period:period + animationCurve:animationCurve + delegate:delegate + ]; +} + +/** @brief Creates an animation operation with the given properties and adds it to the animation queue. + * @param object The object to animate. + * @param property The name of the property of @par{object} to animate. The property must have both getter and setter methods. + * @param from The starting value. If @NAN or @nil, the animation starts from the current value of the animated property. + * @param to The ending value. + * @param duration The duration of the animation. + * @return The queued animation operation. + **/ ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration +{ + CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartNumber:from + endNumber:to + duration:duration + withDelay:CPTFloat(0.0)]; + + return [self animate:object + property:property + period:period + animationCurve:CPTAnimationCurveDefault + delegate:nil]; +} + // CPTPlotRange /** @brief Creates an animation operation with the given properties and adds it to the animation queue. diff --git a/framework/Source/CPTAnnotation.h b/framework/Source/CPTAnnotation.h index 9bab1b560..cda5d79bc 100644 --- a/framework/Source/CPTAnnotation.h +++ b/framework/Source/CPTAnnotation.h @@ -9,21 +9,27 @@ /** * @brief An array of annotations. **/ -typedef NSArray<__kindof CPTAnnotation *> *CPTAnnotationArray; +typedef NSArray<__kindof CPTAnnotation *> CPTAnnotationArray; /** * @brief A mutable array of annotations. **/ -typedef NSMutableArray<__kindof CPTAnnotation *> *CPTMutableAnnotationArray; +typedef NSMutableArray<__kindof CPTAnnotation *> CPTMutableAnnotationArray; -@interface CPTAnnotation : NSObject +@interface CPTAnnotation : NSObject @property (nonatomic, readwrite, strong, nullable) CPTLayer *contentLayer; -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTAnnotationHostLayer *annotationHostLayer; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTAnnotationHostLayer *annotationHostLayer; @property (nonatomic, readwrite, assign) CGPoint contentAnchorPoint; @property (nonatomic, readwrite, assign) CGPoint displacement; @property (nonatomic, readwrite, assign) CGFloat rotation; +/// @name Initialization +/// @{ +-(nonnull instancetype)init NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; +/// @} + @end #pragma mark - diff --git a/framework/Source/CPTAnnotation.m b/framework/Source/CPTAnnotation.m index 5e21a7185..18483ec57 100644 --- a/framework/Source/CPTAnnotation.m +++ b/framework/Source/CPTAnnotation.m @@ -16,7 +16,7 @@ @implementation CPTAnnotation **/ @synthesize contentLayer; -/** @property nullable cpt_weak CPTAnnotationHostLayer *annotationHostLayer +/** @property nullable CPTAnnotationHostLayer *annotationHostLayer * @brief The host layer for the annotation content. **/ @synthesize annotationHostLayer; @@ -55,7 +55,7 @@ @implementation CPTAnnotation **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { annotationHostLayer = nil; contentLayer = nil; displacement = CGPointZero; @@ -83,18 +83,32 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - annotationHostLayer = [coder decodeObjectForKey:@"CPTAnnotation.annotationHostLayer"]; - contentLayer = [coder decodeObjectForKey:@"CPTAnnotation.contentLayer"]; - contentAnchorPoint = [coder decodeCPTPointForKey:@"CPTAnnotation.contentAnchorPoint"]; - displacement = [coder decodeCPTPointForKey:@"CPTAnnotation.displacement"]; - rotation = [coder decodeCGFloatForKey:@"CPTAnnotation.rotation"]; + if ((self = [super init])) { + annotationHostLayer = [coder decodeObjectOfClass:[CPTAnnotationHostLayer class] + forKey:@"CPTAnnotation.annotationHostLayer"]; + contentLayer = [coder decodeObjectOfClass:[CPTLayer class] + forKey:@"CPTAnnotation.contentLayer"]; + contentAnchorPoint = [coder decodeCPTPointForKey:@"CPTAnnotation.contentAnchorPoint"]; + displacement = [coder decodeCPTPointForKey:@"CPTAnnotation.displacement"]; + rotation = [coder decodeCGFloatForKey:@"CPTAnnotation.rotation"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Description @@ -141,7 +155,7 @@ -(void)setAnnotationHostLayer:(nullable CPTAnnotationHostLayer *)newLayer -(void)setDisplacement:(CGPoint)newDisplacement { - if ( !CGPointEqualToPoint(newDisplacement, displacement) ) { + if ( !CGPointEqualToPoint(newDisplacement, displacement)) { displacement = newDisplacement; [self.contentLayer.superlayer setNeedsLayout]; } @@ -149,7 +163,7 @@ -(void)setDisplacement:(CGPoint)newDisplacement -(void)setContentAnchorPoint:(CGPoint)newAnchorPoint { - if ( !CGPointEqualToPoint(newAnchorPoint, contentAnchorPoint) ) { + if ( !CGPointEqualToPoint(newAnchorPoint, contentAnchorPoint)) { contentAnchorPoint = newAnchorPoint; [self.contentLayer.superlayer setNeedsLayout]; } diff --git a/framework/Source/CPTAnnotationHostLayer.h b/framework/Source/CPTAnnotationHostLayer.h index 56c71ce95..a8217fa32 100644 --- a/framework/Source/CPTAnnotationHostLayer.h +++ b/framework/Source/CPTAnnotationHostLayer.h @@ -3,7 +3,7 @@ @interface CPTAnnotationHostLayer : CPTLayer -@property (nonatomic, readonly, nonnull) CPTAnnotationArray annotations; +@property (nonatomic, readonly, nonnull) CPTAnnotationArray *annotations; /// @name Annotations /// @{ diff --git a/framework/Source/CPTAnnotationHostLayer.m b/framework/Source/CPTAnnotationHostLayer.m index 079c0592f..6fa9af69b 100644 --- a/framework/Source/CPTAnnotationHostLayer.m +++ b/framework/Source/CPTAnnotationHostLayer.m @@ -5,7 +5,7 @@ /// @cond @interface CPTAnnotationHostLayer() -@property (nonatomic, readwrite, strong, nonnull) CPTMutableAnnotationArray mutableAnnotations; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableAnnotationArray *mutableAnnotations; @end @@ -20,7 +20,7 @@ @interface CPTAnnotationHostLayer() **/ @implementation CPTAnnotationHostLayer -/** @property nonnull CPTAnnotationArray annotations +/** @property nonnull CPTAnnotationArray *annotations * @brief An array of annotations attached to this layer. **/ @dynamic annotations; @@ -43,7 +43,7 @@ @implementation CPTAnnotationHostLayer **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { mutableAnnotations = [[NSMutableArray alloc] init]; } return self; @@ -55,7 +55,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTAnnotationHostLayer *theLayer = (CPTAnnotationHostLayer *)layer; mutableAnnotations = theLayer->mutableAnnotations; @@ -79,8 +79,9 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - CPTAnnotationArray annotations = [coder decodeObjectForKey:@"CPTAnnotationHostLayer.mutableAnnotations"]; + if ((self = [super initWithCoder:coder])) { + CPTAnnotationArray *annotations = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTAnnotation class]]] + forKey:@"CPTAnnotationHostLayer.mutableAnnotations"]; if ( annotations ) { mutableAnnotations = [annotations mutableCopy]; } @@ -93,12 +94,24 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Annotations /// @cond --(nonnull CPTAnnotationArray)annotations +-(nonnull CPTAnnotationArray *)annotations { return [self.mutableAnnotations copy]; } @@ -113,7 +126,7 @@ -(void)addAnnotation:(nullable CPTAnnotation *)annotation if ( annotation ) { CPTAnnotation *theAnnotation = annotation; - CPTMutableAnnotationArray annotationArray = self.mutableAnnotations; + CPTMutableAnnotationArray *annotationArray = self.mutableAnnotations; if ( ![annotationArray containsObject:theAnnotation] ) { [annotationArray addObject:theAnnotation]; } @@ -146,7 +159,7 @@ -(void)removeAnnotation:(nullable CPTAnnotation *)annotation **/ -(void)removeAllAnnotations { - CPTMutableAnnotationArray allAnnotations = self.mutableAnnotations; + CPTMutableAnnotationArray *allAnnotations = self.mutableAnnotations; for ( CPTAnnotation *annotation in allAnnotations ) { annotation.annotationHostLayer = nil; @@ -159,12 +172,12 @@ -(void)removeAllAnnotations /// @cond --(nullable CPTSublayerSet)sublayersExcludedFromAutomaticLayout +-(nullable CPTSublayerSet *)sublayersExcludedFromAutomaticLayout { - CPTMutableAnnotationArray annotations = self.mutableAnnotations; + CPTMutableAnnotationArray *annotations = self.mutableAnnotations; if ( annotations.count > 0 ) { - CPTMutableSublayerSet excludedSublayers = [super.sublayersExcludedFromAutomaticLayout mutableCopy]; + CPTMutableSublayerSet *excludedSublayers = [super.sublayersExcludedFromAutomaticLayout mutableCopy]; if ( !excludedSublayers ) { excludedSublayers = [NSMutableSet set]; @@ -217,7 +230,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) for ( CPTAnnotation *annotation in self.annotations ) { CPTLayer *content = annotation.contentLayer; if ( content ) { - if ( CGRectContainsPoint(content.frame, interactionPoint) ) { + if ( CGRectContainsPoint(content.frame, interactionPoint)) { BOOL handled = [content pointingDeviceDownEvent:event atPoint:interactionPoint]; if ( handled ) { return YES; @@ -248,7 +261,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in for ( CPTAnnotation *annotation in self.annotations ) { CPTLayer *content = annotation.contentLayer; if ( content ) { - if ( CGRectContainsPoint(content.frame, interactionPoint) ) { + if ( CGRectContainsPoint(content.frame, interactionPoint)) { BOOL handled = [content pointingDeviceUpEvent:event atPoint:interactionPoint]; if ( handled ) { return YES; @@ -279,7 +292,7 @@ -(BOOL)pointingDeviceDraggedEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoi for ( CPTAnnotation *annotation in self.annotations ) { CPTLayer *content = annotation.contentLayer; if ( content ) { - if ( CGRectContainsPoint(content.frame, interactionPoint) ) { + if ( CGRectContainsPoint(content.frame, interactionPoint)) { BOOL handled = [content pointingDeviceDraggedEvent:event atPoint:interactionPoint]; if ( handled ) { return YES; diff --git a/framework/Source/CPTAxis.h b/framework/Source/CPTAxis.h index 338c17837..65bec6a8a 100644 --- a/framework/Source/CPTAxis.h +++ b/framework/Source/CPTAxis.h @@ -32,19 +32,19 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { /** * @brief An array of axes. **/ -typedef NSArray<__kindof CPTAxis *> *CPTAxisArray; +typedef NSArray<__kindof CPTAxis *> CPTAxisArray; /** * @brief A mutable array of axes. **/ -typedef NSMutableArray<__kindof CPTAxis *> *CPTMutableAxisArray; +typedef NSMutableArray<__kindof CPTAxis *> CPTMutableAxisArray; #pragma mark - /** * @brief Axis labeling delegate. **/ -@protocol CPTAxisDelegate +@protocol CPTAxisDelegate @optional @@ -70,7 +70,7 @@ typedef NSMutableArray<__kindof CPTAxis *> *CPTMutableAxisArray; * @param locations The locations of the major ticks. * @return @YES if the axis class should proceed with automatic labeling. **/ --(BOOL)axis:(nonnull CPTAxis *)axis shouldUpdateAxisLabelsAtLocations:(nonnull CPTNumberSet)locations; +-(BOOL)axis:(nonnull CPTAxis *)axis shouldUpdateAxisLabelsAtLocations:(nonnull CPTNumberSet *)locations; /** @brief @optional This method gives the delegate a chance to create custom labels for each minor tick. * It can be used with any labeling policy. Returning @NO will cause the axis not @@ -79,7 +79,7 @@ typedef NSMutableArray<__kindof CPTAxis *> *CPTMutableAxisArray; * @param locations The locations of the minor ticks. * @return @YES if the axis class should proceed with automatic labeling. **/ --(BOOL)axis:(nonnull CPTAxis *)axis shouldUpdateMinorAxisLabelsAtLocations:(nonnull CPTNumberSet)locations; +-(BOOL)axis:(nonnull CPTAxis *)axis shouldUpdateMinorAxisLabelsAtLocations:(nonnull CPTNumberSet *)locations; /// @} @@ -236,10 +236,10 @@ typedef NSMutableArray<__kindof CPTAxis *> *CPTMutableAxisArray; @property (nonatomic, readwrite, assign) CPTSign minorTickLabelDirection; @property (nonatomic, readwrite, strong, nullable) NSFormatter *labelFormatter; @property (nonatomic, readwrite, strong, nullable) NSFormatter *minorTickLabelFormatter; -@property (nonatomic, readwrite, strong, nullable) CPTAxisLabelSet axisLabels; -@property (nonatomic, readwrite, strong, nullable) CPTAxisLabelSet minorTickAxisLabels; +@property (nonatomic, readwrite, strong, nullable) CPTAxisLabelSet *axisLabels; +@property (nonatomic, readwrite, strong, nullable) CPTAxisLabelSet *minorTickAxisLabels; @property (nonatomic, readonly) BOOL needsRelabel; -@property (nonatomic, readwrite, strong, nullable) CPTPlotRangeArray labelExclusionRanges; +@property (nonatomic, readwrite, strong, nullable) CPTPlotRangeArray *labelExclusionRanges; @property (nonatomic, readwrite, strong, nullable) CPTShadow *labelShadow; @property (nonatomic, readwrite, strong, nullable) CPTShadow *minorTickLabelShadow; /// @} @@ -249,7 +249,7 @@ typedef NSMutableArray<__kindof CPTAxis *> *CPTMutableAxisArray; @property (nonatomic, readwrite, strong, nullable) NSNumber *majorIntervalLength; @property (nonatomic, readwrite, assign) CGFloat majorTickLength; @property (nonatomic, readwrite, copy, nullable) CPTLineStyle *majorTickLineStyle; -@property (nonatomic, readwrite, strong, nullable) CPTNumberSet majorTickLocations; +@property (nonatomic, readwrite, strong, nullable) CPTNumberSet *majorTickLocations; @property (nonatomic, readwrite, assign) NSUInteger preferredNumberOfMajorTicks; /// @} @@ -258,7 +258,7 @@ typedef NSMutableArray<__kindof CPTAxis *> *CPTMutableAxisArray; @property (nonatomic, readwrite, assign) NSUInteger minorTicksPerInterval; @property (nonatomic, readwrite, assign) CGFloat minorTickLength; @property (nonatomic, readwrite, copy, nullable) CPTLineStyle *minorTickLineStyle; -@property (nonatomic, readwrite, strong, nullable) CPTNumberSet minorTickLocations; +@property (nonatomic, readwrite, strong, nullable) CPTNumberSet *minorTickLocations; /// @} /// @name Grid Lines @@ -270,8 +270,9 @@ typedef NSMutableArray<__kindof CPTAxis *> *CPTMutableAxisArray; /// @name Background Bands /// @{ -@property (nonatomic, readwrite, copy, nullable) CPTFillArray alternatingBandFills; -@property (nonatomic, readonly, nullable) CPTLimitBandArray backgroundLimitBands; +@property (nonatomic, readwrite, copy, nullable) CPTFillArray *alternatingBandFills; +@property (nonatomic, readwrite, strong, nullable) NSNumber *alternatingBandAnchor; +@property (nonatomic, readonly, nullable) CPTLimitBandArray *backgroundLimitBands; /// @} /// @name Plot Space @@ -282,9 +283,9 @@ typedef NSMutableArray<__kindof CPTAxis *> *CPTMutableAxisArray; /// @name Layers /// @{ @property (nonatomic, readwrite, assign) BOOL separateLayers; -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTPlotArea *plotArea; -@property (nonatomic, readonly, nullable) cpt_weak CPTGridLines *minorGridLines; -@property (nonatomic, readonly, nullable) cpt_weak CPTGridLines *majorGridLines; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTPlotArea *plotArea; +@property (nonatomic, readonly, cpt_weak_property, nullable) CPTGridLines *minorGridLines; +@property (nonatomic, readonly, cpt_weak_property, nullable) CPTGridLines *majorGridLines; @property (nonatomic, readonly, nullable) CPTAxisSet *axisSet; /// @} @@ -303,8 +304,8 @@ typedef NSMutableArray<__kindof CPTAxis *> *CPTMutableAxisArray; /// @name Ticks /// @{ --(nullable CPTNumberSet)filteredMajorTickLocations:(nullable CPTNumberSet)allLocations; --(nullable CPTNumberSet)filteredMinorTickLocations:(nullable CPTNumberSet)allLocations; +-(nullable CPTNumberSet *)filteredMajorTickLocations:(nullable CPTNumberSet *)allLocations; +-(nullable CPTNumberSet *)filteredMinorTickLocations:(nullable CPTNumberSet *)allLocations; /// @} /// @name Background Bands diff --git a/framework/Source/CPTAxis.m b/framework/Source/CPTAxis.m index 0722e7b24..102318084 100644 --- a/framework/Source/CPTAxis.m +++ b/framework/Source/CPTAxis.m @@ -22,7 +22,7 @@ /** @defgroup axisAnimation Axes * @brief Axis properties that can be animated using Core Animation. * @if MacOnly - * @since Custom layer property animation is supported on MacOS 10.6 and later. + * @since Custom layer property animation is supported on macOS 10.6 and later. * @endif * @ingroup animation **/ @@ -32,22 +32,22 @@ @interface CPTAxis() @property (nonatomic, readwrite, assign) BOOL needsRelabel; -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTGridLines *minorGridLines; -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTGridLines *majorGridLines; -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTAxisLabel *pointingDeviceDownLabel; -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTAxisLabel *pointingDeviceDownTickLabel; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGridLines *minorGridLines; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGridLines *majorGridLines; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTAxisLabel *pointingDeviceDownLabel; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTAxisLabel *pointingDeviceDownTickLabel; @property (nonatomic, readwrite, assign) BOOL labelFormatterChanged; @property (nonatomic, readwrite, assign) BOOL minorLabelFormatterChanged; -@property (nonatomic, readwrite, strong, nullable) CPTMutableLimitBandArray mutableBackgroundLimitBands; +@property (nonatomic, readwrite, strong, nullable) CPTMutableLimitBandArray *mutableBackgroundLimitBands; @property (nonatomic, readonly) CGFloat tickOffset; @property (nonatomic, readwrite, assign) BOOL inTitleUpdate; @property (nonatomic, readwrite, assign) BOOL labelsUpdated; --(void)generateFixedIntervalMajorTickLocations:(CPTNumberSet __nonnull __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet __nonnull __autoreleasing *)newMinorLocations; --(void)autoGenerateMajorTickLocations:(CPTNumberSet __nonnull __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet __nonnull __autoreleasing *)newMinorLocations; --(void)generateEqualMajorTickLocations:(CPTNumberSet __nonnull __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet __nonnull __autoreleasing *)newMinorLocations; --(nullable CPTNumberSet)filteredTickLocations:(nullable CPTNumberSet)allLocations; --(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet)locations inRange:(nullable CPTPlotRange *)labeledRange useMajorAxisLabels:(BOOL)useMajorAxisLabels; +-(void)generateFixedIntervalMajorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMinorLocations; +-(void)autoGenerateMajorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMinorLocations; +-(void)generateEqualMajorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMinorLocations; +-(nullable CPTNumberSet *)filteredTickLocations:(nullable CPTNumberSet *)allLocations; +-(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet *)locations inRange:(nullable CPTPlotRange *)labeledRange useMajorAxisLabels:(BOOL)useMajorAxisLabels; -(void)updateCustomTickLabels; -(void)updateMajorTickLabelOffsets; -(void)updateMinorTickLabelOffsets; @@ -293,12 +293,12 @@ @implementation CPTAxis @synthesize minorLabelFormatterChanged; @dynamic tickOffset; -/** @property nullable CPTAxisLabelSet axisLabels +/** @property nullable CPTAxisLabelSet *axisLabels * @brief The set of axis labels. **/ @synthesize axisLabels; -/** @property nullable CPTAxisLabelSet minorTickAxisLabels +/** @property nullable CPTAxisLabelSet *minorTickAxisLabels * @brief The set of minor tick axis labels. **/ @synthesize minorTickAxisLabels; @@ -308,7 +308,7 @@ @implementation CPTAxis **/ @synthesize needsRelabel; -/** @property nullable CPTPlotRangeArray labelExclusionRanges +/** @property nullable CPTPlotRangeArray *labelExclusionRanges * @brief An array of CPTPlotRange objects. Any tick marks and labels falling inside any of the ranges in the array will not be drawn. **/ @synthesize labelExclusionRanges; @@ -341,7 +341,7 @@ @implementation CPTAxis **/ @synthesize majorTickLength; -/** @property nullable CPTNumberSet majorTickLocations +/** @property nullable CPTNumberSet *majorTickLocations * @brief A set of axis coordinates for all major tick marks. **/ @synthesize majorTickLocations; @@ -372,7 +372,7 @@ @implementation CPTAxis **/ @synthesize minorTickLength; -/** @property nullable CPTNumberSet minorTickLocations +/** @property nullable CPTNumberSet *minorTickLocations * @brief A set of axis coordinates for all minor tick marks. **/ @synthesize minorTickLocations; @@ -401,7 +401,7 @@ @implementation CPTAxis // Background Bands -/** @property nullable CPTFillArray alternatingBandFills +/** @property nullable CPTFillArray *alternatingBandFills * @brief An array of two or more fills to be drawn between successive major tick marks. * * When initializing the fills, provide an NSArray containing any combination of CPTFill, @@ -410,7 +410,16 @@ @implementation CPTAxis **/ @synthesize alternatingBandFills; -/** @property nullable CPTLimitBandArray backgroundLimitBands +/** @property nullable NSNumber *alternatingBandAnchor + * @brief The starting location of the first band fill. + * + * If @nil (the default), the first fill is drawn between the bottom left corner of the plot area + * and the first major tick location inside the plot area. If the anchor falls between two + * major tick locations, the first band fill wiil be drawn between those locations. + **/ +@synthesize alternatingBandAnchor; + +/** @property nullable CPTLimitBandArray *backgroundLimitBands * @brief An array of CPTLimitBand objects. * * The limit bands are drawn on top of the alternating band fills. @@ -429,17 +438,17 @@ @implementation CPTAxis **/ @synthesize separateLayers; -/** @property nullable cpt_weak CPTPlotArea *plotArea +/** @property nullable CPTPlotArea *plotArea * @brief The plot area that the axis belongs to. **/ @synthesize plotArea; -/** @property nullable cpt_weak CPTGridLines *minorGridLines +/** @property nullable CPTGridLines *minorGridLines * @brief The layer that draws the minor grid lines. **/ @synthesize minorGridLines; -/** @property nullable cpt_weak CPTGridLines *majorGridLines +/** @property nullable CPTGridLines *majorGridLines * @brief The layer that draws the major grid lines. **/ @synthesize majorGridLines; @@ -450,13 +459,13 @@ @implementation CPTAxis @dynamic axisSet; /** @internal - * @property nullable cpt_weak CPTAxisLabel *pointingDeviceDownLabel + * @property nullable CPTAxisLabel *pointingDeviceDownLabel * @brief The label that was selected on the pointing device down event. **/ @synthesize pointingDeviceDownLabel; /** @internal - * @property nullable cpt_weak CPTAxisLabel *pointingDeviceDownTickLabel + * @property nullable CPTAxisLabel *pointingDeviceDownTickLabel * @brief The tick label that was selected on the pointing device down event. **/ @synthesize pointingDeviceDownTickLabel; @@ -521,6 +530,7 @@ @implementation CPTAxis * - @ref labelShadow = @nil * - @ref minorTickLabelShadow = @nil * - @ref alternatingBandFills = @nil + * - @ref alternatingBandAnchor = @nil * - @ref minorGridLines = @nil * - @ref majorGridLines = @nil * - @ref needsDisplayOnBoundsChange = @YES @@ -530,7 +540,7 @@ @implementation CPTAxis **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { plotSpace = nil; majorTickLocations = [NSSet set]; minorTickLocations = [NSSet set]; @@ -589,6 +599,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame visibleAxisRange = nil; gridLinesRange = nil; alternatingBandFills = nil; + alternatingBandAnchor = nil; mutableBackgroundLimitBands = nil; minorGridLines = nil; majorGridLines = nil; @@ -608,7 +619,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTAxis *theLayer = (CPTAxis *)layer; plotSpace = theLayer->plotSpace; @@ -662,6 +673,7 @@ -(nonnull instancetype)initWithLayer:(nonnull id)layer visibleAxisRange = theLayer->visibleAxisRange; gridLinesRange = theLayer->gridLinesRange; alternatingBandFills = theLayer->alternatingBandFills; + alternatingBandAnchor = theLayer->alternatingBandAnchor; mutableBackgroundLimitBands = theLayer->mutableBackgroundLimitBands; minorGridLines = theLayer->minorGridLines; majorGridLines = theLayer->majorGridLines; @@ -744,6 +756,7 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder [coder encodeObject:self.visibleAxisRange forKey:@"CPTAxis.visibleAxisRange"]; [coder encodeObject:self.gridLinesRange forKey:@"CPTAxis.gridLinesRange"]; [coder encodeObject:self.alternatingBandFills forKey:@"CPTAxis.alternatingBandFills"]; + [coder encodeObject:self.alternatingBandAnchor forKey:@"CPTAxis.alternatingBandAnchor"]; [coder encodeObject:self.mutableBackgroundLimitBands forKey:@"CPTAxis.mutableBackgroundLimitBands"]; [coder encodeBool:self.separateLayers forKey:@"CPTAxis.separateLayers"]; [coder encodeObject:self.labelShadow forKey:@"CPTAxis.labelShadow"]; @@ -761,11 +774,14 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - coordinate = (CPTCoordinate)[coder decodeIntegerForKey:@"CPTAxis.coordinate"]; - plotSpace = [coder decodeObjectForKey:@"CPTAxis.plotSpace"]; - majorTickLocations = [coder decodeObjectForKey:@"CPTAxis.majorTickLocations"]; - minorTickLocations = [coder decodeObjectForKey:@"CPTAxis.minorTickLocations"]; + if ((self = [super initWithCoder:coder])) { + coordinate = (CPTCoordinate)[coder decodeIntegerForKey:@"CPTAxis.coordinate"]; + plotSpace = [coder decodeObjectOfClass:[CPTPlotSpace class] + forKey:@"CPTAxis.plotSpace"]; + majorTickLocations = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSSet class], [NSNumber class]]] + forKey:@"CPTAxis.majorTickLocations"]; + minorTickLocations = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSSet class], [NSNumber class]]] + forKey:@"CPTAxis.minorTickLocations"]; majorTickLength = [coder decodeCGFloatForKey:@"CPTAxis.majorTickLength"]; minorTickLength = [coder decodeCGFloatForKey:@"CPTAxis.minorTickLength"]; labelOffset = [coder decodeCGFloatForKey:@"CPTAxis.labelOffset"]; @@ -774,51 +790,84 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder minorTickLabelRotation = [coder decodeCGFloatForKey:@"CPTAxis.minorTickLabelRotation"]; labelAlignment = (CPTAlignment)[coder decodeIntegerForKey:@"CPTAxis.labelAlignment"]; minorTickLabelAlignment = (CPTAlignment)[coder decodeIntegerForKey:@"CPTAxis.minorTickLabelAlignment"]; - axisLineStyle = [[coder decodeObjectForKey:@"CPTAxis.axisLineStyle"] copy]; - majorTickLineStyle = [[coder decodeObjectForKey:@"CPTAxis.majorTickLineStyle"] copy]; - minorTickLineStyle = [[coder decodeObjectForKey:@"CPTAxis.minorTickLineStyle"] copy]; + axisLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxis.axisLineStyle"] copy]; + majorTickLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxis.majorTickLineStyle"] copy]; + minorTickLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxis.minorTickLineStyle"] copy]; tickLabelDirection = (CPTSign)[coder decodeIntegerForKey:@"CPTAxis.tickLabelDirection"]; minorTickLabelDirection = (CPTSign)[coder decodeIntegerForKey:@"CPTAxis.minorTickLabelDirection"]; - majorGridLineStyle = [[coder decodeObjectForKey:@"CPTAxis.majorGridLineStyle"] copy]; - minorGridLineStyle = [[coder decodeObjectForKey:@"CPTAxis.minorGridLineStyle"] copy]; - axisLineCapMin = [[coder decodeObjectForKey:@"CPTAxis.axisLineCapMin"] copy]; - axisLineCapMax = [[coder decodeObjectForKey:@"CPTAxis.axisLineCapMax"] copy]; - NSNumber *origin = [coder decodeObjectForKey:@"CPTAxis.labelingOrigin"]; - labelingOrigin = origin ? origin : @0.0; - majorIntervalLength = [coder decodeObjectForKey:@"CPTAxis.majorIntervalLength"]; + majorGridLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxis.majorGridLineStyle"] copy]; + minorGridLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxis.minorGridLineStyle"] copy]; + axisLineCapMin = [[coder decodeObjectOfClass:[CPTLineCap class] + forKey:@"CPTAxis.axisLineCapMin"] copy]; + axisLineCapMax = [[coder decodeObjectOfClass:[CPTLineCap class] + forKey:@"CPTAxis.axisLineCapMax"] copy]; + NSNumber *origin = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTAxis.labelingOrigin"]; + labelingOrigin = origin ? origin : @0.0; + majorIntervalLength = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTAxis.majorIntervalLength"]; minorTicksPerInterval = (NSUInteger)[coder decodeIntegerForKey:@"CPTAxis.minorTicksPerInterval"]; preferredNumberOfMajorTicks = (NSUInteger)[coder decodeIntegerForKey:@"CPTAxis.preferredNumberOfMajorTicks"]; labelingPolicy = (CPTAxisLabelingPolicy)[coder decodeIntegerForKey:@"CPTAxis.labelingPolicy"]; - labelTextStyle = [[coder decodeObjectForKey:@"CPTAxis.labelTextStyle"] copy]; - minorTickLabelTextStyle = [[coder decodeObjectForKey:@"CPTAxis.minorTickLabelTextStyle"] copy]; - titleTextStyle = [[coder decodeObjectForKey:@"CPTAxis.titleTextStyle"] copy]; - labelFormatter = [coder decodeObjectForKey:@"CPTAxis.labelFormatter"]; - minorTickLabelFormatter = [coder decodeObjectForKey:@"CPTAxis.minorTickLabelFormatter"]; - labelFormatterChanged = [coder decodeBoolForKey:@"CPTAxis.labelFormatterChanged"]; - minorLabelFormatterChanged = [coder decodeBoolForKey:@"CPTAxis.minorLabelFormatterChanged"]; - axisLabels = [coder decodeObjectForKey:@"CPTAxis.axisLabels"]; - minorTickAxisLabels = [coder decodeObjectForKey:@"CPTAxis.minorTickAxisLabels"]; - axisTitle = [coder decodeObjectForKey:@"CPTAxis.axisTitle"]; - title = [[coder decodeObjectForKey:@"CPTAxis.title"] copy]; - attributedTitle = [[coder decodeObjectForKey:@"CPTAxis.attributedTitle"] copy]; - titleOffset = [coder decodeCGFloatForKey:@"CPTAxis.titleOffset"]; - titleRotation = [coder decodeCGFloatForKey:@"CPTAxis.titleRotation"]; - titleDirection = (CPTSign)[coder decodeIntegerForKey:@"CPTAxis.titleDirection"]; - titleLocation = [coder decodeObjectForKey:@"CPTAxis.titleLocation"]; - tickDirection = (CPTSign)[coder decodeIntegerForKey:@"CPTAxis.tickDirection"]; - needsRelabel = [coder decodeBoolForKey:@"CPTAxis.needsRelabel"]; - labelExclusionRanges = [coder decodeObjectForKey:@"CPTAxis.labelExclusionRanges"]; - visibleRange = [[coder decodeObjectForKey:@"CPTAxis.visibleRange"] copy]; - visibleAxisRange = [[coder decodeObjectForKey:@"CPTAxis.visibleAxisRange"] copy]; - gridLinesRange = [[coder decodeObjectForKey:@"CPTAxis.gridLinesRange"] copy]; - alternatingBandFills = [[coder decodeObjectForKey:@"CPTAxis.alternatingBandFills"] copy]; - mutableBackgroundLimitBands = [[coder decodeObjectForKey:@"CPTAxis.mutableBackgroundLimitBands"] mutableCopy]; - separateLayers = [coder decodeBoolForKey:@"CPTAxis.separateLayers"]; - labelShadow = [coder decodeObjectForKey:@"CPTAxis.labelShadow"]; - minorTickLabelShadow = [coder decodeObjectForKey:@"CPTAxis.minorTickLabelShadow"]; - plotArea = [coder decodeObjectForKey:@"CPTAxis.plotArea"]; - minorGridLines = [coder decodeObjectForKey:@"CPTAxis.minorGridLines"]; - majorGridLines = [coder decodeObjectForKey:@"CPTAxis.majorGridLines"]; + labelTextStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTAxis.labelTextStyle"] copy]; + minorTickLabelTextStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTAxis.minorTickLabelTextStyle"] copy]; + titleTextStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTAxis.titleTextStyle"] copy]; + labelFormatter = [coder decodeObjectOfClass:[NSFormatter class] + forKey:@"CPTAxis.labelFormatter"]; + minorTickLabelFormatter = [coder decodeObjectOfClass:[NSFormatter class] + forKey:@"CPTAxis.minorTickLabelFormatter"]; + labelFormatterChanged = [coder decodeBoolForKey:@"CPTAxis.labelFormatterChanged"]; + minorLabelFormatterChanged = [coder decodeBoolForKey:@"CPTAxis.minorLabelFormatterChanged"]; + axisLabels = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSSet class], [CPTAxisLabel class]]] + forKey:@"CPTAxis.axisLabels"]; + minorTickAxisLabels = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSSet class], [CPTAxisLabel class]]] + forKey:@"CPTAxis.minorTickAxisLabels"]; + axisTitle = [coder decodeObjectOfClass:[NSString class] + forKey:@"CPTAxis.axisTitle"]; + title = [[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTAxis.title"] copy]; + attributedTitle = [[coder decodeObjectOfClass:[NSAttributedString class] + forKey:@"CPTAxis.attributedTitle"] copy]; + titleOffset = [coder decodeCGFloatForKey:@"CPTAxis.titleOffset"]; + titleRotation = [coder decodeCGFloatForKey:@"CPTAxis.titleRotation"]; + titleDirection = (CPTSign)[coder decodeIntegerForKey:@"CPTAxis.titleDirection"]; + titleLocation = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTAxis.titleLocation"]; + tickDirection = (CPTSign)[coder decodeIntegerForKey:@"CPTAxis.tickDirection"]; + needsRelabel = [coder decodeBoolForKey:@"CPTAxis.needsRelabel"]; + labelExclusionRanges = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTPlotRange class]]] + forKey:@"CPTAxis.labelExclusionRanges"]; + visibleRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTAxis.visibleRange"] copy]; + visibleAxisRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTAxis.visibleAxisRange"] copy]; + gridLinesRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTAxis.gridLinesRange"] copy]; + alternatingBandFills = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTFill class]]] + forKey:@"CPTAxis.alternatingBandFills"] copy]; + alternatingBandAnchor = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTAxis.alternatingBandAnchor"]; + mutableBackgroundLimitBands = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTLimitBand class]]] + forKey:@"CPTAxis.mutableBackgroundLimitBands"] mutableCopy]; + separateLayers = [coder decodeBoolForKey:@"CPTAxis.separateLayers"]; + labelShadow = [coder decodeObjectOfClass:[CPTShadow class] + forKey:@"CPTAxis.labelShadow"]; + minorTickLabelShadow = [coder decodeObjectOfClass:[CPTShadow class] + forKey:@"CPTAxis.minorTickLabelShadow"]; + plotArea = [coder decodeObjectOfClass:[CPTPlotArea class] + forKey:@"CPTAxis.plotArea"]; + minorGridLines = [coder decodeObjectOfClass:[CPTGridLines class] + forKey:@"CPTAxis.minorGridLines"]; + majorGridLines = [coder decodeObjectOfClass:[CPTGridLines class] + forKey:@"CPTAxis.majorGridLines"]; pointingDeviceDownLabel = nil; pointingDeviceDownTickLabel = nil; @@ -831,6 +880,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Animation @@ -871,15 +932,15 @@ +(BOOL)needsDisplayForKey:(nonnull NSString *)aKey * @param newMajorLocations A new NSSet containing the major tick locations. * @param newMinorLocations A new NSSet containing the minor tick locations. */ --(void)generateFixedIntervalMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet __autoreleasing *)newMinorLocations +-(void)generateFixedIntervalMajorTickLocations:(CPTNumberSet *__autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__autoreleasing *)newMinorLocations { - CPTMutableNumberSet majorLocations = [NSMutableSet set]; - CPTMutableNumberSet minorLocations = [NSMutableSet set]; + CPTMutableNumberSet *majorLocations = [NSMutableSet set]; + CPTMutableNumberSet *minorLocations = [NSMutableSet set]; NSDecimal zero = CPTDecimalFromInteger(0); NSDecimal majorInterval = self.majorIntervalLength.decimalValue; - if ( CPTDecimalGreaterThan(majorInterval, zero) ) { + if ( CPTDecimalGreaterThan(majorInterval, zero)) { CPTMutablePlotRange *range = [[self.plotSpace plotRangeForCoordinate:self.coordinate] mutableCopy]; if ( range ) { CPTPlotRange *theVisibleRange = self.visibleRange; @@ -893,7 +954,7 @@ -(void)generateFixedIntervalMajorTickLocations:(CPTNumberSet __autoreleasing *)n NSDecimal minorInterval; NSUInteger minorTickCount = self.minorTicksPerInterval; if ( minorTickCount > 0 ) { - minorInterval = CPTDecimalDivide( majorInterval, CPTDecimalFromUnsignedInteger(minorTickCount + 1) ); + minorInterval = CPTDecimalDivide(majorInterval, CPTDecimalFromUnsignedInteger(minorTickCount + 1)); } else { minorInterval = zero; @@ -910,7 +971,7 @@ -(void)generateFixedIntervalMajorTickLocations:(CPTNumberSet __autoreleasing *)n NSDecimal minorCoord = CPTDecimalSubtract(coord, minorInterval); for ( NSUInteger minorTickIndex = 0; minorTickIndex < minorTickCount; minorTickIndex++ ) { - if ( CPTDecimalLessThan(minorCoord, rangeMin) ) { + if ( CPTDecimalLessThan(minorCoord, rangeMin)) { break; } [minorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:minorCoord]]; @@ -919,7 +980,7 @@ -(void)generateFixedIntervalMajorTickLocations:(CPTNumberSet __autoreleasing *)n } // Set tick locations - while ( CPTDecimalLessThanOrEqualTo(coord, rangeMax) ) { + while ( CPTDecimalLessThanOrEqualTo(coord, rangeMax)) { // Major tick [majorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:coord]]; @@ -928,7 +989,7 @@ -(void)generateFixedIntervalMajorTickLocations:(CPTNumberSet __autoreleasing *)n NSDecimal minorCoord = CPTDecimalAdd(coord, minorInterval); for ( NSUInteger minorTickIndex = 0; minorTickIndex < minorTickCount; minorTickIndex++ ) { - if ( CPTDecimalGreaterThan(minorCoord, rangeMax) ) { + if ( CPTDecimalGreaterThan(minorCoord, rangeMax)) { break; } [minorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:minorCoord]]; @@ -951,11 +1012,11 @@ -(void)generateFixedIntervalMajorTickLocations:(CPTNumberSet __autoreleasing *)n * @param newMajorLocations A new NSSet containing the major tick locations. * @param newMinorLocations A new NSSet containing the minor tick locations. */ --(void)autoGenerateMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet __autoreleasing *)newMinorLocations +-(void)autoGenerateMajorTickLocations:(CPTNumberSet *__autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__autoreleasing *)newMinorLocations { // Create sets for locations - CPTMutableNumberSet majorLocations = [NSMutableSet set]; - CPTMutableNumberSet minorLocations = [NSMutableSet set]; + CPTMutableNumberSet *majorLocations = [NSMutableSet set]; + CPTMutableNumberSet *minorLocations = [NSMutableSet set]; // Get plot range CPTMutablePlotRange *range = [[self.plotSpace plotRangeForCoordinate:self.coordinate] mutableCopy]; @@ -976,7 +1037,7 @@ -(void)autoGenerateMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLo case CPTScaleTypeLog: // supported scale type--check range - if ( (range.minLimitDouble <= 0.0) || (range.maxLimitDouble <= 0.0) ) { + if ((range.minLimitDouble <= 0.0) || (range.maxLimitDouble <= 0.0)) { valid = NO; } break; @@ -1003,7 +1064,7 @@ -(void)autoGenerateMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLo double length = fabs(range.lengthDouble); // Filter troublesome values and return empty sets - if ( length != 0.0 ) { + if ((length != 0.0) && !isinf(length)) { switch ( scaleType ) { case CPTScaleTypeLinear: { @@ -1030,16 +1091,16 @@ -(void)autoGenerateMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLo majorInterval = CPTNiceLength(range.lengthDecimal); } else { - majorInterval = CPTDecimalDivide( range.lengthDecimal, CPTDecimalFromUnsignedInteger(numTicks - 1) ); + majorInterval = CPTDecimalDivide(range.lengthDecimal, CPTDecimalFromUnsignedInteger(numTicks - 1)); majorInterval = CPTNiceNum(majorInterval); } - if ( CPTDecimalLessThan(majorInterval, zero) ) { - majorInterval = CPTDecimalMultiply( majorInterval, CPTDecimalFromInteger(-1) ); + if ( CPTDecimalLessThan(majorInterval, zero)) { + majorInterval = CPTDecimalMultiply(majorInterval, CPTDecimalFromInteger(-1)); } NSDecimal minorInterval; if ( minorTicks > 1 ) { - minorInterval = CPTDecimalDivide( majorInterval, CPTDecimalFromUnsignedInteger(minorTicks) ); + minorInterval = CPTDecimalDivide(majorInterval, CPTDecimalFromUnsignedInteger(minorTicks)); } else { minorInterval = zero; @@ -1057,26 +1118,26 @@ -(void)autoGenerateMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLo NSDecimalRound(&finalIndex, &finalIndex, 0, NSRoundUp); // Iterate through the indexes with visible ticks and build the locations sets - for ( NSDecimal i = initialIndex; CPTDecimalLessThanOrEqualTo(i, finalIndex); i = CPTDecimalAdd(i, one) ) { + for ( NSDecimal i = initialIndex; CPTDecimalLessThanOrEqualTo(i, finalIndex); i = CPTDecimalAdd(i, one)) { NSDecimal pointLocation = CPTDecimalMultiply(majorInterval, i); NSDecimal minorPointLocation = pointLocation; for ( NSUInteger j = 1; j < minorTicks; j++ ) { minorPointLocation = CPTDecimalAdd(minorPointLocation, minorInterval); - if ( CPTDecimalLessThan(minorPointLocation, minLimit) ) { + if ( CPTDecimalLessThan(minorPointLocation, minLimit)) { continue; } - if ( CPTDecimalGreaterThan(minorPointLocation, maxLimit) ) { + if ( CPTDecimalGreaterThan(minorPointLocation, maxLimit)) { continue; } [minorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:minorPointLocation]]; } - if ( CPTDecimalLessThan(pointLocation, minLimit) ) { + if ( CPTDecimalLessThan(pointLocation, minLimit)) { continue; } - if ( CPTDecimalGreaterThan(pointLocation, maxLimit) ) { + if ( CPTDecimalGreaterThan(pointLocation, maxLimit)) { continue; } [majorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:pointLocation]]; @@ -1089,19 +1150,19 @@ -(void)autoGenerateMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLo double minLimit = range.minLimitDouble; double maxLimit = range.maxLimitDouble; - if ( (minLimit > 0.0) && (maxLimit > 0.0) ) { + if ((minLimit > 0.0) && (maxLimit > 0.0)) { // Determine interval value length = log10(maxLimit / minLimit); double interval = signbit(length) ? -1.0 : 1.0; - double intervalStep = pow( 10.0, fabs(interval) ); + double intervalStep = pow(10.0, fabs(interval)); // Determine minor interval - double minorInterval = intervalStep * 0.9 * pow( 10.0, floor( log10(minLimit) ) ) / minorTicks; + double minorInterval = intervalStep * 0.9 * pow(10.0, floor(log10(minLimit))) / minorTicks; // Determine the initial and final major indexes for the actual visible range - NSInteger initialIndex = (NSInteger)lrint( floor( log10( minLimit / fabs(interval) ) ) ); // can be negative - NSInteger finalIndex = (NSInteger)lrint( ceil( log10( maxLimit / fabs(interval) ) ) ); // can be negative + NSInteger initialIndex = (NSInteger)lrint(floor(log10(minLimit / fabs(interval)))); // can be negative + NSInteger finalIndex = (NSInteger)lrint(ceil(log10(maxLimit / fabs(interval)))); // can be negative // Iterate through the indexes with visible ticks and build the locations sets for ( NSInteger i = initialIndex; i <= finalIndex; i++ ) { @@ -1139,14 +1200,14 @@ -(void)autoGenerateMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLo double modMinLimit = CPTLogModulus(minLimit); double modMaxLimit = CPTLogModulus(maxLimit); - double multiplier = pow( 10.0, floor( log10(length) ) ); + double multiplier = pow(10.0, floor(log10(length))); multiplier = (multiplier < 1.0) ? multiplier : 1.0; double intervalStep = 10.0; // Determine the initial and final major indexes for the actual visible range - NSInteger initialIndex = (NSInteger)lrint( floor(modMinLimit / multiplier) ); // can be negative - NSInteger finalIndex = (NSInteger)lrint( ceil(modMaxLimit / multiplier) ); // can be negative + NSInteger initialIndex = (NSInteger)lrint(floor(modMinLimit / multiplier)); // can be negative + NSInteger finalIndex = (NSInteger)lrint(ceil(modMaxLimit / multiplier)); // can be negative if ( initialIndex < 0 ) { // Determine minor interval @@ -1157,10 +1218,10 @@ -(void)autoGenerateMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLo double sign = -multiplier; if ( multiplier < 1.0 ) { - pointLocation = sign * pow(10.0, fabs( (double)i ) - 1.0); + pointLocation = sign * pow(10.0, fabs((double)i) - 1.0); } else { - pointLocation = sign * pow( 10.0, fabs( (double)i ) ); + pointLocation = sign * pow(10.0, fabs((double)i)); } for ( NSUInteger j = 1; j < minorTicks; j++ ) { @@ -1197,10 +1258,10 @@ -(void)autoGenerateMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLo double sign = multiplier; if ( multiplier < 1.0 ) { - pointLocation = sign * pow(10.0, fabs( (double)i ) - 1.0); + pointLocation = sign * pow(10.0, fabs((double)i) - 1.0); } else { - pointLocation = sign * pow( 10.0, fabs( (double)i ) ); + pointLocation = sign * pow(10.0, fabs((double)i)); } for ( NSUInteger j = 1; j < minorTicks; j++ ) { @@ -1246,10 +1307,10 @@ -(void)autoGenerateMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLo * @param newMajorLocations A new NSSet containing the major tick locations. * @param newMinorLocations A new NSSet containing the minor tick locations. */ --(void)generateEqualMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet __autoreleasing *)newMinorLocations +-(void)generateEqualMajorTickLocations:(CPTNumberSet *__autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__autoreleasing *)newMinorLocations { - CPTMutableNumberSet majorLocations = [NSMutableSet set]; - CPTMutableNumberSet minorLocations = [NSMutableSet set]; + CPTMutableNumberSet *majorLocations = [NSMutableSet set]; + CPTMutableNumberSet *minorLocations = [NSMutableSet set]; CPTMutablePlotRange *range = [[self.plotSpace plotRangeForCoordinate:self.coordinate] mutableCopy]; @@ -1269,15 +1330,15 @@ -(void)generateEqualMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorL if ( majorTickCount < 2 ) { majorTickCount = 2; } - NSDecimal majorInterval = CPTDecimalDivide( range.lengthDecimal, CPTDecimalFromUnsignedInteger(majorTickCount - 1) ); - if ( CPTDecimalLessThan(majorInterval, zero) ) { - majorInterval = CPTDecimalMultiply( majorInterval, CPTDecimalFromInteger(-1) ); + NSDecimal majorInterval = CPTDecimalDivide(range.lengthDecimal, CPTDecimalFromUnsignedInteger(majorTickCount - 1)); + if ( CPTDecimalLessThan(majorInterval, zero)) { + majorInterval = CPTDecimalMultiply(majorInterval, CPTDecimalFromInteger(-1)); } NSDecimal minorInterval; NSUInteger minorTickCount = self.minorTicksPerInterval; if ( minorTickCount > 0 ) { - minorInterval = CPTDecimalDivide( majorInterval, CPTDecimalFromUnsignedInteger(minorTickCount + 1) ); + minorInterval = CPTDecimalDivide(majorInterval, CPTDecimalFromUnsignedInteger(minorTickCount + 1)); } else { minorInterval = zero; @@ -1286,7 +1347,7 @@ -(void)generateEqualMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorL NSDecimal coord = rangeMin; // Set tick locations - while ( CPTDecimalLessThanOrEqualTo(coord, rangeMax) ) { + while ( CPTDecimalLessThanOrEqualTo(coord, rangeMax)) { // Major tick [majorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:coord]]; @@ -1295,7 +1356,7 @@ -(void)generateEqualMajorTickLocations:(CPTNumberSet __autoreleasing *)newMajorL NSDecimal minorCoord = CPTDecimalAdd(coord, minorInterval); for ( NSUInteger minorTickIndex = 0; minorTickIndex < minorTickCount; minorTickIndex++ ) { - if ( CPTDecimalGreaterThan(minorCoord, rangeMax) ) { + if ( CPTDecimalGreaterThan(minorCoord, rangeMax)) { break; } [minorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:minorCoord]]; @@ -1321,7 +1382,7 @@ NSDecimal CPTNiceNum(NSDecimal x) { NSDecimal zero = CPTDecimalFromInteger(0); - if ( CPTDecimalEquals(x, zero) ) { + if ( CPTDecimalEquals(x, zero)) { return zero; } @@ -1332,20 +1393,20 @@ NSDecimal CPTNiceNum(NSDecimal x) x = CPTDecimalMultiply(x, minusOne); } - short exponent = (short)lrint( floor( log10( CPTDecimalDoubleValue(x) ) ) ); + short exponent = (short)lrint(floor(log10(CPTDecimalDoubleValue(x)))); NSDecimal fractionPart; NSDecimalMultiplyByPowerOf10(&fractionPart, &x, -exponent, NSRoundPlain); NSDecimal roundedFraction; - if ( CPTDecimalLessThan( fractionPart, CPTDecimalFromDouble(1.5) ) ) { + if ( CPTDecimalLessThan(fractionPart, CPTDecimalFromDouble(1.5))) { roundedFraction = CPTDecimalFromInteger(1); } - else if ( CPTDecimalLessThan( fractionPart, CPTDecimalFromInteger(3) ) ) { + else if ( CPTDecimalLessThan(fractionPart, CPTDecimalFromInteger(3))) { roundedFraction = CPTDecimalFromInteger(2); } - else if ( CPTDecimalLessThan( fractionPart, CPTDecimalFromInteger(7) ) ) { + else if ( CPTDecimalLessThan(fractionPart, CPTDecimalFromInteger(7))) { roundedFraction = CPTDecimalFromInteger(5); } else { @@ -1365,13 +1426,13 @@ NSDecimal CPTNiceNum(NSDecimal x) /** * @internal * @brief Determines a @quote{nice} range length (a multiple of @num{2}, @num{5}, or @num{10}) less than or equal to the given length. - * @param x The length to round. + * @param length The length to round. */ NSDecimal CPTNiceLength(NSDecimal length) { NSDecimal zero = CPTDecimalFromInteger(0); - if ( CPTDecimalEquals(length, zero) ) { + if ( CPTDecimalEquals(length, zero)) { return zero; } @@ -1384,11 +1445,11 @@ NSDecimal CPTNiceLength(NSDecimal length) NSDecimal roundedNumber; - if ( CPTDecimalGreaterThan( length, CPTDecimalFromInteger(10) ) ) { + if ( CPTDecimalGreaterThan(length, CPTDecimalFromInteger(10))) { NSDecimalRound(&roundedNumber, &length, 0, NSRoundDown); } else { - short exponent = (short)lrint( floor( log10( CPTDecimalDoubleValue(length) ) ) ) - 1; + short exponent = (short)lrint(floor(log10(CPTDecimalDoubleValue(length)))) - 1; NSDecimalRound(&roundedNumber, &length, -exponent, NSRoundDown); } @@ -1405,12 +1466,12 @@ NSDecimal CPTNiceLength(NSDecimal length) * @param allLocations A set of tick locations. * @return The filtered set of tick locations. */ --(nullable CPTNumberSet)filteredTickLocations:(nullable CPTNumberSet)allLocations +-(nullable CPTNumberSet *)filteredTickLocations:(nullable CPTNumberSet *)allLocations { - CPTPlotRangeArray exclusionRanges = self.labelExclusionRanges; + CPTPlotRangeArray *exclusionRanges = self.labelExclusionRanges; if ( exclusionRanges ) { - CPTMutableNumberSet filteredLocations = [allLocations mutableCopy]; + CPTMutableNumberSet *filteredLocations = [allLocations mutableCopy]; for ( CPTPlotRange *range in exclusionRanges ) { for ( NSNumber *location in allLocations ) { if ( [range containsNumber:location] ) { @@ -1431,7 +1492,7 @@ -(nullable CPTNumberSet)filteredTickLocations:(nullable CPTNumberSet)allLocation * @param allLocations A set of major tick locations. * @return The filtered set. **/ --(nullable CPTNumberSet)filteredMajorTickLocations:(nullable CPTNumberSet)allLocations +-(nullable CPTNumberSet *)filteredMajorTickLocations:(nullable CPTNumberSet *)allLocations { return [self filteredTickLocations:allLocations]; } @@ -1440,7 +1501,7 @@ -(nullable CPTNumberSet)filteredMajorTickLocations:(nullable CPTNumberSet)allLoc * @param allLocations A set of minor tick locations. * @return The filtered set. **/ --(nullable CPTNumberSet)filteredMinorTickLocations:(nullable CPTNumberSet)allLocations +-(nullable CPTNumberSet *)filteredMinorTickLocations:(nullable CPTNumberSet *)allLocations { return [self filteredTickLocations:allLocations]; } @@ -1476,7 +1537,7 @@ -(CGFloat)tickOffset * @param labeledRange A plot range used to filter the generated labels. If @nil, no filtering is done. * @param useMajorAxisLabels If @YES, label the major ticks, otherwise label the minor ticks. **/ --(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet)locations inRange:(nullable CPTPlotRange *)labeledRange useMajorAxisLabels:(BOOL)useMajorAxisLabels +-(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet *)locations inRange:(nullable CPTPlotRange *)labeledRange useMajorAxisLabels:(BOOL)useMajorAxisLabels { CPTAlignment theLabelAlignment; CPTSign theLabelDirection; @@ -1487,13 +1548,13 @@ -(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet)locations inRange:(nul BOOL theLabelFormatterChanged; CPTShadow *theShadow; - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( useMajorAxisLabels ) { if ( locations.count > 0 ) { if ( [theDelegate respondsToSelector:@selector(axis:shouldUpdateAxisLabelsAtLocations:)] ) { - CPTNumberSet locationSet = locations; - BOOL shouldContinue = [theDelegate axis:self shouldUpdateAxisLabelsAtLocations:locationSet]; + CPTNumberSet *locationSet = locations; + BOOL shouldContinue = [theDelegate axis:self shouldUpdateAxisLabelsAtLocations:locationSet]; if ( !shouldContinue ) { return; } @@ -1511,8 +1572,8 @@ -(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet)locations inRange:(nul else { if ( locations.count > 0 ) { if ( [theDelegate respondsToSelector:@selector(axis:shouldUpdateMinorAxisLabelsAtLocations:)] ) { - CPTNumberSet locationSet = locations; - BOOL shouldContinue = [theDelegate axis:self shouldUpdateMinorAxisLabelsAtLocations:locationSet]; + CPTNumberSet *locationSet = locations; + BOOL shouldContinue = [theDelegate axis:self shouldUpdateMinorAxisLabelsAtLocations:locationSet]; if ( !shouldContinue ) { return; } @@ -1528,7 +1589,7 @@ -(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet)locations inRange:(nul theShadow = self.minorTickLabelShadow; } - if ( (locations.count == 0) || !theLabelTextStyle || !theLabelFormatter ) { + if ((locations.count == 0) || !theLabelTextStyle || !theLabelFormatter ) { if ( useMajorAxisLabels ) { self.axisLabels = nil; } @@ -1538,9 +1599,9 @@ -(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet)locations inRange:(nul return; } - CPTDictionary textAttributes = theLabelTextStyle.attributes; - BOOL hasAttributedFormatter = ([theLabelFormatter attributedStringForObjectValue:[NSDecimalNumber zero] - withDefaultAttributes:textAttributes] != nil); + CPTDictionary *textAttributes = theLabelTextStyle.attributes; + BOOL hasAttributedFormatter = ([theLabelFormatter attributedStringForObjectValue:[NSDecimalNumber zero] + withDefaultAttributes:textAttributes] != nil); CPTPlotSpace *thePlotSpace = self.plotSpace; CPTCoordinate myCoordinate = self.coordinate; @@ -1552,14 +1613,14 @@ -(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet)locations inRange:(nul theLabelDirection = direction; } - if ( (direction == CPTSignNone) || (theLabelDirection == direction) ) { + if ((direction == CPTSignNone) || (theLabelDirection == direction)) { theLabelOffset += self.tickOffset; } CPTPlotArea *thePlotArea = self.plotArea; [thePlotArea setAxisSetLayersForType:CPTGraphLayerTypeAxisLabels]; - CPTMutableAxisLabelSet oldAxisLabels; + CPTMutableAxisLabelSet *oldAxisLabels; if ( useMajorAxisLabels ) { oldAxisLabels = [self.axisLabels mutableCopy]; } @@ -1567,10 +1628,10 @@ -(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet)locations inRange:(nul oldAxisLabels = [self.minorTickAxisLabels mutableCopy]; } - CPTMutableAxisLabelSet newAxisLabels = [[NSMutableSet alloc] initWithCapacity:locations.count]; - CPTAxisLabel *blankLabel = [[CPTAxisLabel alloc] initWithText:nil textStyle:nil]; - CPTAxisLabelGroup *axisLabelGroup = thePlotArea.axisLabelGroup; - CPTLayer *lastLayer = nil; + CPTMutableAxisLabelSet *newAxisLabels = [[NSMutableSet alloc] initWithCapacity:locations.count]; + CPTAxisLabel *blankLabel = [[CPTAxisLabel alloc] initWithText:nil textStyle:nil]; + CPTAxisLabelGroup *axisLabelGroup = thePlotArea.axisLabelGroup; + CPTLayer *lastLayer = nil; for ( NSDecimalNumber *tickLocation in locations ) { if ( labeledRange && ![labeledRange containsNumber:tickLocation] ) { @@ -1671,14 +1732,14 @@ -(void)relabel if ( !self.plotSpace ) { return; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(axisShouldRelabel:)] && ![theDelegate axisShouldRelabel:self] ) { self.needsRelabel = NO; return; } - CPTNumberSet newMajorLocations = nil; - CPTNumberSet newMinorLocations = nil; + CPTNumberSet *newMajorLocations = nil; + CPTNumberSet *newMinorLocations = nil; switch ( self.labelingPolicy ) { case CPTAxisLabelingPolicyNone: @@ -1775,7 +1836,12 @@ -(void)updateCustomTickLabels if ( range.lengthDouble != 0.0 ) { CPTCoordinate orthogonalCoordinate = CPTOrthogonalCoordinate(self.coordinate); - CPTSign direction = self.tickDirection; + + CPTSign direction = self.tickLabelDirection; + + if ( direction == CPTSignNone ) { + direction = self.tickDirection; + } for ( CPTAxisLabel *label in self.axisLabels ) { BOOL visible = [range containsNumber:label.tickLocation]; @@ -1809,7 +1875,7 @@ -(void)updateMajorTickLabelOffsets CGFloat majorOffset = self.labelOffset; - if ( (direction == CPTSignNone) || (labelDirection == direction) ) { + if ((direction == CPTSignNone) || (labelDirection == direction)) { majorOffset += self.tickOffset; } @@ -1829,7 +1895,7 @@ -(void)updateMinorTickLabelOffsets CGFloat minorOffset = self.minorTickLabelOffset; - if ( (direction == CPTSignNone) || (labelDirection == direction) ) { + if ((direction == CPTSignNone) || (labelDirection == direction)) { minorOffset += self.tickOffset; } @@ -2011,7 +2077,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; // Tick labels if ( [theDelegate respondsToSelector:@selector(axis:labelTouchDown:)] || @@ -2023,7 +2089,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) if ( contentLayer && !contentLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:contentLayer]; - if ( CGRectContainsPoint(contentLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(contentLayer.bounds, labelPoint)) { self.pointingDeviceDownLabel = label; BOOL handled = NO; @@ -2055,7 +2121,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) if ( contentLayer && !contentLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:contentLayer]; - if ( CGRectContainsPoint(contentLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(contentLayer.bounds, labelPoint)) { self.pointingDeviceDownTickLabel = label; BOOL handled = NO; @@ -2122,7 +2188,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; // Tick labels if ( [theDelegate respondsToSelector:@selector(axis:labelTouchUp:)] || @@ -2134,7 +2200,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in if ( contentLayer && !contentLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:contentLayer]; - if ( CGRectContainsPoint(contentLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(contentLayer.bounds, labelPoint)) { BOOL handled = NO; if ( [theDelegate respondsToSelector:@selector(axis:labelTouchUp:)] ) { @@ -2177,7 +2243,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in if ( contentLayer && !contentLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:contentLayer]; - if ( CGRectContainsPoint(contentLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(contentLayer.bounds, labelPoint)) { BOOL handled = NO; if ( [theDelegate respondsToSelector:@selector(axis:minorTickTouchUp:)] ) { @@ -2220,7 +2286,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in /// @cond --(void)setAxisLabels:(nullable CPTAxisLabelSet)newLabels +-(void)setAxisLabels:(nullable CPTAxisLabelSet *)newLabels { if ( newLabels != axisLabels ) { if ( self.labelsUpdated ) { @@ -2256,11 +2322,16 @@ -(void)setAxisLabels:(nullable CPTAxisLabelSet)newLabels } } - [self updateMajorTickLabels]; + if ( self.labelingPolicy == CPTAxisLabelingPolicyNone ) { + [self updateCustomTickLabels]; + } + else { + [self updateMajorTickLabels]; + } } } --(void)setMinorTickAxisLabels:(nullable CPTAxisLabelSet)newLabels +-(void)setMinorTickAxisLabels:(nullable CPTAxisLabelSet *)newLabels { if ( newLabels != minorTickAxisLabels ) { if ( self.labelsUpdated ) { @@ -2296,7 +2367,12 @@ -(void)setMinorTickAxisLabels:(nullable CPTAxisLabelSet)newLabels } } - [self updateMinorTickLabels]; + if ( self.labelingPolicy == CPTAxisLabelingPolicyNone ) { + [self updateCustomTickLabels]; + } + else { + [self updateMinorTickLabels]; + } } } @@ -2309,7 +2385,7 @@ -(void)setLabelTextStyle:(nullable CPTTextStyle *)newStyle for ( CPTAxisLabel *axisLabel in self.axisLabels ) { CPTLayer *contentLayer = axisLabel.contentLayer; if ( [contentLayer isKindOfClass:textLayerClass] ) { - ( (CPTTextLayer *)contentLayer ).textStyle = labelTextStyle; + ((CPTTextLayer *)contentLayer).textStyle = labelTextStyle; } } @@ -2326,7 +2402,7 @@ -(void)setMinorTickLabelTextStyle:(nullable CPTTextStyle *)newStyle for ( CPTAxisLabel *axisLabel in self.minorTickAxisLabels ) { CPTLayer *contentLayer = axisLabel.contentLayer; if ( [contentLayer isKindOfClass:textLayerClass] ) { - ( (CPTTextLayer *)contentLayer ).textStyle = minorTickLabelTextStyle; + ((CPTTextLayer *)contentLayer).textStyle = minorTickLabelTextStyle; } } @@ -2387,7 +2463,7 @@ -(void)setTitleTextStyle:(nullable CPTTextStyle *)newStyle CPTLayer *contentLayer = self.axisTitle.contentLayer; if ( [contentLayer isKindOfClass:[CPTTextLayer class]] ) { - ( (CPTTextLayer *)contentLayer ).textStyle = titleTextStyle; + ((CPTTextLayer *)contentLayer).textStyle = titleTextStyle; [self updateAxisTitle]; } } @@ -2436,7 +2512,7 @@ -(void)setTitle:(nullable NSString *)newTitle if ( title ) { CPTLayer *contentLayer = self.axisTitle.contentLayer; if ( [contentLayer isKindOfClass:[CPTTextLayer class]] ) { - ( (CPTTextLayer *)contentLayer ).text = title; + ((CPTTextLayer *)contentLayer).text = title; [self updateAxisTitle]; } } @@ -2462,7 +2538,7 @@ -(void)setAttributedTitle:(nullable NSAttributedString *)newTitle CPTLayer *contentLayer = self.axisTitle.contentLayer; if ( [contentLayer isKindOfClass:[CPTTextLayer class]] ) { - ( (CPTTextLayer *)contentLayer ).attributedText = attributedTitle; + ((CPTTextLayer *)contentLayer).attributedText = attributedTitle; [self updateAxisTitle]; } } @@ -2495,7 +2571,7 @@ -(void)setTitleLocation:(nullable NSNumber *)newLocation -(nullable NSNumber *)titleLocation { - if ( isnan(titleLocation.doubleValue) ) { + if ( isnan(titleLocation.doubleValue)) { return self.defaultTitleLocation; } else { @@ -2503,7 +2579,7 @@ -(nullable NSNumber *)titleLocation } } --(void)setLabelExclusionRanges:(nullable CPTPlotRangeArray)ranges +-(void)setLabelExclusionRanges:(nullable CPTPlotRangeArray *)ranges { if ( ranges != labelExclusionRanges ) { labelExclusionRanges = ranges; @@ -2533,7 +2609,7 @@ -(void)setNeedsRelabel:(BOOL)newNeedsRelabel } } --(void)setMajorTickLocations:(nullable CPTNumberSet)newLocations +-(void)setMajorTickLocations:(nullable CPTNumberSet *)newLocations { if ( newLocations != majorTickLocations ) { majorTickLocations = newLocations; @@ -2550,7 +2626,7 @@ -(void)setMajorTickLocations:(nullable CPTNumberSet)newLocations } } --(void)setMinorTickLocations:(nullable CPTNumberSet)newLocations +-(void)setMinorTickLocations:(nullable CPTNumberSet *)newLocations { if ( newLocations != minorTickLocations ) { minorTickLocations = newLocations; @@ -2994,6 +3070,9 @@ -(void)setPlotArea:(nullable CPTPlotArea *)newPlotArea for ( CPTAxisLabel *label in self.axisLabels ) { [label.contentLayer removeFromSuperlayer]; } + for ( CPTAxisLabel *label in self.minorTickAxisLabels ) { + [label.contentLayer removeFromSuperlayer]; + } [self.axisTitle.contentLayer removeFromSuperlayer]; } } @@ -3083,7 +3162,7 @@ -(void)setMajorGridLines:(nullable CPTGridLines *)newGridLines } } --(void)setAlternatingBandFills:(nullable CPTFillArray)newFills +-(void)setAlternatingBandFills:(nullable CPTFillArray *)newFills { if ( newFills != alternatingBandFills ) { Class nullClass = [NSNull class]; @@ -3105,9 +3184,9 @@ -(void)setAlternatingBandFills:(nullable CPTFillArray)newFills Class gradientClass = [CPTGradient class]; Class imageClass = [CPTImage class]; - CPTMutableFillArray fillArray = [newFills mutableCopy]; - NSUInteger i = 0; - CPTFill *newFill = nil; + CPTMutableFillArray *fillArray = [newFills mutableCopy]; + NSUInteger i = 0; + CPTFill *newFill = nil; for ( id obj in newFills ) { if ( [obj isKindOfClass:nullClass] || [obj isKindOfClass:fillClass] ) { @@ -3143,7 +3222,17 @@ -(void)setAlternatingBandFills:(nullable CPTFillArray)newFills } } --(nullable CPTLimitBandArray)backgroundLimitBands +-(void)setAlternatingBandAnchor:(nullable NSNumber *)newBandAnchor +{ + if ( newBandAnchor != alternatingBandAnchor ) { + alternatingBandAnchor = newBandAnchor; + + CPTPlotArea *thePlotArea = self.plotArea; + [thePlotArea setNeedsDisplay]; + } +} + +-(nullable CPTLimitBandArray *)backgroundLimitBands { return [self.mutableBackgroundLimitBands copy]; } @@ -3175,7 +3264,7 @@ @implementation CPTAxis(AbstractMethods) * @param coordinateValue The axis value in data coordinate space. * @return The drawing coordinates of the point. **/ --(CGPoint)viewPointForCoordinateValue:(nullable NSNumber *)coordinateValue +-(CGPoint)viewPointForCoordinateValue:(nullable NSNumber *__unused)coordinateValue { return CGPointZero; } @@ -3184,7 +3273,7 @@ -(CGPoint)viewPointForCoordinateValue:(nullable NSNumber *)coordinateValue * @param context The graphics context to draw into. * @param major Draw the major grid lines If @YES, minor grid lines otherwise. **/ --(void)drawGridLinesInContext:(nonnull CGContextRef)context isMajor:(BOOL)major +-(void)drawGridLinesInContext:(nonnull CGContextRef __unused)context isMajor:(BOOL __unused)major { // do nothing--subclasses must override to do their drawing } @@ -3192,7 +3281,7 @@ -(void)drawGridLinesInContext:(nonnull CGContextRef)context isMajor:(BOOL)major /** @brief Draws alternating background bands into the provided graphics context. * @param context The graphics context to draw into. **/ --(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context +-(void)drawBackgroundBandsInContext:(nonnull CGContextRef __unused)context { // do nothing--subclasses must override to do their drawing } @@ -3200,7 +3289,7 @@ -(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context /** @brief Draws background limit ranges into the provided graphics context. * @param context The graphics context to draw into. **/ --(void)drawBackgroundLimitsInContext:(nonnull CGContextRef)context +-(void)drawBackgroundLimitsInContext:(nonnull CGContextRef __unused)context { // do nothing--subclasses must override to do their drawing } diff --git a/framework/Source/CPTAxisLabel.h b/framework/Source/CPTAxisLabel.h index e014311cd..b78d2ebd9 100644 --- a/framework/Source/CPTAxisLabel.h +++ b/framework/Source/CPTAxisLabel.h @@ -9,14 +9,14 @@ /** * @brief A set of CPTAxisLabel objects. **/ -typedef NSSet *CPTAxisLabelSet; +typedef NSSet CPTAxisLabelSet; /** * @brief A mutable set of CPTAxisLabel objects. **/ -typedef NSMutableSet *CPTMutableAxisLabelSet; +typedef NSMutableSet CPTMutableAxisLabelSet; -@interface CPTAxisLabel : NSObject +@interface CPTAxisLabel : NSObject @property (nonatomic, readwrite, strong, nullable) CPTLayer *contentLayer; @property (nonatomic, readwrite, assign) CGFloat offset; diff --git a/framework/Source/CPTAxisLabel.m b/framework/Source/CPTAxisLabel.m index 5b64b28c3..2f9f23f5e 100644 --- a/framework/Source/CPTAxisLabel.m +++ b/framework/Source/CPTAxisLabel.m @@ -63,7 +63,7 @@ -(nonnull instancetype)initWithText:(nullable NSString *)newText textStyle:(null **/ -(nonnull instancetype)initWithContentLayer:(nonnull CPTLayer *)layer { - if ( (self = [super init]) ) { + if ((self = [super init])) { contentLayer = layer; offset = CPTFloat(20.0); rotation = CPTFloat(0.0); @@ -105,17 +105,31 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - contentLayer = [coder decodeObjectForKey:@"CPTAxisLabel.contentLayer"]; - offset = [coder decodeCGFloatForKey:@"CPTAxisLabel.offset"]; - rotation = [coder decodeCGFloatForKey:@"CPTAxisLabel.rotation"]; - alignment = (CPTAlignment)[coder decodeIntegerForKey:@"CPTAxisLabel.alignment"]; - NSNumber *location = [coder decodeObjectForKey:@"CPTAxisLabel.tickLocation"]; + if ((self = [super init])) { + contentLayer = [coder decodeObjectOfClass:[CPTLayer class] + forKey:@"CPTAxisLabel.contentLayer"]; + offset = [coder decodeCGFloatForKey:@"CPTAxisLabel.offset"]; + rotation = [coder decodeCGFloatForKey:@"CPTAxisLabel.rotation"]; + alignment = (CPTAlignment)[coder decodeIntegerForKey:@"CPTAxisLabel.alignment"]; + NSNumber *location = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTAxisLabel.tickLocation"]; tickLocation = location ? location : @0.0; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Layout @@ -137,14 +151,14 @@ -(void)positionRelativeToViewPoint:(CGPoint)point forCoordinate:(CPTCoordinate)c } CGPoint newPosition = point; - CGFloat *value = ( coordinate == CPTCoordinateX ? &(newPosition.x) : &(newPosition.y) ); + CGFloat *value = (coordinate == CPTCoordinateX ? &(newPosition.x) : &(newPosition.y)); CGFloat angle = CPTFloat(0.0); CGFloat labelRotation = self.rotation; - if ( isnan(labelRotation) ) { - labelRotation = ( coordinate == CPTCoordinateX ? CPTFloat(M_PI_2) : CPTFloat(0.0) ); + if ( isnan(labelRotation)) { + labelRotation = (coordinate == CPTCoordinateX ? CPTFloat(M_PI_2) : CPTFloat(0.0)); } - content.transform = CATransform3DMakeRotation( labelRotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0) ); + content.transform = CATransform3DMakeRotation(labelRotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0)); CGRect contentFrame = content.frame; // Position the anchor point along the closest edge. @@ -258,7 +272,7 @@ -(void)positionRelativeToViewPoint:(CGPoint)point forCoordinate:(CPTCoordinate)c CGFloat newAnchorX = cos(angle); CGFloat newAnchorY = sin(angle); - if ( ABS(newAnchorX) <= ABS(newAnchorY) ) { + if ( ABS(newAnchorX) <= ABS(newAnchorY)) { newAnchorX /= ABS(newAnchorY); newAnchorY = signbit(newAnchorY) ? CPTFloat(-1.0) : CPTFloat(1.0); } @@ -266,7 +280,7 @@ -(void)positionRelativeToViewPoint:(CGPoint)point forCoordinate:(CPTCoordinate)c newAnchorY /= ABS(newAnchorX); newAnchorX = signbit(newAnchorX) ? CPTFloat(-1.0) : CPTFloat(1.0); } - CGPoint anchor = CPTPointMake( ( newAnchorX + CPTFloat(1.0) ) / CPTFloat(2.0), ( newAnchorY + CPTFloat(1.0) ) / CPTFloat(2.0) ); + CGPoint anchor = CPTPointMake((newAnchorX + CPTFloat(1.0)) / CPTFloat(2.0), (newAnchorY + CPTFloat(1.0)) / CPTFloat(2.0)); content.anchorPoint = anchor; content.position = newPosition; @@ -281,7 +295,7 @@ -(void)positionRelativeToViewPoint:(CGPoint)point forCoordinate:(CPTCoordinate)c **/ -(void)positionBetweenViewPoint:(CGPoint)firstPoint andViewPoint:(CGPoint)secondPoint forCoordinate:(CPTCoordinate)coordinate inDirection:(CPTSign)direction { - [self positionRelativeToViewPoint:CPTPointMake( (firstPoint.x + secondPoint.x) / CPTFloat(2.0), (firstPoint.y + secondPoint.y) / CPTFloat(2.0) ) + [self positionRelativeToViewPoint:CPTPointMake((firstPoint.x + secondPoint.x) / CPTFloat(2.0), (firstPoint.y + secondPoint.y) / CPTFloat(2.0)) forCoordinate:coordinate inDirection:direction]; } @@ -315,7 +329,7 @@ -(BOOL)isEqual:(nullable id)object return YES; } else if ( [object isKindOfClass:[self class]] ) { - NSNumber *location = ( (CPTAxisLabel *)object ).tickLocation; + NSNumber *location = ((CPTAxisLabel *)object).tickLocation; if ( location ) { return [self.tickLocation isEqualToNumber:location]; @@ -340,8 +354,8 @@ -(NSUInteger)hash // Equal objects must hash the same. double tickLocationAsDouble = self.tickLocation.doubleValue; - if ( !isnan(tickLocationAsDouble) ) { - hashValue = (NSUInteger)lrint( fmod(ABS(tickLocationAsDouble), (double)NSUIntegerMax) ); + if ( !isnan(tickLocationAsDouble)) { + hashValue = (NSUInteger)lrint(fmod(ABS(tickLocationAsDouble), (double)NSUIntegerMax)); } return hashValue; diff --git a/framework/Source/CPTAxisLabelGroup.m b/framework/Source/CPTAxisLabelGroup.m index 174f90bed..1693c7a78 100644 --- a/framework/Source/CPTAxisLabelGroup.m +++ b/framework/Source/CPTAxisLabelGroup.m @@ -15,7 +15,7 @@ -(void)display // nothing to draw } --(void)renderAsVectorInContext:(nonnull CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef __unused)context { // nothing to draw } diff --git a/framework/Source/CPTAxisLabelTests.m b/framework/Source/CPTAxisLabelTests.m index 22bf84e9a..ff3248137 100644 --- a/framework/Source/CPTAxisLabelTests.m +++ b/framework/Source/CPTAxisLabelTests.m @@ -6,7 +6,7 @@ #import "CPTUtilities.h" #import -static const double precision = 1.0e-6; +static const CGFloat precision = CPTFloat(1.0e-6); @implementation CPTAxisLabelTests @@ -19,8 +19,8 @@ static CGPoint roundPoint(CGPoint position, CGSize contentSize, CGPoint anchor) CGPoint newAnchor = CGPointMake(contentSize.width * anchor.x, contentSize.height * anchor.y); - newPosition.x = ceil( position.x - newAnchor.x - CPTFloat(0.5) ) + newAnchor.x; - newPosition.y = ceil( position.y - newAnchor.y - CPTFloat(0.5) ) + newAnchor.y; + newPosition.x = ceil(position.x - newAnchor.x - CPTFloat(0.5)) + newAnchor.x; + newPosition.y = ceil(position.y - newAnchor.y - CPTFloat(0.5)) + newAnchor.y; return newPosition; } @@ -32,7 +32,12 @@ -(void)testPositionRelativeToViewPointRaisesForInvalidDirection @try { label = [[CPTAxisLabel alloc] initWithText:@"CPTAxisLabelTests-testPositionRelativeToViewPointRaisesForInvalidDirection" textStyle:[CPTTextStyle textStyle]]; - XCTAssertThrowsSpecificNamed([label positionRelativeToViewPoint:CGPointZero forCoordinate:CPTCoordinateX inDirection:INT_MAX], NSException, NSInvalidArgumentException, @"Should raise NSInvalidArgumentException for invalid direction (type CPTSign)"); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wassign-enum" + + XCTAssertThrowsSpecificNamed([label positionRelativeToViewPoint:CGPointZero forCoordinate:CPTCoordinateX inDirection:NSIntegerMax], NSException, NSInvalidArgumentException, @"Should raise NSInvalidArgumentException for invalid direction (type CPTSign)"); + +#pragma clang diagnostic pop } @finally { label = nil; @@ -60,8 +65,8 @@ -(void)testPositionRelativeToViewPointPositionsForXCoordinate CGPoint newPosition = roundPoint(CGPointMake(start - label.offset, start), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(1.0), precision, @"Should anchor at (1.0, 0.5)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(0.5), precision, @"Should anchor at (1.0, 0.5)"); @@ -73,8 +78,8 @@ -(void)testPositionRelativeToViewPointPositionsForXCoordinate newPosition = roundPoint(CGPointMake(start - label.offset, start), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(1.0), precision, @"Should anchor at (1.0, 0.5)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(0.5), precision, @"Should anchor at (1.0, 0.5)"); @@ -86,8 +91,8 @@ -(void)testPositionRelativeToViewPointPositionsForXCoordinate newPosition = roundPoint(CGPointMake(start + label.offset, start), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(0.0), precision, @"Should anchor at (0.0, 0.5)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(0.5), precision, @"Should anchor at (0.0, 0.5)"); } @@ -117,8 +122,8 @@ -(void)testPositionRelativeToViewPointPositionsForYCoordinate CGPoint newPosition = roundPoint(CGPointMake(start, start - label.offset), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(0.5), precision, @"Should anchor at (0.5, 1.0)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(1.0), precision, @"Should anchor at (0.5, 1.0)"); @@ -130,8 +135,8 @@ -(void)testPositionRelativeToViewPointPositionsForYCoordinate newPosition = roundPoint(CGPointMake(start, start - label.offset), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(0.5), precision, @"Should anchor at (0.5, 1.0)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(1.0), precision, @"Should anchor at (0.5, 1.0)"); @@ -143,8 +148,8 @@ -(void)testPositionRelativeToViewPointPositionsForYCoordinate newPosition = roundPoint(CGPointMake(start, start + label.offset), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(0.5), precision, @"Should anchor at (0.5, 0.0)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(0.0), precision, @"Should anchor at (0.5, 0.0)"); } diff --git a/framework/Source/CPTAxisSet.h b/framework/Source/CPTAxisSet.h index ff41332a3..93bf35cda 100644 --- a/framework/Source/CPTAxisSet.h +++ b/framework/Source/CPTAxisSet.h @@ -7,7 +7,7 @@ /// @name Axes /// @{ -@property (nonatomic, readwrite, strong, nullable) CPTAxisArray axes; +@property (nonatomic, readwrite, strong, nullable) CPTAxisArray *axes; /// @} /// @name Drawing diff --git a/framework/Source/CPTAxisSet.m b/framework/Source/CPTAxisSet.m index 0472002ad..0f37e6cb5 100644 --- a/framework/Source/CPTAxisSet.m +++ b/framework/Source/CPTAxisSet.m @@ -9,7 +9,7 @@ **/ @implementation CPTAxisSet -/** @property nullable CPTAxisArray axes +/** @property nullable CPTAxisArray *axes * @brief The axes in the axis set. **/ @synthesize axes; @@ -38,7 +38,7 @@ @implementation CPTAxisSet **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { axes = @[]; borderLineStyle = nil; @@ -53,7 +53,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTAxisSet *theLayer = (CPTAxisSet *)layer; axes = theLayer->axes; @@ -79,15 +79,29 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - axes = [[coder decodeObjectForKey:@"CPTAxisSet.axes"] copy]; - borderLineStyle = [[coder decodeObjectForKey:@"CPTAxisSet.borderLineStyle"] copy]; + if ((self = [super initWithCoder:coder])) { + axes = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTAxis class]]] + forKey:@"CPTAxisSet.axes"] copy]; + borderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxisSet.borderLineStyle"] copy]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing @@ -110,7 +124,7 @@ -(void)display **/ -(void)relabelAxes { - CPTAxisArray theAxes = self.axes; + CPTAxisArray *theAxes = self.axes; [theAxes makeObjectsPerformSelector:@selector(setNeedsLayout)]; [theAxes makeObjectsPerformSelector:@selector(setNeedsRelabel)]; @@ -210,7 +224,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in /// @cond --(void)setAxes:(nullable CPTAxisArray)newAxes +-(void)setAxes:(nullable CPTAxisArray *)newAxes { if ( newAxes != axes ) { for ( CPTAxis *axis in axes ) { diff --git a/framework/Source/CPTAxisTitle.m b/framework/Source/CPTAxisTitle.m index d5d5a97da..99b26a321 100644 --- a/framework/Source/CPTAxisTitle.m +++ b/framework/Source/CPTAxisTitle.m @@ -18,7 +18,7 @@ @implementation CPTAxisTitle -(nonnull instancetype)initWithContentLayer:(nonnull CPTLayer *)layer { if ( layer ) { - if ( (self = [super initWithContentLayer:layer]) ) { + if ((self = [super initWithContentLayer:layer])) { self.rotation = CPTNAN; } } @@ -49,14 +49,14 @@ -(BOOL)isEqual:(nullable id)object else if ( [object isKindOfClass:[self class]] ) { CPTAxisTitle *otherTitle = object; - if ( (self.rotation != otherTitle.rotation) || (self.offset != otherTitle.offset) ) { + if ((self.rotation != otherTitle.rotation) || (self.offset != otherTitle.offset)) { return NO; } if ( ![self.contentLayer isEqual:otherTitle] ) { return NO; } - NSNumber *location = ( (CPTAxisLabel *)object ).tickLocation; + NSNumber *location = ((CPTAxisLabel *)object).tickLocation; if ( location ) { return [self.tickLocation isEqualToNumber:location]; @@ -81,11 +81,11 @@ -(NSUInteger)hash // Equal objects must hash the same. double tickLocationAsDouble = self.tickLocation.doubleValue; - if ( !isnan(tickLocationAsDouble) ) { - hashValue = (NSUInteger)lrint( fmod(ABS(tickLocationAsDouble), (double)NSUIntegerMax) ); + if ( !isnan(tickLocationAsDouble)) { + hashValue = (NSUInteger)lrint(fmod(ABS(tickLocationAsDouble), (double)NSUIntegerMax)); } - hashValue += (NSUInteger)lrint( fmod(ABS(self.rotation), (double)NSUIntegerMax) ); - hashValue += (NSUInteger)lrint( fmod(ABS(self.offset), (double)NSUIntegerMax) ); + hashValue += (NSUInteger)lrint(fmod(ABS(self.rotation), (double)NSUIntegerMax)); + hashValue += (NSUInteger)lrint(fmod(ABS(self.offset), (double)NSUIntegerMax)); return hashValue; } diff --git a/framework/Source/CPTBarPlot.h b/framework/Source/CPTBarPlot.h index cd2637df8..282fd873d 100644 --- a/framework/Source/CPTBarPlot.h +++ b/framework/Source/CPTBarPlot.h @@ -13,13 +13,19 @@ @class CPTTextLayer; @class CPTTextStyle; +/** + * @brief Bar plot bindings. + **/ +typedef NSString *CPTBarPlotBinding cpt_swift_struct; + /// @ingroup plotBindingsBarPlot /// @{ -extern NSString *__nonnull const CPTBarPlotBindingBarLocations; -extern NSString *__nonnull const CPTBarPlotBindingBarTips; -extern NSString *__nonnull const CPTBarPlotBindingBarBases; -extern NSString *__nonnull const CPTBarPlotBindingBarFills; -extern NSString *__nonnull const CPTBarPlotBindingBarLineStyles; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarLocations; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarTips; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarBases; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarFills; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarLineStyles; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarWidths; /// @} /** @@ -47,7 +53,7 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @param indexRange The range of the data indexes of interest. * @return An array of bar fills. **/ --(nullable CPTFillArray)barFillsForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndexRange:(NSRange)indexRange; +-(nullable CPTFillArray *)barFillsForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a bar fill for the given bar plot. * This method will not be called if @@ -65,7 +71,7 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @param indexRange The range of the data indexes of interest. * @return An array of line styles. **/ --(nullable CPTLineStyleArray)barLineStylesForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLineStyleArray *)barLineStylesForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a bar line style for the given bar plot. * This method will not be called if @@ -78,6 +84,23 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { **/ -(nullable CPTLineStyle *)barLineStyleForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndex:(NSUInteger)idx; +/** @brief @optional Gets an array of bar widths for the given bar plot. + * @param barPlot The bar plot. + * @param indexRange The range of the data indexes of interest. + * @return An array of bar widths. + **/ +-(nullable CPTNumberArray *)barWidthsForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndexRange:(NSRange)indexRange; + +/** @brief @optional Gets a bar width for the given bar plot. + * This method will not be called if + * @link CPTBarPlotDataSource::barWidthsForBarPlot:recordIndexRange: -barWidthsForBarPlot:recordIndexRange: @endlink + * is also implemented in the datasource. + * @param barPlot The bar plot. + * @param idx The data index of interest. + * @return The bar width for the bar with the given index. If the data source returns @nil, the default barWidth is used. + **/ +-(nullable NSNumber *)barWidthForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndex:(NSUInteger)idx; + /// @} /// @name Legends @@ -220,6 +243,8 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { -(void)reloadBarFillsInIndexRange:(NSRange)indexRange; -(void)reloadBarLineStyles; -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange; +-(void)reloadBarWidths; +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange; /// @} @end diff --git a/framework/Source/CPTBarPlot.m b/framework/Source/CPTBarPlot.m index 88acba05a..e667773e3 100644 --- a/framework/Source/CPTBarPlot.m +++ b/framework/Source/CPTBarPlot.m @@ -27,33 +27,36 @@ * @endif **/ -NSString *const CPTBarPlotBindingBarLocations = @"barLocations"; ///< Bar locations. -NSString *const CPTBarPlotBindingBarTips = @"barTips"; ///< Bar tips. -NSString *const CPTBarPlotBindingBarBases = @"barBases"; ///< Bar bases. -NSString *const CPTBarPlotBindingBarFills = @"barFills"; ///< Bar fills. -NSString *const CPTBarPlotBindingBarLineStyles = @"barLineStyles"; ///< Bar line styles. +CPTBarPlotBinding const CPTBarPlotBindingBarLocations = @"barLocations"; ///< Bar locations. +CPTBarPlotBinding const CPTBarPlotBindingBarTips = @"barTips"; ///< Bar tips. +CPTBarPlotBinding const CPTBarPlotBindingBarBases = @"barBases"; ///< Bar bases. +CPTBarPlotBinding const CPTBarPlotBindingBarFills = @"barFills"; ///< Bar fills. +CPTBarPlotBinding const CPTBarPlotBindingBarLineStyles = @"barLineStyles"; ///< Bar line styles. +CPTBarPlotBinding const CPTBarPlotBindingBarWidths = @"barWidths"; ///< Bar widths. /// @cond @interface CPTBarPlot() -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray barLocations; -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray barTips; -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray barBases; -@property (nonatomic, readwrite, copy, nullable) CPTFillArray barFills; -@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray barLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *barLocations; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *barTips; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *barBases; +@property (nonatomic, readwrite, copy, nullable) CPTFillArray *barFills; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *barLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *barWidths; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownIndex; -(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(nonnull CGPoint *)basePoint tipPoint:(nonnull CGPoint *)tipPoint; --(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context recordIndex:(NSUInteger)recordIndex; --(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context basePoint:(CGPoint)basePoint tipPoint:(CGPoint)tipPoint; +-(nullable CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context recordIndex:(NSUInteger)recordIndex; +-(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context basePoint:(CGPoint)basePoint tipPoint:(CGPoint)tipPoint width:(NSNumber *)width; -(nullable CPTFill *)barFillForIndex:(NSUInteger)idx; -(nullable CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx; +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx; -(void)drawBarInContext:(nonnull CGContextRef)context recordIndex:(NSUInteger)idx; -(CGFloat)lengthInView:(NSDecimal)plotLength; -(double)doubleLengthInPlotCoordinates:(NSDecimal)decimalLength; --(BOOL)barIsVisibleWithBasePoint:(CGPoint)basePoint; +-(BOOL)barIsVisibleWithBasePoint:(CGPoint)basePoint width:(NSNumber *)width; @end @@ -75,6 +78,7 @@ @implementation CPTBarPlot @dynamic barBases; @dynamic barFills; @dynamic barLineStyles; +@dynamic barWidths; /** @property CGFloat barCornerRadius * @brief The corner radius for the end of the bars. Default is @num{0.0} for square corners. @@ -170,7 +174,7 @@ @implementation CPTBarPlot **/ +(nonnull instancetype)tubularBarPlotWithColor:(nonnull CPTColor *)color horizontalBars:(BOOL)horizontal { - CPTBarPlot *barPlot = [[CPTBarPlot alloc] init]; + CPTBarPlot *barPlot = [[self alloc] init]; CPTMutableLineStyle *barLineStyle = [[CPTMutableLineStyle alloc] init]; barLineStyle.lineWidth = CPTFloat(1.0); @@ -195,7 +199,7 @@ +(nonnull instancetype)tubularBarPlotWithColor:(nonnull CPTColor *)color horizon /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -205,8 +209,10 @@ +(void)initialize [self exposeBinding:CPTBarPlotBindingBarBases]; [self exposeBinding:CPTBarPlotBindingBarFills]; [self exposeBinding:CPTBarPlotBindingBarLineStyles]; + [self exposeBinding:CPTBarPlotBindingBarWidths]; } } + #endif /// @endcond @@ -236,7 +242,7 @@ +(void)initialize **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { lineStyle = [[CPTLineStyle alloc] init]; fill = [CPTFill fillWithColor:[CPTColor blackColor]]; barWidth = @0.5; @@ -262,7 +268,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTBarPlot *theLayer = (CPTBarPlot *)layer; lineStyle = theLayer->lineStyle; @@ -310,30 +316,48 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { + if ((self = [super initWithCoder:coder])) { NSNumber *num; - lineStyle = [[coder decodeObjectForKey:@"CPTBarPlot.lineStyle"] copy]; - fill = [[coder decodeObjectForKey:@"CPTBarPlot.fill"] copy]; - num = [coder decodeObjectForKey:@"CPTBarPlot.barWidth"]; - barWidth = num ? num : @0.0; - num = [coder decodeObjectForKey:@"CPTBarPlot.barOffset"]; - barOffset = num ? num : @0.0; - barCornerRadius = [coder decodeCGFloatForKey:@"CPTBarPlot.barCornerRadius"]; - barBaseCornerRadius = [coder decodeCGFloatForKey:@"CPTBarPlot.barBaseCornerRadius"]; - num = [coder decodeObjectForKey:@"CPTBarPlot.baseValue"]; + lineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTBarPlot.lineStyle"] copy]; + fill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTBarPlot.fill"] copy]; + num = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTBarPlot.barWidth"]; + barWidth = num ? num : @0.0; + num = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTBarPlot.barOffset"]; + barOffset = num ? num : @0.0; + barCornerRadius = [coder decodeCGFloatForKey:@"CPTBarPlot.barCornerRadius"]; + barBaseCornerRadius = [coder decodeCGFloatForKey:@"CPTBarPlot.barBaseCornerRadius"]; + num = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTBarPlot.baseValue"]; baseValue = num ? num : @0.0; barsAreHorizontal = [coder decodeBoolForKey:@"CPTBarPlot.barsAreHorizontal"]; barBasesVary = [coder decodeBoolForKey:@"CPTBarPlot.barBasesVary"]; barWidthsAreInViewCoordinates = [coder decodeBoolForKey:@"CPTBarPlot.barWidthsAreInViewCoordinates"]; - plotRange = [[coder decodeObjectForKey:@"CPTBarPlot.plotRange"] copy]; - pointingDeviceDownIndex = NSNotFound; + plotRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTBarPlot.plotRange"] copy]; + pointingDeviceDownIndex = NSNotFound; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Data Loading @@ -349,6 +373,9 @@ -(void)reloadDataInIndexRange:(NSRange)indexRange // Bar line styles [self reloadBarLineStylesInIndexRange:indexRange]; + // Bar widths + [self reloadBarWidthsInIndexRange:indexRange]; + // Legend id theDataSource = (id)self.dataSource; @@ -387,7 +414,7 @@ -(void)reloadPlotDataInIndexRange:(NSRange)indexRange CPTMutableNumericData *locationData = nil; if ( self.doublePrecisionCache ) { locationData = [[CPTMutableNumericData alloc] initWithData:[NSData data] - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) shape:nil]; locationData.shape = @[@(indexRange.length)]; @@ -406,13 +433,13 @@ -(void)reloadPlotDataInIndexRange:(NSRange)indexRange } else { locationData = [[CPTMutableNumericData alloc] initWithData:[NSData data] - dataType:CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent()) shape:nil]; locationData.shape = @[@(indexRange.length)]; NSDecimal delta = CPTDecimalFromInteger(1); if ( indexRange.length > 1 ) { - delta = CPTDecimalDivide( self.plotRange.lengthDecimal, CPTDecimalFromUnsignedInteger(indexRange.length - 1) ); + delta = CPTDecimalDivide(self.plotRange.lengthDecimal, CPTDecimalFromUnsignedInteger(indexRange.length - 1)); } NSDecimal locationDecimal = self.plotRange.locationDecimal; @@ -435,7 +462,7 @@ -(void)reloadPlotDataInIndexRange:(NSRange)indexRange CPTMutableNumericData *locationData = nil; if ( self.doublePrecisionCache ) { locationData = [[CPTMutableNumericData alloc] initWithData:[NSData data] - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) shape:nil]; locationData.shape = @[@(indexRange.length)]; @@ -449,7 +476,7 @@ -(void)reloadPlotDataInIndexRange:(NSRange)indexRange } else { locationData = [[CPTMutableNumericData alloc] initWithData:[NSData data] - dataType:CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent()) shape:nil]; locationData.shape = @[@(indexRange.length)]; @@ -496,9 +523,9 @@ -(void)reloadBarFillsInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(barFillForBarPlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - CPTMutableFillArray array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableFillArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTFill *dataSourceFill = [theDataSource barFillForBarPlot:self recordIndex:idx]; @@ -510,7 +537,9 @@ -(void)reloadBarFillsInIndexRange:(NSRange)indexRange } } - [self cacheArray:array forKey:CPTBarPlotBindingBarFills atRecordIndex:indexRange.location]; + [self cacheArray:array + forKey:CPTBarPlotBindingBarFills + atRecordIndex:indexRange.location]; } // Legend @@ -548,9 +577,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(barLineStyleForBarPlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - CPTMutableLineStyleArray array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLineStyleArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLineStyle *dataSourceLineStyle = [theDataSource barLineStyleForBarPlot:self recordIndex:idx]; @@ -562,7 +591,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange } } - [self cacheArray:array forKey:CPTBarPlotBindingBarLineStyles atRecordIndex:indexRange.location]; + [self cacheArray:array + forKey:CPTBarPlotBindingBarLineStyles + atRecordIndex:indexRange.location]; } // Legend @@ -573,6 +604,49 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange [self setNeedsDisplay]; } +/** + * @brief Reload all bar widths from the data source immediately. + **/ +-(void)reloadBarWidths +{ + [self reloadBarWidthsInIndexRange:NSMakeRange(0, self.cachedDataCount)]; +} + +/** @brief Reload bar widths in the given index range from the data source immediately. + * @param indexRange The index range to load. + **/ +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange +{ + id theDataSource = (id)self.dataSource; + + if ( [theDataSource respondsToSelector:@selector(barWidthsForBarPlot:recordIndexRange:)] ) { + [self cacheArray:[theDataSource barWidthsForBarPlot:self recordIndexRange:indexRange] + forKey:CPTBarPlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + else if ( [theDataSource respondsToSelector:@selector(barWidthForBarPlot:recordIndex:)] ) { + id nilObject = [CPTPlot nilData]; + CPTMutableNumberArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); + + for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { + NSNumber *width = [theDataSource barWidthForBarPlot:self recordIndex:idx]; + if ( width ) { + [array addObject:width]; + } + else { + [array addObject:nilObject]; + } + } + + [self cacheArray:array + forKey:CPTBarPlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + + [self setNeedsDisplay]; +} + #pragma mark - #pragma mark Length Conversions for Independent Coordinate (e.g., widths, offsets) @@ -638,8 +712,8 @@ -(double)doubleLengthInPlotCoordinates:(NSDecimal)decimalLength double length; if ( self.barWidthsAreInViewCoordinates ) { - CGFloat floatLength = CPTDecimalCGFloatValue(decimalLength); - CGPoint originViewPoint = CGPointZero; + CGFloat floatLength = CPTDecimalCGFloatValue(decimalLength); + CGPoint originViewPoint = CGPointZero; CGPoint displacedViewPoint = CPTPointMake(floatLength, floatLength); double originPlotPoint[2], displacedPlotPoint[2]; CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -663,8 +737,8 @@ -(NSDecimal)lengthInPlotCoordinates:(NSDecimal)decimalLength NSDecimal length; if ( self.barWidthsAreInViewCoordinates ) { - CGFloat floatLength = CPTDecimalCGFloatValue(decimalLength); - CGPoint originViewPoint = CGPointZero; + CGFloat floatLength = CPTDecimalCGFloatValue(decimalLength); + CGPoint originViewPoint = CGPointZero; CGPoint displacedViewPoint = CPTPointMake(floatLength, floatLength); NSDecimal originPlotPoint[2], displacedPlotPoint[2]; CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -725,6 +799,27 @@ -(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord return range; } +-(nullable CPTPlotRange *)plotRangeEnclosingField:(NSUInteger)fieldEnum +{ + CPTPlotRange *range = nil; + + switch ( fieldEnum ) { + case CPTBarPlotFieldBarLocation: + range = [self plotRangeEnclosingBars]; + break; + + case CPTBarPlotFieldBarTip: + case CPTBarPlotFieldBarBase: + range = [self plotRangeForField:fieldEnum]; + break; + + default: + break; + } + + return range; +} + /// @endcond /** @brief Computes a plot range that completely encloses all of the bars. @@ -749,12 +844,12 @@ -(nullable CPTPlotRange *)plotRangeEnclosingBars NSDecimal barOffsetLength = [self lengthInPlotCoordinates:self.barOffset.decimalValue]; NSDecimal barWidthLength = [self lengthInPlotCoordinates:self.barWidth.decimalValue]; - NSDecimal halfBarWidth = CPTDecimalDivide( barWidthLength, CPTDecimalFromInteger(2) ); + NSDecimal halfBarWidth = CPTDecimalDivide(barWidthLength, CPTDecimalFromInteger(2)); NSDecimal rangeLocation = range.locationDecimal; NSDecimal rangeLength = range.lengthDecimal; - if ( CPTDecimalGreaterThanOrEqualTo( rangeLength, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalGreaterThanOrEqualTo(rangeLength, CPTDecimalFromInteger(0))) { rangeLocation = CPTDecimalSubtract(rangeLocation, halfBarWidth); range.locationDecimal = CPTDecimalAdd(rangeLocation, barOffsetLength); @@ -783,13 +878,13 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CPTMutableNumericData *cachedLocations = [self cachedNumbersForField:CPTBarPlotFieldBarLocation]; CPTMutableNumericData *cachedLengths = [self cachedNumbersForField:CPTBarPlotFieldBarTip]; - if ( (cachedLocations == nil) || (cachedLengths == nil) ) { + if ((cachedLocations == nil) || (cachedLengths == nil)) { return; } BOOL basesVary = self.barBasesVary; CPTMutableNumericData *cachedBases = [self cachedNumbersForField:CPTBarPlotFieldBarBase]; - if ( basesVary && (cachedBases == nil) ) { + if ( basesVary && (cachedBases == nil)) { return; } @@ -802,7 +897,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context [NSException raise:CPTException format:@"Number of bar locations and lengths do not match"]; } - if ( basesVary && (cachedLengths.numberOfSamples != cachedBases.numberOfSamples) ) { + if ( basesVary && (cachedLengths.numberOfSamples != cachedBases.numberOfSamples)) { [NSException raise:CPTException format:@"Number of bar lengths and bases do not match"]; } @@ -829,13 +924,13 @@ -(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(nonnull CGPoint *)basePoint t if ( self.doublePrecisionCache ) { double plotPoint[2]; plotPoint[independentCoord] = [self cachedDoubleForField:CPTBarPlotFieldBarLocation recordIndex:idx]; - if ( isnan(plotPoint[independentCoord]) ) { + if ( isnan(plotPoint[independentCoord])) { return NO; } // Tip point plotPoint[dependentCoord] = [self cachedDoubleForField:CPTBarPlotFieldBarTip recordIndex:idx]; - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { return NO; } *tipPoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; @@ -847,7 +942,7 @@ -(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(nonnull CGPoint *)basePoint t else { plotPoint[dependentCoord] = [self cachedDoubleForField:CPTBarPlotFieldBarBase recordIndex:idx]; } - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { return NO; } *basePoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; @@ -855,13 +950,13 @@ -(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(nonnull CGPoint *)basePoint t else { NSDecimal plotPoint[2]; plotPoint[independentCoord] = [self cachedDecimalForField:CPTBarPlotFieldBarLocation recordIndex:idx]; - if ( NSDecimalIsNotANumber(&plotPoint[independentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[independentCoord])) { return NO; } // Tip point plotPoint[dependentCoord] = [self cachedDecimalForField:CPTBarPlotFieldBarTip recordIndex:idx]; - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { return NO; } *tipPoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; @@ -873,7 +968,7 @@ -(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(nonnull CGPoint *)basePoint t else { plotPoint[dependentCoord] = [self cachedDecimalForField:CPTBarPlotFieldBarBase recordIndex:idx]; } - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { return NO; } *basePoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; @@ -895,7 +990,7 @@ -(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(nonnull CGPoint *)basePoint t return YES; } --(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context recordIndex:(NSUInteger)recordIndex +-(nullable CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context recordIndex:(NSUInteger)recordIndex { // Get base and tip points CGPoint basePoint, tipPoint; @@ -905,18 +1000,23 @@ -(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context return NULL; } - CGMutablePathRef path = [self newBarPathWithContext:context basePoint:basePoint tipPoint:tipPoint]; + NSNumber *width = [self barWidthForIndex:recordIndex]; + + CGMutablePathRef path = [self newBarPathWithContext:context + basePoint:basePoint + tipPoint:tipPoint + width:width]; return path; } --(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context basePoint:(CGPoint)basePoint tipPoint:(CGPoint)tipPoint +-(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context basePoint:(CGPoint)basePoint tipPoint:(CGPoint)tipPoint width:(NSNumber *)width { // This function is used to create a path which is used for both // drawing a bar and for doing hit-testing on a click/touch event BOOL horizontalBars = self.barsAreHorizontal; - CGFloat barWidthLength = [self lengthInView:self.barWidth.decimalValue]; + CGFloat barWidthLength = [self lengthInView:width.decimalValue]; CGFloat halfBarWidth = CPTFloat(0.5) * barWidthLength; CGRect barRect; @@ -945,7 +1045,7 @@ -(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context CGContextRef theContext = context; - if ( self.lineStyle.lineWidth > CPTFloat(0.0) ) { + if ( self.lineStyle.lineWidth > CPTFloat(0.0)) { barRect = CPTAlignRectToUserSpace(theContext, barRect); } else { @@ -953,21 +1053,21 @@ -(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context } } - CGFloat radius = MIN( MIN( self.barCornerRadius, ABS(barRect.size.width) * CPTFloat(0.5) ), ABS(barRect.size.height) * CPTFloat(0.5) ); - CGFloat baseRadius = MIN( MIN( self.barBaseCornerRadius, ABS(barRect.size.width) * CPTFloat(0.5) ), ABS(barRect.size.height) * CPTFloat(0.5) ); + CGFloat radius = MIN(MIN(self.barCornerRadius, ABS(barRect.size.width) * CPTFloat(0.5)), ABS(barRect.size.height) * CPTFloat(0.5)); + CGFloat baseRadius = MIN(MIN(self.barBaseCornerRadius, ABS(barRect.size.width) * CPTFloat(0.5)), ABS(barRect.size.height) * CPTFloat(0.5)); - if ( widthNegative && ( barRect.size.width > CPTFloat(0.0) ) ) { + if ( widthNegative && (barRect.size.width > CPTFloat(0.0))) { barRect.origin.x += barRect.size.width; barRect.size.width = -barRect.size.width; } - if ( heightNegative && ( barRect.size.height > CPTFloat(0.0) ) ) { + if ( heightNegative && (barRect.size.height > CPTFloat(0.0))) { barRect.origin.y += barRect.size.height; barRect.size.height = -barRect.size.height; } CGMutablePathRef path = CGPathCreateMutable(); - if ( radius == CPTFloat(0.0) ) { - if ( baseRadius == CPTFloat(0.0) ) { + if ( radius == CPTFloat(0.0)) { + if ( baseRadius == CPTFloat(0.0)) { // square corners CGPathAddRect(path, NULL, barRect); } @@ -995,7 +1095,7 @@ -(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context CGFloat tipX = barRect.origin.x + barRect.size.width; CGFloat tipY = barRect.origin.y + barRect.size.height; - if ( baseRadius == CPTFloat(0.0) ) { + if ( baseRadius == CPTFloat(0.0)) { // rounded at tip end only CGPathMoveToPoint(path, NULL, barRect.origin.x, barRect.origin.y); if ( horizontalBars ) { @@ -1013,14 +1113,14 @@ -(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context else { // rounded at both ends if ( horizontalBars ) { - CGPathMoveToPoint( path, NULL, barRect.origin.x, CGRectGetMidY(barRect) ); + CGPathMoveToPoint(path, NULL, barRect.origin.x, CGRectGetMidY(barRect)); CGPathAddArcToPoint(path, NULL, barRect.origin.x, tipY, CGRectGetMidX(barRect), tipY, baseRadius); CGPathAddArcToPoint(path, NULL, tipX, tipY, tipX, CGRectGetMidY(barRect), radius); CGPathAddArcToPoint(path, NULL, tipX, barRect.origin.y, CGRectGetMidX(barRect), barRect.origin.y, radius); CGPathAddArcToPoint(path, NULL, barRect.origin.x, barRect.origin.y, barRect.origin.x, CGRectGetMidY(barRect), baseRadius); } else { - CGPathMoveToPoint( path, NULL, barRect.origin.x, CGRectGetMidY(barRect) ); + CGPathMoveToPoint(path, NULL, barRect.origin.x, CGRectGetMidY(barRect)); CGPathAddArcToPoint(path, NULL, barRect.origin.x, tipY, CGRectGetMidX(barRect), tipY, radius); CGPathAddArcToPoint(path, NULL, tipX, tipY, tipX, CGRectGetMidY(barRect), radius); CGPathAddArcToPoint(path, NULL, tipX, barRect.origin.y, CGRectGetMidX(barRect), barRect.origin.y, baseRadius); @@ -1033,16 +1133,16 @@ -(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context return path; } --(BOOL)barIsVisibleWithBasePoint:(CGPoint)basePoint +-(BOOL)barIsVisibleWithBasePoint:(CGPoint)basePoint width:(NSNumber *)width { BOOL horizontalBars = self.barsAreHorizontal; - CGFloat barWidthLength = [self lengthInView:self.barWidth.decimalValue]; + CGFloat barWidthLength = [self lengthInView:width.decimalValue]; CGFloat halfBarWidth = CPTFloat(0.5) * barWidthLength; CPTPlotArea *thePlotArea = self.plotArea; - CGFloat lowerBound = ( horizontalBars ? CGRectGetMinY(thePlotArea.bounds) : CGRectGetMinX(thePlotArea.bounds) ); - CGFloat upperBound = ( horizontalBars ? CGRectGetMaxY(thePlotArea.bounds) : CGRectGetMaxX(thePlotArea.bounds) ); + CGFloat lowerBound = (horizontalBars ? CGRectGetMinY(thePlotArea.bounds) : CGRectGetMinX(thePlotArea.bounds)); + CGFloat upperBound = (horizontalBars ? CGRectGetMaxY(thePlotArea.bounds) : CGRectGetMaxX(thePlotArea.bounds)); CGFloat base = (horizontalBars ? basePoint.y : basePoint.x); return (base + halfBarWidth >= lowerBound) && (base - halfBarWidth <= upperBound); @@ -1052,7 +1152,7 @@ -(nullable CPTFill *)barFillForIndex:(NSUInteger)idx { CPTFill *theBarFill = [self cachedValueForKey:CPTBarPlotBindingBarFills recordIndex:idx]; - if ( (theBarFill == nil) || (theBarFill == [CPTPlot nilData]) ) { + if ((theBarFill == nil) || (theBarFill == [CPTPlot nilData])) { theBarFill = self.fill; } @@ -1063,13 +1163,24 @@ -(nullable CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx { CPTLineStyle *theBarLineStyle = [self cachedValueForKey:CPTBarPlotBindingBarLineStyles recordIndex:idx]; - if ( (theBarLineStyle == nil) || (theBarLineStyle == [CPTPlot nilData]) ) { + if ((theBarLineStyle == nil) || (theBarLineStyle == [CPTPlot nilData])) { theBarLineStyle = self.lineStyle; } return theBarLineStyle; } +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx +{ + NSNumber *theBarWidth = [self cachedValueForKey:CPTBarPlotBindingBarWidths recordIndex:idx]; + + if ((theBarWidth == nil) || (theBarWidth == [CPTPlot nilData])) { + theBarWidth = self.barWidth; + } + + return theBarWidth; +} + -(void)drawBarInContext:(nonnull CGContextRef)context recordIndex:(NSUInteger)idx { // Get base and tip points @@ -1080,12 +1191,17 @@ -(void)drawBarInContext:(nonnull CGContextRef)context recordIndex:(NSUInteger)id return; } + NSNumber *width = [self barWidthForIndex:idx]; + // Return if bar is off screen - if ( ![self barIsVisibleWithBasePoint:basePoint] ) { + if ( ![self barIsVisibleWithBasePoint:basePoint width:width] ) { return; } - CGMutablePathRef path = [self newBarPathWithContext:context basePoint:basePoint tipPoint:tipPoint]; + CGMutablePathRef path = [self newBarPathWithContext:context + basePoint:basePoint + tipPoint:tipPoint + width:width]; if ( path ) { CGContextSaveGState(context); @@ -1191,7 +1307,7 @@ -(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex: BOOL horizontalBars = self.barsAreHorizontal; CPTCoordinate coordinate = (horizontalBars ? CPTCoordinateX : CPTCoordinateY); CPTPlotRange *lengthRange = [self.plotSpace plotRangeForCoordinate:coordinate]; - if ( CPTDecimalLessThan( lengthRange.lengthDecimal, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalLessThan(lengthRange.lengthDecimal, CPTDecimalFromInteger(0))) { positiveDirection = !positiveDirection; } @@ -1311,10 +1427,10 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point NSUInteger barCount = self.cachedDataCount; NSUInteger ii = 0; - while ( (ii < barCount) && (idx == NSNotFound) ) { + while ((ii < barCount) && (idx == NSNotFound)) { CGMutablePathRef path = [self newBarPathWithContext:NULL recordIndex:ii]; - if ( CGPathContainsPoint(path, NULL, point, false) ) { + if ( CGPathContainsPoint(path, NULL, point, false)) { idx = ii; } @@ -1358,7 +1474,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(barPlot:barTouchDownAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(barPlot:barTouchDownAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(barPlot:barWasSelectedAtRecordIndex:)] || @@ -1427,7 +1543,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(barPlot:barTouchUpAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(barPlot:barTouchUpAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(barPlot:barWasSelectedAtRecordIndex:)] || @@ -1477,53 +1593,53 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in /// @cond --(nullable CPTNumberArray)barTips +-(nullable CPTNumberArray *)barTips { return [[self cachedNumbersForField:CPTBarPlotFieldBarTip] sampleArray]; } --(void)setBarTips:(nullable CPTNumberArray)newTips +-(void)setBarTips:(nullable CPTNumberArray *)newTips { [self cacheNumbers:newTips forField:CPTBarPlotFieldBarTip]; } --(nullable CPTNumberArray)barBases +-(nullable CPTNumberArray *)barBases { return [[self cachedNumbersForField:CPTBarPlotFieldBarBase] sampleArray]; } --(void)setBarBases:(nullable CPTNumberArray)newBases +-(void)setBarBases:(nullable CPTNumberArray *)newBases { [self cacheNumbers:newBases forField:CPTBarPlotFieldBarBase]; } --(nullable CPTNumberArray)barLocations +-(nullable CPTNumberArray *)barLocations { return [[self cachedNumbersForField:CPTBarPlotFieldBarLocation] sampleArray]; } --(void)setBarLocations:(nullable CPTNumberArray)newLocations +-(void)setBarLocations:(nullable CPTNumberArray *)newLocations { [self cacheNumbers:newLocations forField:CPTBarPlotFieldBarLocation]; } --(nullable CPTFillArray)barFills +-(nullable CPTFillArray *)barFills { return [self cachedArrayForKey:CPTBarPlotBindingBarFills]; } --(void)setBarFills:(nullable CPTFillArray)newBarFills +-(void)setBarFills:(nullable CPTFillArray *)newBarFills { [self cacheArray:newBarFills forKey:CPTBarPlotBindingBarFills]; [self setNeedsDisplay]; } --(nullable CPTLineStyleArray)barLineStyles +-(nullable CPTLineStyleArray *)barLineStyles { return [self cachedArrayForKey:CPTBarPlotBindingBarLineStyles]; } --(void)setBarLineStyles:(nullable CPTLineStyleArray)newBarLineStyles +-(void)setBarLineStyles:(nullable CPTLineStyleArray *)newBarLineStyles { [self cacheArray:newBarLineStyles forKey:CPTBarPlotBindingBarLineStyles]; [self setNeedsDisplay]; @@ -1622,16 +1738,16 @@ -(NSUInteger)numberOfFields return 3; } --(nonnull CPTNumberArray)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[@(CPTBarPlotFieldBarLocation), @(CPTBarPlotFieldBarTip), @(CPTBarPlotFieldBarBase)]; } --(nonnull CPTNumberArray)fieldIdentifiersForCoordinate:(CPTCoordinate)coord +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord { - CPTNumberArray result = nil; + CPTNumberArray *result = nil; switch ( coord ) { case CPTCoordinateX: diff --git a/framework/Source/CPTBorderedLayer.m b/framework/Source/CPTBorderedLayer.m index 4f0790e7a..7a6126c00 100644 --- a/framework/Source/CPTBorderedLayer.m +++ b/framework/Source/CPTBorderedLayer.m @@ -1,10 +1,10 @@ #import "CPTBorderedLayer.h" +#import "_CPTBorderLayer.h" +#import "_CPTMaskLayer.h" #import "CPTFill.h" #import "CPTLineStyle.h" #import "CPTPathExtensions.h" -#import "_CPTBorderLayer.h" -#import "_CPTMaskLayer.h" /// @cond @@ -68,7 +68,7 @@ @implementation CPTBorderedLayer **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { borderLineStyle = nil; fill = nil; inLayout = NO; @@ -84,7 +84,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTBorderedLayer *theLayer = (CPTBorderedLayer *)layer; borderLineStyle = theLayer->borderLineStyle; @@ -114,9 +114,11 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - borderLineStyle = [[coder decodeObjectForKey:@"CPTBorderedLayer.borderLineStyle"] copy]; - fill = [[coder decodeObjectForKey:@"CPTBorderedLayer.fill"] copy]; + if ((self = [super initWithCoder:coder])) { + borderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTBorderedLayer.borderLineStyle"] copy]; + fill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTBorderedLayer.fill"] copy]; inLayout = NO; } @@ -125,6 +127,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing @@ -169,7 +183,7 @@ -(void)renderBorderedLayerAsVectorInContext:(nonnull CGContextRef)context CGFloat radius = self.cornerRadius; - if ( radius > CPTFloat(0.0) ) { + if ( radius > CPTFloat(0.0)) { CGContextBeginPath(context); CPTAddRoundedRectPath(context, layerBounds, radius); [theLineStyle strokePathInContext:context]; @@ -198,7 +212,7 @@ -(void)sublayerMarginLeft:(nonnull CGFloat *)left top:(nonnull CGFloat *)top rig CGFloat inset = self.borderLineStyle.lineWidth * CPTFloat(0.5); - if ( inset > CPTFloat(0.0) ) { + if ( inset > CPTFloat(0.0)) { *left += inset; *top += inset; *right += inset; @@ -257,7 +271,7 @@ -(nullable CGPathRef)sublayerMaskingPath CGFloat lineWidth = self.borderLineStyle.lineWidth; CGRect selfBounds = CGRectInset(self.bounds, lineWidth, lineWidth); - path = CPTCreateRoundedRectPath( selfBounds, self.cornerRadius - lineWidth * CPTFloat(0.5) ); + path = CPTCreateRoundedRectPath(selfBounds, self.cornerRadius - lineWidth * CPTFloat(0.5)); self.innerBorderPath = path; CGPathRelease(path); @@ -292,7 +306,7 @@ -(void)removeFromSuperlayer -(void)updateOpacity { - BOOL opaqueLayer = ( self.cornerRadius <= CPTFloat(0.0) ); + BOOL opaqueLayer = (self.cornerRadius <= CPTFloat(0.0)); CPTFill *theFill = self.fill; @@ -339,7 +353,7 @@ -(void)setFill:(nullable CPTFill *)newFill fill = [newFill copy]; CPTLayer *border = self.borderLayer; - if ( self.cornerRadius != CPTFloat(0.0) ) { + if ( self.cornerRadius != CPTFloat(0.0)) { border.backgroundColor = NULL; } else { diff --git a/framework/Source/CPTCalendarFormatter.m b/framework/Source/CPTCalendarFormatter.m index dcaa8b8e8..928263b4e 100644 --- a/framework/Source/CPTCalendarFormatter.m +++ b/framework/Source/CPTCalendarFormatter.m @@ -67,7 +67,7 @@ -(nonnull instancetype)init **/ -(nonnull instancetype)initWithDateFormatter:(nullable NSDateFormatter *)aDateFormatter { - if ( (self = [super init]) ) { + if ((self = [super init])) { dateFormatter = aDateFormatter; referenceDate = nil; referenceCalendar = nil; @@ -99,7 +99,7 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { dateFormatter = [coder decodeObjectForKey:@"CPTCalendarFormatter.dateFormatter"]; referenceDate = [[coder decodeObjectForKey:@"CPTCalendarFormatter.referenceDate"] copy]; referenceCalendar = [[coder decodeObjectForKey:@"CPTCalendarFormatter.referenceCalendar"] copy]; @@ -142,7 +142,7 @@ -(nonnull id)copyWithZone:(nullable NSZone *)zone * @param coordinateValue The time value. * @return The date string. **/ --(nullable NSString *)stringForObjectValue:(nonnull id)coordinateValue +-(nullable NSString *)stringForObjectValue:(nullable id)coordinateValue { NSInteger componentIncrement = 0; diff --git a/framework/Source/CPTCalendarFormatterTests.h b/framework/Source/CPTCalendarFormatterTests.h new file mode 100644 index 000000000..21b6d4c2e --- /dev/null +++ b/framework/Source/CPTCalendarFormatterTests.h @@ -0,0 +1,5 @@ +#import "CPTTestCase.h" + +@interface CPTCalendarFormatterTests : CPTTestCase + +@end diff --git a/framework/Source/CPTCalendarFormatterTests.m b/framework/Source/CPTCalendarFormatterTests.m new file mode 100644 index 000000000..ce3a609d5 --- /dev/null +++ b/framework/Source/CPTCalendarFormatterTests.m @@ -0,0 +1,29 @@ +#import "CPTCalendarFormatterTests.h" + +#import "CPTCalendarFormatter.h" + +@implementation CPTCalendarFormatterTests + +#pragma mark - +#pragma mark NSCoding Methods + +-(void)testKeyedArchivingRoundTrip +{ + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + + NSDate *refDate = [dateFormatter dateFromString:@"12:00 Oct 29, 2009"]; + + dateFormatter.dateStyle = NSDateFormatterShortStyle; + + CPTCalendarFormatter *calendarFormatter = [[CPTCalendarFormatter alloc] initWithDateFormatter:dateFormatter]; + calendarFormatter.referenceDate = refDate; + + CPTCalendarFormatter *newCalendarFormatter = [self archiveRoundTrip:calendarFormatter]; + + XCTAssertEqualObjects(calendarFormatter.dateFormatter.dateFormat, newCalendarFormatter.dateFormatter.dateFormat, @"Date formatter not equal"); + XCTAssertEqualObjects(calendarFormatter.referenceDate, newCalendarFormatter.referenceDate, @"Reference date not equal"); + XCTAssertEqualObjects(calendarFormatter.referenceCalendar, newCalendarFormatter.referenceCalendar, @"Reference calendar not equal"); + XCTAssertEqual(calendarFormatter.referenceCalendarUnit, newCalendarFormatter.referenceCalendarUnit, @"Reference calendar unit not equal"); +} + +@end diff --git a/framework/Source/CPTColor.h b/framework/Source/CPTColor.h index 3de4f5dcc..8ae9a7611 100644 --- a/framework/Source/CPTColor.h +++ b/framework/Source/CPTColor.h @@ -1,9 +1,18 @@ -@interface CPTColor : NSObject +#import "CPTPlatformSpecificDefines.h" + +@interface CPTColor : NSObject @property (nonatomic, readonly, nonnull) CGColorRef cgColor; @property (nonatomic, readonly, getter = isOpaque) BOOL opaque; -/// @name Factory Methods +#if TARGET_OS_OSX +@property (nonatomic, readonly, nonnull) NSColor *nsColor; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE +@property (nonatomic, readonly, nonnull) UIColor *uiColor; +#endif +@property (nonatomic, readonly, nonnull) CPTNativeColor *nativeColor; + +/// @name Standard Colors /// @{ +(nonnull instancetype)clearColor; +(nonnull instancetype)whiteColor; @@ -20,10 +29,21 @@ +(nonnull instancetype)orangeColor; +(nonnull instancetype)purpleColor; +(nonnull instancetype)brownColor; +/// @} +/// @name Factory Methods +/// @{ +(nonnull instancetype)colorWithCGColor:(nonnull CGColorRef)newCGColor; +(nonnull instancetype)colorWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; +(nonnull instancetype)colorWithGenericGray:(CGFloat)gray; + +#if TARGET_OS_OSX ++(nonnull instancetype)colorWithNSColor:(nonnull NSColor *)newNSColor; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE ++(nonnull instancetype)colorWithUIColor:(nonnull UIColor *)newUIColor; +#endif ++(nonnull instancetype)colorWithNativeColor:(nonnull CPTNativeColor *)newColor; + /// @} /// @name Initialization @@ -32,6 +52,13 @@ -(nonnull instancetype)initWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; -(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +#if TARGET_OS_OSX +-(nonnull instancetype)initWithNSColor:(nonnull NSColor *)newNSColor NS_DESIGNATED_INITIALIZER; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE +-(nonnull instancetype)initWithUIColor:(nonnull UIColor *)newUIColor NS_DESIGNATED_INITIALIZER; +#endif +-(nonnull instancetype)initWithNativeColor:(nonnull CPTNativeColor *)newColor; + -(nonnull instancetype)colorWithAlphaComponent:(CGFloat)alpha; /// @} diff --git a/framework/Source/CPTColor.m b/framework/Source/CPTColor.m index c8091b852..2be62efdf 100644 --- a/framework/Source/CPTColor.m +++ b/framework/Source/CPTColor.m @@ -5,6 +5,22 @@ #import "CPTPlatformSpecificCategories.h" #import "NSCoderExtensions.h" +/// @cond + +@interface CPTColor() + +#if TARGET_OS_OSX +@property (nonatomic, readonly, nullable) NSColor *nsColorCache; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE +@property (nonatomic, readonly, nullable) UIColor *uiColorCache; +#endif + +@end + +/// @endcond + +#pragma mark - + /** @brief An immutable color. * * An immutable object wrapper class around @ref CGColorRef. @@ -14,18 +30,100 @@ **/ @implementation CPTColor +#if TARGET_OS_OSX + +/** @internal + * @property nullable NSColor *nsColorCache + * @brief The NSColor to wrap around. + **/ +@synthesize nsColorCache; + +/** @property nonnull NSColor *nsColor + * @brief The NSColor to wrap around. + **/ +@dynamic nsColor; + +-(NSColor *)nsColor +{ + NSColor *theNSColor = self.nsColorCache; + + if ( theNSColor ) { + return theNSColor; + } + else { + return [NSColor colorWithCIColor:[CIColor colorWithCGColor:self.cgColor]]; + } +} + +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + +/** @internal + * @property nullable UIColor *uiColorCache + * @brief The UIColor to wrap around. + **/ +@synthesize uiColorCache; + +/** @property nonnull UIColor *uiColor + * @brief The UIColor to wrap around. + **/ +@dynamic uiColor; + +-(UIColor *)uiColor +{ + UIColor *theUIColor = self.uiColorCache; + + if ( theUIColor ) { + return theUIColor; + } + else { + return [UIColor colorWithCGColor:self.cgColor]; + } +} + +#endif + +/** @property nonnull CPTNativeColor *nativeColor + * @brief The platform-native color to wrap around. + **/ +@dynamic nativeColor; + +-(CPTNativeColor *)nativeColor +{ +#if TARGET_OS_OSX + return self.nsColor; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + return self.uiColor; +#endif +} + /** @property nonnull CGColorRef cgColor * @brief The @ref CGColorRef to wrap around. **/ @synthesize cgColor; +-(CGColorRef)cgColor +{ +#if TARGET_OS_OSX + NSColor *theNSColor = self.nsColorCache; + if ( theNSColor ) { + return theNSColor.CGColor; + } +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + UIColor *theUIColor = self.uiColorCache; + if ( theUIColor ) { + return theUIColor.CGColor; + } +#endif + return cgColor; +} + /** @property BOOL opaque * @brief If @YES, the color is completely opaque. */ @dynamic opaque; #pragma mark - -#pragma mark Factory Methods +#pragma mark Standard Colors /** @brief Returns a shared instance of CPTColor initialized with a fully transparent color. * @@ -41,7 +139,7 @@ +(nonnull instancetype)clearColor CGColorRef clear = CGColorCreate([CPTColorSpace genericRGBSpace].cgColorSpace, values); - color = [[CPTColor alloc] initWithCGColor:clear]; + color = [[self alloc] initWithCGColor:clear]; CGColorRelease(clear); }); @@ -139,10 +237,10 @@ +(nonnull instancetype)redColor static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(1.0) - green:CPTFloat(0.0) - blue:CPTFloat(0.0) - alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(1.0) + green:CPTFloat(0.0) + blue:CPTFloat(0.0) + alpha:CPTFloat(1.0)]; }); return color; @@ -158,10 +256,10 @@ +(nonnull instancetype)greenColor static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(0.0) - green:CPTFloat(1.0) - blue:CPTFloat(0.0) - alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(0.0) + green:CPTFloat(1.0) + blue:CPTFloat(0.0) + alpha:CPTFloat(1.0)]; }); return color; @@ -177,10 +275,10 @@ +(nonnull instancetype)blueColor static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(0.0) - green:CPTFloat(0.0) - blue:CPTFloat(1.0) - alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(0.0) + green:CPTFloat(0.0) + blue:CPTFloat(1.0) + alpha:CPTFloat(1.0)]; }); return color; @@ -196,10 +294,10 @@ +(nonnull instancetype)cyanColor static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(0.0) - green:CPTFloat(1.0) - blue:CPTFloat(1.0) - alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(0.0) + green:CPTFloat(1.0) + blue:CPTFloat(1.0) + alpha:CPTFloat(1.0)]; }); return color; @@ -215,7 +313,7 @@ +(nonnull instancetype)yellowColor static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(1.0) blue:CPTFloat(0.0) alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(1.0) blue:CPTFloat(0.0) alpha:CPTFloat(1.0)]; }); return color; @@ -230,7 +328,7 @@ +(nonnull instancetype)magentaColor static CPTColor *color = nil; if ( nil == color ) { - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(0.0) blue:CPTFloat(1.0) alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(0.0) blue:CPTFloat(1.0) alpha:CPTFloat(1.0)]; } return color; } @@ -245,7 +343,7 @@ +(nonnull instancetype)orangeColor static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(0.5) blue:CPTFloat(0.0) alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(0.5) blue:CPTFloat(0.0) alpha:CPTFloat(1.0)]; }); return color; @@ -261,7 +359,7 @@ +(nonnull instancetype)purpleColor static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(0.5) green:CPTFloat(0.0) blue:CPTFloat(0.5) alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(0.5) green:CPTFloat(0.0) blue:CPTFloat(0.5) alpha:CPTFloat(1.0)]; }); return color; @@ -277,19 +375,22 @@ +(nonnull instancetype)brownColor static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(0.6) green:CPTFloat(0.4) blue:CPTFloat(0.2) alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(0.6) green:CPTFloat(0.4) blue:CPTFloat(0.2) alpha:CPTFloat(1.0)]; }); return color; } +#pragma mark - +#pragma mark Factory Methods + /** @brief Creates and returns a new CPTColor instance initialized with the provided @ref CGColorRef. * @param newCGColor The color to wrap. * @return A new CPTColor instance initialized with the provided @ref CGColorRef. **/ +(nonnull instancetype)colorWithCGColor:(nonnull CGColorRef)newCGColor { - return [[CPTColor alloc] initWithCGColor:newCGColor]; + return [[self alloc] initWithCGColor:newCGColor]; } /** @brief Creates and returns a new CPTColor instance initialized with the provided RGBA color components. @@ -301,7 +402,7 @@ +(nonnull instancetype)colorWithCGColor:(nonnull CGColorRef)newCGColor **/ +(nonnull instancetype)colorWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha { - return [[CPTColor alloc] initWithComponentRed:red green:green blue:blue alpha:alpha]; + return [[self alloc] initWithComponentRed:red green:green blue:blue alpha:alpha]; } /** @brief Creates and returns a new CPTColor instance initialized with the provided gray level. @@ -312,12 +413,58 @@ +(nonnull instancetype)colorWithGenericGray:(CGFloat)gray { CGFloat values[4] = { gray, gray, gray, CPTFloat(1.0) }; CGColorRef colorRef = CGColorCreate([CPTColorSpace genericRGBSpace].cgColorSpace, values); - CPTColor *color = [[CPTColor alloc] initWithCGColor:colorRef]; + CPTColor *color = [[self alloc] initWithCGColor:colorRef]; CGColorRelease(colorRef); return color; } +#if TARGET_OS_OSX + +/** @brief Creates and returns a new CPTColor instance initialized with the provided NSColor. + * + * The NSColor can be a dynamic system color or catalog color. This adds support for Dark Mode in macOS 10.14. + * + * @param newNSColor The color to wrap. + * @return A new CPTColor instance initialized with the provided NSColor. + **/ ++(nonnull instancetype)colorWithNSColor:(nonnull NSColor *)newNSColor +{ + return [[self alloc] initWithNSColor:newNSColor]; +} + +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + +/** @brief Creates and returns a new CPTColor instance initialized with the provided UIColor. + * + * The UIColor can be a dynamic system color or catalog color. This adds support for Dark Mode in iOS 13. + * + * @param newUIColor The color to wrap. + * @return A new CPTColor instance initialized with the provided UIColor. + **/ ++(nonnull instancetype)colorWithUIColor:(nonnull UIColor *)newUIColor +{ + return [[self alloc] initWithUIColor:newUIColor]; +} + +#endif + +/** @brief Creates and returns a new CPTColor instance initialized with the provided platform-native color. + * + * The color can be a dynamic system color or catalog color. This adds support for Dark Mode in iOS13. + * + * @param newColor The color to wrap. + * @return A new CPTColor instance initialized with the provided platform-native color. + **/ ++(nonnull instancetype)colorWithNativeColor:(nonnull CPTNativeColor *)newColor +{ +#if TARGET_OS_OSX + return [[self alloc] initWithNSColor:newColor]; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + return [[self alloc] initWithUIColor:newColor]; +#endif +} + #pragma mark - #pragma mark Init/Dealloc @@ -328,7 +475,7 @@ +(nonnull instancetype)colorWithGenericGray:(CGFloat)gray **/ -(nonnull instancetype)initWithCGColor:(nonnull CGColorRef)newCGColor { - if ( (self = [super init]) ) { + if ((self = [super init])) { CGColorRetain(newCGColor); cgColor = newCGColor; } @@ -357,6 +504,58 @@ -(nonnull instancetype)initWithComponentRed:(CGFloat)red green:(CGFloat)green bl return self; } +#if TARGET_OS_OSX + +/** @brief Initializes a newly allocated CPTColor object with the provided NSColor. + * + * The NSColor can be a dynamic system color or catalog color. This adds support for Dark Mode in macOS 10.14. + * + * @param newNSColor The color to wrap. + * @return The initialized CPTColor object. + **/ +-(nonnull instancetype)initWithNSColor:(nonnull NSColor *)newNSColor +{ + if ((self = [super init])) { + nsColorCache = newNSColor; + } + return self; +} + +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + +/** @brief Initializes a newly allocated CPTColor object with the provided UIColor. + * + * The UIColor can be a dynamic system color or catalog color. This adds support for Dark Mode in iOS 13. + * + * @param newUIColor The color to wrap. + * @return The initialized CPTColor object. + **/ +-(nonnull instancetype)initWithUIColor:(nonnull UIColor *)newUIColor +{ + if ((self = [super init])) { + uiColorCache = newUIColor; + } + return self; +} + +#endif + +/** @brief Initializes a newly allocated CPTColor object with the provided platform-native color. + * + * The color can be a dynamic system color or catalog color. This adds support for Dark Mode in macOS 10.14 and iOS 13. + * + * @param newColor The color to wrap. + * @return The initialized CPTColor object. + **/ +-(nonnull instancetype)initWithNativeColor:(nonnull CPTNativeColor *)newColor +{ +#if TARGET_OS_OSX + return [self initWithNSColor:newColor]; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + return [self initWithUIColor:newColor]; +#endif +} + /// @cond -(nonnull instancetype)init @@ -381,8 +580,21 @@ -(void)dealloc **/ -(nonnull instancetype)colorWithAlphaComponent:(CGFloat)alpha { +#if TARGET_OS_OSX + NSColor *theNSColor = self.nsColorCache; + if ( theNSColor ) { + NSColor *newNSColor = [theNSColor colorWithAlphaComponent:alpha]; + return [[self class] colorWithNSColor:newNSColor]; + } +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + UIColor *theUIColor = self.uiColorCache; + if ( theUIColor ) { + UIColor *newUIColor = [theUIColor colorWithAlphaComponent:alpha]; + return [[self class] colorWithUIColor:newUIColor]; + } +#endif CGColorRef newCGColor = CGColorCreateCopyWithAlpha(self.cgColor, alpha); - CPTColor *newColor = [CPTColor colorWithCGColor:newCGColor]; + CPTColor *newColor = [[self class] colorWithCGColor:newCGColor]; CGColorRelease(newCGColor); return newColor; @@ -407,6 +619,12 @@ -(BOOL)isOpaque -(void)encodeWithCoder:(nonnull NSCoder *)coder { +#if TARGET_OS_OSX + [coder encodeConditionalObject:self.nsColorCache forKey:@"CPTColor.nsColorCache"]; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + [coder encodeConditionalObject:self.uiColorCache forKey:@"CPTColor.uiColorCache"]; +#endif + CGColorRef theColor = self.cgColor; [coder encodeCGColorSpace:CGColorGetColorSpace(theColor) forKey:@"CPTColor.colorSpace"]; @@ -430,12 +648,25 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { +#if TARGET_OS_OSX + NSColor *decodedNSColor = [coder decodeObjectOfClass:[NSColor class] + forKey:@"CPTColor.nsColorCache"]; + if ( decodedNSColor ) { + nsColorCache = decodedNSColor; + } +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + UIColor *decodedUIColor = [coder decodeObjectOfClass:[UIColor class] + forKey:@"CPTColor.uiColorCache"]; + if ( decodedUIColor ) { + uiColorCache = decodedUIColor; + } +#endif CGColorSpaceRef colorSpace = [coder newCGColorSpaceDecodeForKey:@"CPTColor.colorSpace"]; size_t numberOfComponents = (size_t)[coder decodeInt64ForKey:@"CPTColor.numberOfComponents"]; - CGFloat *colorComponents = malloc( numberOfComponents * sizeof(CGFloat) ); + CGFloat *colorComponents = calloc(numberOfComponents, sizeof(CGFloat)); for ( size_t i = 0; i < numberOfComponents; i++ ) { NSString *newKey = [[NSString alloc] initWithFormat:@"CPTColor.component[%zu]", i]; @@ -451,6 +682,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark NSCopying Methods @@ -458,6 +701,19 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder -(nonnull id)copyWithZone:(nullable NSZone *)zone { +#if TARGET_OS_OSX + NSColor *nsColorCopy = [self.nsColorCache copyWithZone:zone]; + if ( nsColorCopy ) { + CPTColor *colorCopy = [[[self class] allocWithZone:zone] initWithNSColor:nsColorCopy]; + return colorCopy; + } +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + UIColor *uiColorCopy = [self.uiColorCache copyWithZone:zone]; + if ( uiColorCopy ) { + CPTColor *colorCopy = [[[self class] allocWithZone:zone] initWithUIColor:uiColorCopy]; + return colorCopy; + } +#endif CGColorRef cgColorCopy = NULL; CGColorRef myColor = self.cgColor; @@ -492,7 +748,7 @@ -(BOOL)isEqual:(nullable id)object return YES; } else if ( [object isKindOfClass:[self class]] ) { - return CGColorEqualToColor(self.cgColor, ( (CPTColor *)object ).cgColor); + return CGColorEqualToColor(self.cgColor, ((CPTColor *)object).cgColor); } else { return NO; @@ -530,9 +786,8 @@ -(NSUInteger)hash -(nullable id)debugQuickLookObject { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE return self.uiColor; - #else return self.nsColor; #endif diff --git a/framework/Source/CPTColorSpace.h b/framework/Source/CPTColorSpace.h index 6c42ceba1..bb38bb379 100644 --- a/framework/Source/CPTColorSpace.h +++ b/framework/Source/CPTColorSpace.h @@ -1,4 +1,4 @@ -@interface CPTColorSpace : NSObject +@interface CPTColorSpace : NSObject @property (nonatomic, readonly, nonnull) CGColorSpaceRef cgColorSpace; diff --git a/framework/Source/CPTColorSpace.m b/framework/Source/CPTColorSpace.m index 6daf10726..6086f09ef 100644 --- a/framework/Source/CPTColorSpace.m +++ b/framework/Source/CPTColorSpace.m @@ -32,12 +32,12 @@ +(nonnull instancetype)genericRGBSpace dispatch_once(&onceToken, ^{ CGColorSpaceRef cgSpace = NULL; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE cgSpace = CGColorSpaceCreateDeviceRGB(); #else cgSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); #endif - space = [[CPTColorSpace alloc] initWithCGColorSpace:cgSpace]; + space = [[self alloc] initWithCGColorSpace:cgSpace]; CGColorSpaceRelease(cgSpace); }); @@ -55,7 +55,7 @@ +(nonnull instancetype)genericRGBSpace **/ -(nonnull instancetype)initWithCGColorSpace:(nonnull CGColorSpaceRef)colorSpace { - if ( (self = [super init]) ) { + if ((self = [super init])) { CGColorSpaceRetain(colorSpace); cgColorSpace = colorSpace; } @@ -68,7 +68,7 @@ -(nonnull instancetype)init { CGColorSpaceRef cgSpace = NULL; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE cgSpace = CGColorSpaceCreateDeviceRGB(); #else cgSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); @@ -106,7 +106,7 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { CGColorSpaceRef colorSpace = [coder newCGColorSpaceDecodeForKey:@"CPTColorSpace.cgColorSpace"]; if ( colorSpace ) { @@ -119,4 +119,16 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/CPTColorSpaceTests.m b/framework/Source/CPTColorSpaceTests.m index 7d3f04301..40fecd110 100644 --- a/framework/Source/CPTColorSpaceTests.m +++ b/framework/Source/CPTColorSpaceTests.m @@ -11,10 +11,20 @@ -(void)testKeyedArchivingRoundTrip { CPTColorSpace *colorSpace = [CPTColorSpace genericRGBSpace]; - CPTColorSpace *newColorSpace = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:colorSpace]]; + CPTColorSpace *newColorSpace = [self archiveRoundTrip:colorSpace]; - CFDataRef iccProfile = CGColorSpaceCopyICCProfile(colorSpace.cgColorSpace); - CFDataRef newIccProfile = CGColorSpaceCopyICCProfile(newColorSpace.cgColorSpace); + CFDataRef iccProfile = NULL; + CFDataRef newIccProfile = NULL; + + // CGColorSpaceCopyICCProfile() is deprecated as of macOS 10.13 + if ( CGColorSpaceCopyICCData ) { + iccProfile = CGColorSpaceCopyICCData(colorSpace.cgColorSpace); + newIccProfile = CGColorSpaceCopyICCData(newColorSpace.cgColorSpace); + } + else { + iccProfile = CGColorSpaceCopyICCProfile(colorSpace.cgColorSpace); + newIccProfile = CGColorSpaceCopyICCProfile(newColorSpace.cgColorSpace); + } if ( iccProfile && newIccProfile ) { XCTAssertTrue([(__bridge NSData *) iccProfile isEqualToData:(__bridge NSData *)newIccProfile], @"Color spaces not equal"); diff --git a/framework/Source/CPTColorTests.m b/framework/Source/CPTColorTests.m index 73a1566aa..ea7a9fb8c 100644 --- a/framework/Source/CPTColorTests.m +++ b/framework/Source/CPTColorTests.m @@ -11,9 +11,23 @@ -(void)testKeyedArchivingRoundTrip { CPTColor *color = [CPTColor redColor]; - CPTColor *newColor = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:color]]; + CPTColor *newColor = [self archiveRoundTrip:color]; XCTAssertEqualObjects(color, newColor, @"Colors not equal"); + +#if TARGET_OS_OSX +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundeclared-selector" + // Workaround since @available macro is not there + if ( [NSColor respondsToSelector:@selector(systemRedColor)] ) { + color = [CPTColor colorWithNSColor:[NSColor systemRedColor]]; + + newColor = [self archiveRoundTrip:color]; + + XCTAssertEqualObjects(color, newColor, @"Colors not equal"); + } +#pragma clang diagnostic pop +#endif } @end diff --git a/framework/Source/CPTConstraints.h b/framework/Source/CPTConstraints.h index c8a4b89ac..d6bf75bd3 100644 --- a/framework/Source/CPTConstraints.h +++ b/framework/Source/CPTConstraints.h @@ -1,4 +1,4 @@ -@interface CPTConstraints : NSObject +@interface CPTConstraints : NSObject /// @name Factory Methods /// @{ diff --git a/framework/Source/CPTConstraints.m b/framework/Source/CPTConstraints.m index dd557e049..c9896ea25 100644 --- a/framework/Source/CPTConstraints.m +++ b/framework/Source/CPTConstraints.m @@ -1,9 +1,9 @@ #import "CPTConstraints.h" -#import "CPTDefinitions.h" -#import "NSCoderExtensions.h" #import "_CPTConstraintsFixed.h" #import "_CPTConstraintsRelative.h" +#import "CPTDefinitions.h" +#import "NSCoderExtensions.h" /** @brief Implements a one-dimensional constrained position within a given numeric range. * @@ -90,7 +90,7 @@ -(nonnull instancetype)initWithRelativeOffset:(CGFloat)newOffset /// @cond --(nonnull id)copyWithZone:(nullable NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *__unused)zone { // do nothing--implemented in subclasses return nil; @@ -103,7 +103,7 @@ -(nonnull id)copyWithZone:(nullable NSZone *)zone /// @cond --(void)encodeWithCoder:(nonnull NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *__unused)coder { // do nothing--implemented in subclasses } @@ -130,6 +130,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end #pragma mark - @@ -157,7 +169,7 @@ -(BOOL)isEqualToConstraint:(nullable CPTConstraints *)otherConstraint * @param upperBound The upper bound; must be greater than or equal to the @par{lowerBound}. * @return The calculated position. **/ --(CGFloat)positionForLowerBound:(CGFloat)lowerBound upperBound:(CGFloat)upperBound +-(CGFloat)positionForLowerBound:(CGFloat __unused)lowerBound upperBound:(CGFloat __unused)upperBound { // subclasses override to do position calculation here return CPTNAN; diff --git a/framework/Source/CPTDarkGradientThemeTests.m b/framework/Source/CPTDarkGradientThemeTests.m index 0f215c53f..71b64df7a 100644 --- a/framework/Source/CPTDarkGradientThemeTests.m +++ b/framework/Source/CPTDarkGradientThemeTests.m @@ -1,7 +1,7 @@ #import "CPTDarkGradientThemeTests.h" -#import "CPTDerivedXYGraph.h" #import "_CPTDarkGradientTheme.h" +#import "CPTDerivedXYGraph.h" @implementation CPTDarkGradientThemeTests diff --git a/framework/Source/CPTDataSourceTestCase.h b/framework/Source/CPTDataSourceTestCase.h index 444ee3c5b..3847a3cb0 100644 --- a/framework/Source/CPTDataSourceTestCase.h +++ b/framework/Source/CPTDataSourceTestCase.h @@ -6,12 +6,12 @@ @interface CPTDataSourceTestCase : CPTTestCase -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray xData; -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray yData; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *xData; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *yData; @property (nonatomic, readwrite, assign) NSUInteger nRecords; @property (nonatomic, readonly, strong, nonnull) CPTPlotRange *xRange; @property (nonatomic, readonly, strong, nonnull) CPTPlotRange *yRange; -@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotArray plots; +@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotArray *plots; -(void)buildData; diff --git a/framework/Source/CPTDataSourceTestCase.m b/framework/Source/CPTDataSourceTestCase.m index ae5a47162..1c71e3e1d 100644 --- a/framework/Source/CPTDataSourceTestCase.m +++ b/framework/Source/CPTDataSourceTestCase.m @@ -10,7 +10,7 @@ /// @cond @interface CPTDataSourceTestCase() --(nonnull CPTMutablePlotRange *)plotRangeForData:(nonnull CPTNumberArray)dataArray; +-(nonnull CPTMutablePlotRange *)plotRangeForData:(nonnull CPTNumberArray *)dataArray; @end @@ -42,7 +42,7 @@ -(void)buildData { NSUInteger recordCount = self.nRecords; - CPTMutableNumberArray arr = [NSMutableArray arrayWithCapacity:recordCount]; + CPTMutableNumberArray *arr = [NSMutableArray arrayWithCapacity:recordCount]; for ( NSUInteger i = 0; i < recordCount; i++ ) { [arr insertObject:@(i) atIndex:i]; @@ -51,7 +51,7 @@ -(void)buildData arr = [NSMutableArray arrayWithCapacity:recordCount]; for ( NSUInteger i = 0; i < recordCount; i++ ) { - [arr insertObject:@( sin(2 * M_PI * (double)i / (double)recordCount) ) atIndex:i]; + [arr insertObject:@(sin(2 * M_PI * (double)i / (double)recordCount)) atIndex:i]; } self.yData = arr; } @@ -69,7 +69,7 @@ -(nonnull CPTPlotRange *)xRange { [self buildData]; - CPTNumberArray data = self.xData; + CPTNumberArray *data = self.xData; return [self plotRangeForData:data]; } @@ -77,17 +77,17 @@ -(nonnull CPTPlotRange *)yRange { [self buildData]; - CPTNumberArray data = self.yData; + CPTNumberArray *data = self.yData; CPTMutablePlotRange *range = [self plotRangeForData:data]; if ( self.plots.count > 1 ) { - range.lengthDecimal = CPTDecimalAdd( range.lengthDecimal, CPTDecimalFromUnsignedInteger(self.plots.count) ); + range.lengthDecimal = CPTDecimalAdd(range.lengthDecimal, CPTDecimalFromUnsignedInteger(self.plots.count)); } return range; } --(nonnull CPTMutablePlotRange *)plotRangeForData:(nonnull CPTNumberArray)dataArray +-(nonnull CPTMutablePlotRange *)plotRangeForData:(nonnull CPTNumberArray *)dataArray { double min = [[dataArray valueForKeyPath:@"@min.doubleValue"] doubleValue]; double max = [[dataArray valueForKeyPath:@"@max.doubleValue"] doubleValue]; @@ -100,16 +100,16 @@ -(nonnull CPTMutablePlotRange *)plotRangeForData:(nonnull CPTNumberArray)dataArr #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.nRecords; } --(CPTNumberArray)numbersForPlot:(nonnull CPTPlot *)plot - field:(NSUInteger)fieldEnum - recordIndexRange:(NSRange)indexRange +-(nullable CPTNumberArray *)numbersForPlot:(nonnull CPTPlot *)plot + field:(NSUInteger)fieldEnum + recordIndexRange:(NSRange)indexRange { - CPTNumberArray result; + CPTNumberArray *result; switch ( fieldEnum ) { case CPTScatterPlotFieldX: @@ -120,9 +120,9 @@ -(CPTNumberArray)numbersForPlot:(nonnull CPTPlot *)plot result = [self.yData objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:indexRange]]; if ( self.plots.count > 1 ) { XCTAssertTrue([[self plots] containsObject:plot], @"Plot missing"); - CPTMutableNumberArray shiftedResult = [NSMutableArray arrayWithCapacity:result.count]; + CPTMutableNumberArray *shiftedResult = [NSMutableArray arrayWithCapacity:result.count]; for ( NSDecimalNumber *d in result ) { - [shiftedResult addObject:[d decimalNumberByAdding:[NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromDouble( CPTDataSourceTestCasePlotOffset * ([self.plots indexOfObject:plot] + 1) )]]]; + [shiftedResult addObject:[d decimalNumberByAdding:[NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromCGFloat(CPTDataSourceTestCasePlotOffset * ([self.plots indexOfObject:plot] + 1))]]]; } result = shiftedResult; diff --git a/framework/Source/CPTDebugQuickLook.h b/framework/Source/CPTDebugQuickLook.h index 4779168e7..62afb37c9 100644 --- a/framework/Source/CPTDebugQuickLook.h +++ b/framework/Source/CPTDebugQuickLook.h @@ -20,7 +20,8 @@ /** @category NSObject(CPTDebugQuickLookExtension) * @brief Debugging extensions to NSObject. **/ -@interface NSObject(CPTDebugQuickLookExtension) { +@interface NSObject(CPTDebugQuickLookExtension) +{ } @end diff --git a/framework/Source/CPTDefinitions.h b/framework/Source/CPTDefinitions.h index e586819ad..ff6f39eb7 100644 --- a/framework/Source/CPTDefinitions.h +++ b/framework/Source/CPTDefinitions.h @@ -9,13 +9,6 @@ * @brief Defined as @num{1} if the compiler and active SDK support weak references, @num{0} otherwise. **/ -/** - * @def cpt_weak - * @hideinitializer - * @brief A custom definition for automatic reference counting (ARC) weak references that falls back to - * __unsafe_unretained values on older platforms. - **/ - /** * @def cpt_weak_property * @hideinitializer @@ -34,15 +27,9 @@ #endif #if CPT_SDK_SUPPORTS_WEAK -#define cpt_weak __weak #define cpt_weak_property weak #else -#if __clang__ && (__clang_major__ >= 3) -#define cpt_weak __unsafe_unretained -#else -#define cpt_weak -#endif -#define cpt_weak_property assign +#define cpt_weak_property unsafe_unretained #endif // Deprecated method attribute @@ -53,7 +40,37 @@ * @brief Marks a method declaration as deprecated. **/ -#define cpt_deprecated __attribute__( (deprecated) ) +#define cpt_deprecated __attribute__((deprecated)) + +// Unused parameter attribute (DEBUG only) + +/** + * @def cpt_unused + * @hideinitializer + * @brief Marks a parameter value as unused only in RELEASE builds. + **/ + +#ifdef DEBUG +#define cpt_unused +#else +#define cpt_unused __unused +#endif + +// Swift wrappers + +/** + * @def cpt_swift_enum + * @hideinitializer + * @brief Marks a type definition to be imported into Swift as an enumeration. + **/ +#define cpt_swift_enum __attribute__((swift_wrapper(enum))) + +/** + * @def cpt_swift_struct + * @hideinitializer + * @brief Marks a type definition to be imported into Swift as a structure. + **/ +#define cpt_swift_struct __attribute__((swift_wrapper(struct))) // Type safety defines @@ -63,7 +80,7 @@ * @param x The number to cast. * @brief Casts a number to @ref CGFloat. **/ -#define CPTFloat(x) ( (CGFloat)(x) ) +#define CPTFloat(x) ((CGFloat)(x)) /** * @def CPTPointMake @@ -72,7 +89,7 @@ * @param y The y-coordinate of the point. * @brief A replacement for @ref CGPointMake(), casting each parameter to @ref CGFloat. **/ -#define CPTPointMake(x, y) CGPointMake( (CGFloat)(x), (CGFloat)(y) ) +#define CPTPointMake(x, y) CGPointMake((CGFloat)(x), (CGFloat)(y)) /** * @def CPTSizeMake @@ -81,7 +98,7 @@ * @param h The height of the size. * @brief A replacement for @ref CGSizeMake(), casting each parameter to @ref CGFloat. **/ -#define CPTSizeMake(w, h) CGSizeMake( (CGFloat)(w), (CGFloat)(h) ) +#define CPTSizeMake(w, h) CGSizeMake((CGFloat)(w), (CGFloat)(h)) /** * @def CPTRectMake @@ -92,7 +109,7 @@ * @param h The height of the rectangle. * @brief A replacement for @ref CGRectMake(), casting each parameter to @ref CGFloat. **/ -#define CPTRectMake(x, y, w, h) CGRectMake( (CGFloat)(x), (CGFloat)(y), (CGFloat)(w), (CGFloat)(h) ) +#define CPTRectMake(x, y, w, h) CGRectMake((CGFloat)(x), (CGFloat)(y), (CGFloat)(w), (CGFloat)(h)) /** * @def CPTRectInset @@ -102,14 +119,14 @@ * @param dy The y-offset. * @brief A replacement for @ref CGRectInset(), casting each offset parameter to @ref CGFloat. **/ -#define CPTRectInset(rect, dx, dy) CGRectInset( rect, (CGFloat)(dx), (CGFloat)(dy) ) +#define CPTRectInset(rect, dx, dy) CGRectInset(rect, (CGFloat)(dx), (CGFloat)(dy)) /** * @def CPTNAN * @hideinitializer * @brief The not-a-number constant (@NAN), cast to @ref CGFloat. **/ -#define CPTNAN ( (CGFloat)NAN ) +#define CPTNAN ((CGFloat)NAN) /** * @brief Enumeration of numeric types @@ -165,7 +182,7 @@ CPTRGBAColor; /** * @brief Enumeration of label positioning offset directions **/ -typedef NS_ENUM (NSInteger, CPTSign) { +typedef NS_CLOSED_ENUM(NSInteger, CPTSign) { CPTSignNone = 0, ///< No offset CPTSignPositive = +1, ///< Positive offset CPTSignNegative = -1 ///< Negative offset @@ -211,45 +228,57 @@ CPTEdgeInsets; extern const CPTEdgeInsets CPTEdgeInsetsZero; ///< Defines a set of stretchable image edge insets where all of the values are zero (@num{0}). +extern const NSStringDrawingOptions CPTStringDrawingOptions; ///< String drawing options used when measuring and drawing text. + /** * @brief An array of numbers. **/ -typedef NSArray *CPTNumberArray; +typedef NSArray CPTNumberArray; /** * @brief A mutable array of numbers. **/ -typedef NSMutableArray *CPTMutableNumberArray; +typedef NSMutableArray CPTMutableNumberArray; /** * @brief A set of numbers. **/ -typedef NSSet *CPTNumberSet; +typedef NSSet CPTNumberSet; /** * @brief A mutable set of numbers. **/ -typedef NSMutableSet *CPTMutableNumberSet; +typedef NSMutableSet CPTMutableNumberSet; /** * @brief An array of strings. **/ -typedef NSArray *CPTStringArray; +typedef NSArray CPTStringArray; /** * @brief A mutable array of strings. **/ -typedef NSMutableArray *CPTMutableStringArray; +typedef NSMutableArray CPTMutableStringArray; + +/** + * @brief An array of values. + **/ +typedef NSArray CPTValueArray; + +/** + * @brief A mutable array of values. + **/ +typedef NSMutableArray CPTMutableValueArray; /** * @brief An array of strings. **/ -typedef NSDictionary *CPTDictionary; +typedef NSDictionary CPTDictionary; /** * @brief A mutable array of strings. **/ -typedef NSMutableDictionary *CPTMutableDictionary; +typedef NSMutableDictionary CPTMutableDictionary; /** * @brief Render a Quick Look image into the given context. diff --git a/framework/Source/CPTDefinitions.m b/framework/Source/CPTDefinitions.m index 7b54f79ab..5af8aaada 100644 --- a/framework/Source/CPTDefinitions.m +++ b/framework/Source/CPTDefinitions.m @@ -1,3 +1,7 @@ #import "CPTDefinitions.h" const CPTEdgeInsets CPTEdgeInsetsZero = { CPTFloat(0.0), CPTFloat(0.0), CPTFloat(0.0), CPTFloat(0.0) }; + +const NSStringDrawingOptions CPTStringDrawingOptions = NSStringDrawingUsesLineFragmentOrigin | + NSStringDrawingUsesFontLeading | + NSStringDrawingTruncatesLastVisibleLine; diff --git a/framework/Source/CPTExceptions.h b/framework/Source/CPTExceptions.h index d62def47a..67eed530c 100644 --- a/framework/Source/CPTExceptions.h +++ b/framework/Source/CPTExceptions.h @@ -1,8 +1,15 @@ /// @file +#import "CPTDefinitions.h" + +/** + * @brief Custom exception type. + **/ +typedef NSString *CPTExceptionType cpt_swift_struct; + /// @name Custom Exception Identifiers /// @{ -extern NSString *__nonnull const CPTException; -extern NSString *__nonnull const CPTDataException; -extern NSString *__nonnull const CPTNumericDataException; +extern CPTExceptionType __nonnull const CPTException; +extern CPTExceptionType __nonnull const CPTDataException; +extern CPTExceptionType __nonnull const CPTNumericDataException; /// @} diff --git a/framework/Source/CPTExceptions.m b/framework/Source/CPTExceptions.m index 349839242..efe533257 100644 --- a/framework/Source/CPTExceptions.m +++ b/framework/Source/CPTExceptions.m @@ -1,5 +1,5 @@ #import "CPTExceptions.h" -NSString *const CPTException = @"CPTException"; ///< General Core Plot exceptions. -NSString *const CPTDataException = @"CPTDataException"; ///< Core Plot data exceptions. -NSString *const CPTNumericDataException = @"CPTNumericDataException"; ///< Core Plot numeric data exceptions. +CPTExceptionType const CPTException = @"CPTException"; ///< General Core Plot exceptions. +CPTExceptionType const CPTDataException = @"CPTDataException"; ///< Core Plot data exceptions. +CPTExceptionType const CPTNumericDataException = @"CPTNumericDataException"; ///< Core Plot numeric data exceptions. diff --git a/framework/Source/CPTFill.h b/framework/Source/CPTFill.h index 6ace506bf..a011c8feb 100644 --- a/framework/Source/CPTFill.h +++ b/framework/Source/CPTFill.h @@ -8,14 +8,14 @@ /** * @brief An array of fills. **/ -typedef NSArray *CPTFillArray; +typedef NSArray CPTFillArray; /** * @brief A mutable array of fills. **/ -typedef NSMutableArray *CPTMutableFillArray; +typedef NSMutableArray CPTMutableFillArray; -@interface CPTFill : NSObject +@interface CPTFill : NSObject /// @name Factory Methods /// @{ diff --git a/framework/Source/CPTFill.m b/framework/Source/CPTFill.m index 469651769..b884fdd99 100644 --- a/framework/Source/CPTFill.m +++ b/framework/Source/CPTFill.m @@ -1,11 +1,12 @@ #import "CPTFill.h" -#import "CPTColor.h" -#import "CPTImage.h" -#import "CPTPlatformSpecificFunctions.h" #import "_CPTFillColor.h" #import "_CPTFillGradient.h" #import "_CPTFillImage.h" +#import "CPTColor.h" +#import "CPTGradient.h" +#import "CPTImage.h" +#import "CPTPlatformSpecificFunctions.h" /** @brief Draws area fills. * @@ -84,7 +85,7 @@ -(nonnull instancetype)initWithImage:(nonnull CPTImage *)anImage /// @cond --(nonnull id)copyWithZone:(nullable NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *__unused)zone { // do nothing--implemented in subclasses return nil; @@ -97,25 +98,28 @@ -(nonnull id)copyWithZone:(nullable NSZone *)zone /// @cond --(void)encodeWithCoder:(nonnull NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *__unused)coder { // do nothing--implemented in subclasses } -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - id fill = [coder decodeObjectForKey:@"_CPTFillColor.fillColor"]; + id fill = [coder decodeObjectOfClass:[CPTColor class] + forKey:@"_CPTFillColor.fillColor"]; if ( fill ) { return [self initWithColor:fill]; } - id gradient = [coder decodeObjectForKey:@"_CPTFillGradient.fillGradient"]; + id gradient = [coder decodeObjectOfClass:[CPTGradient class] + forKey:@"_CPTFillGradient.fillGradient"]; if ( gradient ) { return [self initWithGradient:gradient]; } - id image = [coder decodeObjectForKey:@"_CPTFillImage.fillImage"]; + id image = [coder decodeObjectOfClass:[CPTImage class] + forKey:@"_CPTFillImage.fillImage"]; if ( image ) { return [self initWithImage:image]; } @@ -125,6 +129,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end #pragma mark - @@ -170,7 +186,7 @@ -(nullable CGColorRef)cgColor * @param rect The rectangle to draw into. * @param context The graphics context to draw into. **/ --(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context +-(void)fillRect:(CGRect __unused)rect inContext:(nonnull CGContextRef __unused)context { // do nothing--subclasses override to do drawing here } @@ -178,7 +194,7 @@ -(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context /** @brief Draws the gradient into the given graphics context clipped to the current drawing path. * @param context The graphics context to draw into. **/ --(void)fillPathInContext:(nonnull CGContextRef)context +-(void)fillPathInContext:(nonnull CGContextRef __unused)context { // do nothing--subclasses override to do drawing here } @@ -192,7 +208,7 @@ -(nullable id)debugQuickLookObject { const CGRect rect = CGRectMake(0.0, 0.0, 100.0, 100.0); - return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat scale, CGRect bounds) { + return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat __unused scale, CGRect bounds) { [self fillRect:bounds inContext:context]; }); } diff --git a/framework/Source/CPTFillTests.m b/framework/Source/CPTFillTests.m index 1ae176ccc..8029b0a73 100644 --- a/framework/Source/CPTFillTests.m +++ b/framework/Source/CPTFillTests.m @@ -1,12 +1,12 @@ #import "CPTFillTests.h" +#import "_CPTFillColor.h" +#import "_CPTFillGradient.h" +#import "_CPTFillImage.h" #import "CPTColor.h" #import "CPTFill.h" #import "CPTGradient.h" #import "CPTImage.h" -#import "_CPTFillColor.h" -#import "_CPTFillGradient.h" -#import "_CPTFillImage.h" @interface _CPTFillColor() @@ -41,7 +41,7 @@ -(void)testKeyedArchivingRoundTripColor { _CPTFillColor *fill = (_CPTFillColor *)[CPTFill fillWithColor:[CPTColor redColor]]; - _CPTFillColor *newFill = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:fill]]; + _CPTFillColor *newFill = [self archiveRoundTrip:fill toClass:[CPTFill class]]; XCTAssertEqualObjects(fill.fillColor, newFill.fillColor, @"Fill with color not equal"); } @@ -50,7 +50,7 @@ -(void)testKeyedArchivingRoundTripGradient { _CPTFillGradient *fill = (_CPTFillGradient *)[CPTFill fillWithGradient:[CPTGradient rainbowGradient]]; - _CPTFillGradient *newFill = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:fill]]; + _CPTFillGradient *newFill = [self archiveRoundTrip:fill toClass:[CPTFill class]]; XCTAssertEqualObjects(fill.fillGradient, newFill.fillGradient, @"Fill with gradient not equal"); } @@ -62,7 +62,7 @@ -(void)testKeyedArchivingRoundTripImage size_t bytesPerRow = (4 * width + 15) & ~15ul; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); #else CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); @@ -80,7 +80,7 @@ -(void)testKeyedArchivingRoundTripImage _CPTFillImage *fill = (_CPTFillImage *)[CPTFill fillWithImage:image]; - _CPTFillImage *newFill = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:fill]]; + _CPTFillImage *newFill = [self archiveRoundTrip:fill toClass:[CPTFill class]]; XCTAssertEqualObjects(fill.fillImage, newFill.fillImage, @"Fill with image not equal"); } diff --git a/framework/Source/CPTFunctionDataSource.h b/framework/Source/CPTFunctionDataSource.h index b7141b312..251919c40 100644 --- a/framework/Source/CPTFunctionDataSource.h +++ b/framework/Source/CPTFunctionDataSource.h @@ -25,14 +25,18 @@ typedef double (^CPTDataSourceBlock)(double); /// @name Factory Methods /// @{ -+(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction)function; -+(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock)block; ++(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction) function NS_SWIFT_NAME(init(for:withFunction:)); + ++(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock) block NS_SWIFT_NAME(init(for:withBlock:)); + /// @} /// @name Initialization /// @{ --(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction)function; --(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock)block; +-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction) function NS_SWIFT_NAME(init(forPlot:withFunction:)); + +-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock) block NS_SWIFT_NAME(init(forPlot:withBlock:)); + /// @} @end diff --git a/framework/Source/CPTFunctionDataSource.m b/framework/Source/CPTFunctionDataSource.m index 1aede27c1..0e038673a 100644 --- a/framework/Source/CPTFunctionDataSource.m +++ b/framework/Source/CPTFunctionDataSource.m @@ -97,7 +97,7 @@ -(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull { NSParameterAssert(function); - if ( (self = [self initForPlot:plot]) ) { + if ((self = [self initForPlot:plot])) { dataSourceFunction = function; plot.dataSource = self; @@ -114,7 +114,7 @@ -(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CP { NSParameterAssert(block); - if ( (self = [self initForPlot:plot]) ) { + if ((self = [self initForPlot:plot])) { dataSourceBlock = block; plot.dataSource = self; @@ -128,7 +128,7 @@ -(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot { NSParameterAssert([plot isKindOfClass:[CPTScatterPlot class]]); - if ( (self = [super init]) ) { + if ((self = [super init])) { dataPlot = plot; dataSourceFunction = NULL; dataSourceBlock = nil; @@ -176,7 +176,7 @@ -(void)dealloc -(void)setResolution:(CGFloat)newResolution { - NSParameterAssert( newResolution > CPTFloat(0.0) ); + NSParameterAssert(newResolution > CPTFloat(0.0)); if ( newResolution != resolution ) { resolution = newResolution; @@ -221,8 +221,8 @@ -(void)plotBoundsChanged if ( plotSpace ) { CGFloat width = plot.bounds.size.width; - if ( width > CPTFloat(0.0) ) { - NSUInteger count = (NSUInteger)lrint( ceil(width / self.resolution) ) + 1; + if ( width > CPTFloat(0.0)) { + NSUInteger count = (NSUInteger)lrint(ceil(width / self.resolution)) + 1; if ( count > self.cachedCount ) { self.dataCount = count; @@ -261,7 +261,7 @@ -(void)plotSpaceChanged if ( [cachedRange containsRange:plotRange] ) { // no new data needed } - else if ( ![cachedRange intersectsRange:plotRange] || (step == 0.0) ) { + else if ( ![cachedRange intersectsRange:plotRange] || (step == 0.0)) { self.cachedCount = 0; self.cachedPlotRange = plotRange; @@ -271,7 +271,7 @@ -(void)plotSpaceChanged if ( step > 0.0 ) { double minLimit = plotRange.minLimitDouble; if ( ![cachedRange containsDouble:minLimit] ) { - NSUInteger numPoints = (NSUInteger)lrint( ( ceil( (cachedRange.minLimitDouble - minLimit) / step ) ) ); + NSUInteger numPoints = (NSUInteger)lrint((ceil((cachedRange.minLimitDouble - minLimit) / step))); NSDecimal offset = CPTDecimalFromDouble(step * numPoints); cachedRange.locationDecimal = CPTDecimalSubtract(cachedRange.locationDecimal, offset); @@ -284,7 +284,7 @@ -(void)plotSpaceChanged double maxLimit = plotRange.maxLimitDouble; if ( ![cachedRange containsDouble:maxLimit] ) { - NSUInteger numPoints = (NSUInteger)lrint( ceil( (maxLimit - cachedRange.maxLimitDouble) / step ) ); + NSUInteger numPoints = (NSUInteger)lrint(ceil((maxLimit - cachedRange.maxLimitDouble) / step)); NSDecimal offset = CPTDecimalFromDouble(step * numPoints); cachedRange.lengthDecimal = CPTDecimalAdd(cachedRange.lengthDecimal, offset); @@ -297,7 +297,7 @@ -(void)plotSpaceChanged else { double maxLimit = plotRange.maxLimitDouble; if ( ![cachedRange containsDouble:maxLimit] ) { - NSUInteger numPoints = (NSUInteger)lrint( ceil( (cachedRange.maxLimitDouble - maxLimit) / step ) ); + NSUInteger numPoints = (NSUInteger)lrint(ceil((cachedRange.maxLimitDouble - maxLimit) / step)); NSDecimal offset = CPTDecimalFromDouble(step * numPoints); cachedRange.locationDecimal = CPTDecimalSubtract(cachedRange.locationDecimal, offset); @@ -310,7 +310,7 @@ -(void)plotSpaceChanged double minLimit = plotRange.minLimitDouble; if ( ![cachedRange containsDouble:minLimit] ) { - NSUInteger numPoints = (NSUInteger)lrint( ceil( (minLimit - cachedRange.minLimitDouble) / step ) ); + NSUInteger numPoints = (NSUInteger)lrint(ceil((minLimit - cachedRange.minLimitDouble) / step)); NSDecimal offset = CPTDecimalFromDouble(step * numPoints); cachedRange.lengthDecimal = CPTDecimalAdd(cachedRange.lengthDecimal, offset); @@ -332,7 +332,7 @@ -(void)plotSpaceChanged -(void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id)object change:(NSDictionary *)change context:(nullable void *)context { - if ( (context == CPTFunctionDataSourceKVOContext) && [keyPath isEqualToString:@"plotSpace"] && [object isEqual:self.dataPlot] ) { + if ((context == CPTFunctionDataSourceKVOContext) && [keyPath isEqualToString:@"plotSpace"] && [object isEqual:self.dataPlot] ) { CPTPlotSpace *oldSpace = change[NSKeyValueChangeOldKey]; CPTPlotSpace *newSpace = change[NSKeyValueChangeNewKey]; @@ -379,54 +379,56 @@ -(nullable CPTNumericData *)dataForPlot:(nonnull CPTPlot *)plot recordIndexRange { CPTNumericData *numericData = nil; - NSUInteger count = self.dataCount; + if ( [plot isEqual:self.dataPlot] ) { + NSUInteger count = self.dataCount; - if ( count > 0 ) { - CPTPlotRange *xRange = self.cachedPlotRange; + if ( count > 0 ) { + CPTPlotRange *xRange = self.cachedPlotRange; - if ( !xRange ) { - [self plotSpaceChanged]; - xRange = self.cachedPlotRange; - } + if ( !xRange ) { + [self plotSpaceChanged]; + xRange = self.cachedPlotRange; + } - NSMutableData *data = [[NSMutableData alloc] initWithLength:indexRange.length * 2 * sizeof(double)]; + NSMutableData *data = [[NSMutableData alloc] initWithLength:indexRange.length * 2 * sizeof(double)]; - double *xBytes = data.mutableBytes; - double *yBytes = data.mutableBytes + ( indexRange.length * sizeof(double) ); + double *xBytes = data.mutableBytes; + double *yBytes = data.mutableBytes + (indexRange.length * sizeof(double)); - double location = xRange.locationDouble; - double length = xRange.lengthDouble; - double denom = (double)( count - ( (count > 1) ? 1 : 0 ) ); + double location = xRange.locationDouble; + double length = xRange.lengthDouble; + double denom = (double)(count - ((count > 1) ? 1 : 0)); - NSUInteger lastIndex = NSMaxRange(indexRange); + NSUInteger lastIndex = NSMaxRange(indexRange); - CPTDataSourceFunction function = self.dataSourceFunction; + CPTDataSourceFunction function = self.dataSourceFunction; - if ( function ) { - for ( NSUInteger i = indexRange.location; i < lastIndex; i++ ) { - double x = location + ( (double)i / denom ) * length; + if ( function ) { + for ( NSUInteger i = indexRange.location; i < lastIndex; i++ ) { + double x = location + ((double)i / denom) * length; - *xBytes++ = x; - *yBytes++ = function(x); + *xBytes++ = x; + *yBytes++ = function(x); + } } - } - else { - CPTDataSourceBlock functionBlock = self.dataSourceBlock; + else { + CPTDataSourceBlock functionBlock = self.dataSourceBlock; - if ( functionBlock ) { - for ( NSUInteger i = indexRange.location; i < lastIndex; i++ ) { - double x = location + ( (double)i / denom ) * length; + if ( functionBlock ) { + for ( NSUInteger i = indexRange.location; i < lastIndex; i++ ) { + double x = location + ((double)i / denom) * length; - *xBytes++ = x; - *yBytes++ = functionBlock(x); + *xBytes++ = x; + *yBytes++ = functionBlock(x); + } } } - } - numericData = [CPTNumericData numericDataWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) - shape:@[@(indexRange.length), @2] - dataOrder:CPTDataOrderColumnsFirst]; + numericData = [CPTNumericData numericDataWithData:data + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) + shape:@[@(indexRange.length), @2] + dataOrder:CPTDataOrderColumnsFirst]; + } } return numericData; diff --git a/framework/Source/CPTGradient.h b/framework/Source/CPTGradient.h index 84b839e2d..b07f6d920 100644 --- a/framework/Source/CPTGradient.h +++ b/framework/Source/CPTGradient.h @@ -9,8 +9,8 @@ * @brief A structure representing one node in a linked list of RGBA colors. **/ typedef struct _CPTGradientElement { - CPTRGBAColor color; ///< Color - CGFloat position; ///< Gradient position (0 ≤ @par{position} ≤ 1) + CPTRGBAColor color; ///< Color + CGFloat position; ///< Gradient position (0 ≤ @par{position} ≤ 1) struct _CPTGradientElement *__nullable nextElement; ///< Pointer to the next CPTGradientElement in the list (last element == @NULL) } @@ -36,7 +36,7 @@ typedef NS_ENUM (NSInteger, CPTGradientType) { @class CPTColorSpace; @class CPTColor; -@interface CPTGradient : NSObject +@interface CPTGradient : NSObject @property (nonatomic, readonly, getter = isOpaque) BOOL opaque; diff --git a/framework/Source/CPTGradient.m b/framework/Source/CPTGradient.m index 10b2d4cc5..3d6028025 100644 --- a/framework/Source/CPTGradient.m +++ b/framework/Source/CPTGradient.m @@ -117,7 +117,7 @@ @implementation CPTGradient **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { [self commonInit]; self.blendingMode = CPTLinearBlendingMode; @@ -182,34 +182,32 @@ -(nonnull id)copyWithZone:(nullable NSZone *)zone -(void)encodeWithCoder:(nonnull NSCoder *)coder { - if ( coder.allowsKeyedCoding ) { - NSUInteger count = 0; - CPTGradientElement *currentElement = self.elementList; - while ( currentElement != NULL ) { - [coder encodeValueOfObjCType:@encode(CGFloat) at:&(currentElement->color.red)]; - [coder encodeValueOfObjCType:@encode(CGFloat) at:&(currentElement->color.green)]; - [coder encodeValueOfObjCType:@encode(CGFloat) at:&(currentElement->color.blue)]; - [coder encodeValueOfObjCType:@encode(CGFloat) at:&(currentElement->color.alpha)]; - [coder encodeValueOfObjCType:@encode(CGFloat) at:&(currentElement->position)]; + NSUInteger count = 0; - count++; - currentElement = currentElement->nextElement; - } - [coder encodeInteger:(NSInteger)count forKey:@"CPTGradient.elementCount"]; - [coder encodeInteger:self.blendingMode forKey:@"CPTGradient.blendingMode"]; - [coder encodeCGFloat:self.angle forKey:@"CPTGradient.angle"]; - [coder encodeInteger:self.gradientType forKey:@"CPTGradient.type"]; - [coder encodeCPTPoint:self.startAnchor forKey:@"CPTPlotSymbol.startAnchor"]; - [coder encodeCPTPoint:self.endAnchor forKey:@"CPTPlotSymbol.endAnchor"]; - } - else { - [NSException raise:NSInvalidArchiveOperationException format:@"Only supports NSKeyedArchiver coders"]; + CPTGradientElement *currentElement = self.elementList; + + while ( currentElement != NULL ) { + [coder encodeCGFloat:currentElement->color.red forKey:[NSString stringWithFormat:@"red%lu", (unsigned long)count]]; + [coder encodeCGFloat:currentElement->color.green forKey:[NSString stringWithFormat:@"green%lu", (unsigned long)count]]; + [coder encodeCGFloat:currentElement->color.blue forKey:[NSString stringWithFormat:@"blue%lu", (unsigned long)count]]; + [coder encodeCGFloat:currentElement->color.alpha forKey:[NSString stringWithFormat:@"alpha%lu", (unsigned long)count]]; + [coder encodeCGFloat:currentElement->position forKey:[NSString stringWithFormat:@"position%lu", (unsigned long)count]]; + + count++; + currentElement = currentElement->nextElement; } + + [coder encodeInteger:(NSInteger)count forKey:@"CPTGradient.elementCount"]; + [coder encodeInteger:self.blendingMode forKey:@"CPTGradient.blendingMode"]; + [coder encodeCGFloat:self.angle forKey:@"CPTGradient.angle"]; + [coder encodeInteger:self.gradientType forKey:@"CPTGradient.type"]; + [coder encodeCPTPoint:self.startAnchor forKey:@"CPTPlotSymbol.startAnchor"]; + [coder encodeCPTPoint:self.endAnchor forKey:@"CPTPlotSymbol.endAnchor"]; } -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { [self commonInit]; gradientType = (CPTGradientType)[coder decodeIntegerForKey:@"CPTGradient.type"]; @@ -220,16 +218,15 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NSUInteger count = (NSUInteger)[coder decodeIntegerForKey:@"CPTGradient.elementCount"]; - while ( count != 0 ) { + for ( NSUInteger i = 0; i < count; i++ ) { CPTGradientElement newElement; - [coder decodeValueOfObjCType:@encode(CGFloat) at:&(newElement.color.red)]; - [coder decodeValueOfObjCType:@encode(CGFloat) at:&(newElement.color.green)]; - [coder decodeValueOfObjCType:@encode(CGFloat) at:&(newElement.color.blue)]; - [coder decodeValueOfObjCType:@encode(CGFloat) at:&(newElement.color.alpha)]; - [coder decodeValueOfObjCType:@encode(CGFloat) at:&(newElement.position)]; + newElement.color.red = [coder decodeCGFloatForKey:[NSString stringWithFormat:@"red%lu", (unsigned long)i]]; + newElement.color.green = [coder decodeCGFloatForKey:[NSString stringWithFormat:@"green%lu", (unsigned long)i]]; + newElement.color.blue = [coder decodeCGFloatForKey:[NSString stringWithFormat:@"blue%lu", (unsigned long)i]]; + newElement.color.alpha = [coder decodeCGFloatForKey:[NSString stringWithFormat:@"alpha%lu", (unsigned long)i]]; + newElement.position = [coder decodeCGFloatForKey:[NSString stringWithFormat:@"position%lu", (unsigned long)i]]; - count--; [self addElement:&newElement]; } } @@ -238,6 +235,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Factory Methods @@ -730,7 +739,7 @@ -(CPTGradient *)removeColorStopAtPosition:(CGFloat)position CPTGradient *newGradient = [self copy]; CPTGradientElement removedElement = [newGradient removeElementAtPosition:position]; - if ( isnan(removedElement.position) ) { + if ( isnan(removedElement.position)) { [NSException raise:NSRangeException format:@"-[%@ removeColorStopAtPosition:]: no such colorStop at position (%g)", [self class], (double)position]; } @@ -746,7 +755,7 @@ -(CPTGradient *)removeColorStopAtIndex:(NSUInteger)idx CPTGradient *newGradient = [self copy]; CPTGradientElement removedElement = [newGradient removeElementAtIndex:idx]; - if ( isnan(removedElement.position) ) { + if ( isnan(removedElement.position)) { [NSException raise:NSRangeException format:@"-[%@ removeColorStopAtIndex:]: index (%lu) beyond bounds", [self class], (unsigned long)idx]; } @@ -765,10 +774,9 @@ -(CGColorRef)newColorStopAtIndex:(NSUInteger)idx CPTGradientElement *element = [self elementAtIndex:idx]; if ( element != NULL ) { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGFloat colorComponents[4] = { element->color.red, element->color.green, element->color.blue, element->color.alpha }; return CGColorCreate(self.colorspace.cgColorSpace, colorComponents); - #else return CGColorCreateGenericRGB(element->color.red, element->color.green, element->color.blue, element->color.alpha); #endif @@ -790,19 +798,19 @@ -(CGColorRef)newColorAtPosition:(CGFloat)position switch ( self.blendingMode ) { case CPTLinearBlendingMode: - CPTLinearEvaluation( (__bridge void *)(self), &position, components ); + CPTLinearEvaluation((__bridge void *)(self), &position, components); break; case CPTChromaticBlendingMode: - CPTChromaticEvaluation( (__bridge void *)(self), &position, components ); + CPTChromaticEvaluation((__bridge void *)(self), &position, components); break; case CPTInverseChromaticBlendingMode: - CPTInverseChromaticEvaluation( (__bridge void *)(self), &position, components ); + CPTInverseChromaticEvaluation((__bridge void *)(self), &position, components); break; } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGFloat colorComponents[4] = { components[0], components[1], components[2], components[3] }; gradientColor = CGColorCreate(self.colorspace.cgColorSpace, colorComponents); #else @@ -857,7 +865,7 @@ -(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context **/ -(void)fillPathInContext:(nonnull CGContextRef)context { - if ( !CGContextIsPathEmpty(context) ) { + if ( !CGContextIsPathEmpty(context)) { CGShadingRef myCGShading = NULL; CGContextSaveGState(context); @@ -893,8 +901,8 @@ -(BOOL)isOpaque CPTGradientElement *list = self.elementList; - while ( opaqueGradient && (list != NULL) ) { - opaqueGradient = opaqueGradient && ( list->color.alpha >= CPTFloat(1.0) ); + while ( opaqueGradient && (list != NULL)) { + opaqueGradient = opaqueGradient && (list->color.alpha >= CPTFloat(1.0)); list = list->nextElement; } @@ -994,7 +1002,7 @@ -(NSUInteger)hash return (NSUInteger)theHash; } else { - return self.blendingMode + self.gradientType; + return (NSUInteger)(self.blendingMode + self.gradientType); } } @@ -1025,13 +1033,13 @@ -(nonnull CGShadingRef)newAxialGradientInRect:(CGRect)rect // First Calculate where the beginning and ending points should be CGPoint startPoint, endPoint; - if ( self.angle == CPTFloat(0.0) ) { - startPoint = CPTPointMake( CGRectGetMinX(rect), CGRectGetMinY(rect) ); // right of rect - endPoint = CPTPointMake( CGRectGetMaxX(rect), CGRectGetMinY(rect) ); // left of rect + if ( self.angle == CPTFloat(0.0)) { + startPoint = CPTPointMake(CGRectGetMinX(rect), CGRectGetMinY(rect)); // right of rect + endPoint = CPTPointMake(CGRectGetMaxX(rect), CGRectGetMinY(rect)); // left of rect } - else if ( self.angle == CPTFloat(90.0) ) { - startPoint = CPTPointMake( CGRectGetMinX(rect), CGRectGetMinY(rect) ); // bottom of rect - endPoint = CPTPointMake( CGRectGetMinX(rect), CGRectGetMaxY(rect) ); // top of rect + else if ( self.angle == CPTFloat(90.0)) { + startPoint = CPTPointMake(CGRectGetMinX(rect), CGRectGetMinY(rect)); // bottom of rect + endPoint = CPTPointMake(CGRectGetMinX(rect), CGRectGetMaxY(rect)); // top of rect } else { // ok, we'll do the calculations now CGFloat x, y; @@ -1042,7 +1050,7 @@ -(nonnull CGShadingRef)newAxialGradientInRect:(CGRect)rect CGFloat rAngle = self.angle * CPTFloat(M_PI / 180.0); // convert the angle to radians - if ( fabs( tan(rAngle) ) <= CPTFloat(1.0) ) { // for range [-45,45], [135,225] + if ( fabs(tan(rAngle)) <= CPTFloat(1.0)) { // for range [-45,45], [135,225] x = CGRectGetWidth(rect); y = CGRectGetHeight(rect); @@ -1050,7 +1058,7 @@ -(nonnull CGShadingRef)newAxialGradientInRect:(CGRect)rect cosA = cos(rAngle); tanA = tan(rAngle); - length = x / fabs(cosA) + ( y - x * fabs(tanA) ) * fabs(sinA); + length = x / fabs(cosA) + (y - x * fabs(tanA)) * fabs(sinA); deltaX = length * cosA / CPTFloat(2.0); deltaY = length * sinA / CPTFloat(2.0); @@ -1065,7 +1073,7 @@ -(nonnull CGShadingRef)newAxialGradientInRect:(CGRect)rect cosA = cos(rAngle); tanA = tan(rAngle); - length = x / fabs(cosA) + ( y - x * fabs(tanA) ) * fabs(sinA); + length = x / fabs(cosA) + (y - x * fabs(tanA)) * fabs(sinA); deltaX = -length * sinA / CPTFloat(2.0); deltaY = length * cosA / CPTFloat(2.0); @@ -1088,15 +1096,15 @@ -(nonnull CGShadingRef)newRadialGradientInRect:(CGRect)rect context:(nonnull CGC CGPoint theStartAnchor = self.startAnchor; - startPoint = CPTPointMake( fma( CGRectGetWidth(rect), theStartAnchor.x, CGRectGetMinX(rect) ), - fma( CGRectGetHeight(rect), theStartAnchor.y, CGRectGetMinY(rect) ) ); + startPoint = CPTPointMake(fma(CGRectGetWidth(rect), theStartAnchor.x, CGRectGetMinX(rect)), + fma(CGRectGetHeight(rect), theStartAnchor.y, CGRectGetMinY(rect))); CGPoint theEndAnchor = self.endAnchor; - endPoint = CPTPointMake( fma( CGRectGetWidth(rect), theEndAnchor.x, CGRectGetMinX(rect) ), - fma( CGRectGetHeight(rect), theEndAnchor.y, CGRectGetMinY(rect) ) ); + endPoint = CPTPointMake(fma(CGRectGetWidth(rect), theEndAnchor.x, CGRectGetMinX(rect)), + fma(CGRectGetHeight(rect), theEndAnchor.y, CGRectGetMinY(rect))); startRadius = CPTFloat(-1.0); - if ( CGRectGetHeight(rect) > CGRectGetWidth(rect) ) { + if ( CGRectGetHeight(rect) > CGRectGetWidth(rect)) { scaleX = CGRectGetWidth(rect) / CGRectGetHeight(rect); startPoint.x /= scaleX; endPoint.x /= scaleX; @@ -1143,10 +1151,10 @@ -(void)setBlendingMode:(CPTGradientBlendingMode)mode static const CGFloat input_value_range[2] = { 0, 1 }; // range for the evaluator input static const CGFloat output_value_ranges[8] = { 0, 1, 0, 1, 0, 1, 0, 1 }; // ranges for the evaluator output (4 returned values) - CGFunctionRef cgFunction = CGFunctionCreate( (__bridge void *)(self), // the two transition colors - 1, input_value_range, // number of inputs (just fraction of progression) - 4, output_value_ranges, // number of outputs (4 - RGBa) - &evaluationCallbackInfo ); // info for using the evaluator function + CGFunctionRef cgFunction = CGFunctionCreate((__bridge void *)(self), // the two transition colors + 1, input_value_range, // number of inputs (just fraction of progression) + 4, output_value_ranges, // number of outputs (4 - RGBa) + &evaluationCallbackInfo); // info for using the evaluator function if ( cgFunction ) { self.gradientFunction = cgFunction; @@ -1157,9 +1165,9 @@ -(void)addElement:(nonnull CPTGradientElement *)newElement { CPTGradientElement *curElement = self.elementList; - if ( (curElement == NULL) || (newElement->position < curElement->position) ) { + if ((curElement == NULL) || (newElement->position < curElement->position)) { CPTGradientElement *tmpNext = curElement; - CPTGradientElement *newElementList = malloc( sizeof(CPTGradientElement) ); + CPTGradientElement *newElementList = calloc(1, sizeof(CPTGradientElement)); if ( newElementList ) { *newElementList = *newElement; newElementList->nextElement = tmpNext; @@ -1168,13 +1176,13 @@ -(void)addElement:(nonnull CPTGradientElement *)newElement } else { while ( curElement->nextElement != NULL && - !( (curElement->position <= newElement->position) && - (newElement->position < curElement->nextElement->position) ) ) { + !((curElement->position <= newElement->position) && + (newElement->position < curElement->nextElement->position))) { curElement = curElement->nextElement; } CPTGradientElement *tmpNext = curElement->nextElement; - curElement->nextElement = malloc( sizeof(CPTGradientElement) ); + curElement->nextElement = calloc(1, sizeof(CPTGradientElement)); *(curElement->nextElement) = *newElement; curElement->nextElement->nextElement = tmpNext; } @@ -1565,11 +1573,11 @@ void CPTTransformRGB_HSV(CGFloat *__nonnull components) // H,S,B -> R,G,B void CPTTransformHSV_RGB(CGFloat *__nonnull components) // H,S,B -> R,G,B { CGFloat R = CPTFloat(0.0), G = CPTFloat(0.0), B = CPTFloat(0.0); - CGFloat H = fmod( components[0], CPTFloat(360.0) ); // map to [0,360) + CGFloat H = fmod(components[0], CPTFloat(360.0)); // map to [0,360) CGFloat S = components[1]; CGFloat V = components[2]; - int Hi = (int)lrint( floor( H / CPTFloat(60.0) ) ) % 6; + int Hi = (int)lrint(floor(H / CPTFloat(60.0))) % 6; CGFloat f = H / CPTFloat(60.0) - Hi; CGFloat p = V * (CPTFloat(1.0) - S); CGFloat q = V * (CPTFloat(1.0) - f * S); @@ -1623,13 +1631,13 @@ void CPTTransformHSV_RGB(CGFloat *__nonnull components) // H,S,B -> R,G,B void CPTResolveHSV(CGFloat *__nonnull color1, CGFloat *__nonnull color2) // H value may be undefined (i.e. grayscale color) { // we want to fill it with a sensible value - if ( isnan(color1[0]) && isnan(color2[0]) ) { + if ( isnan(color1[0]) && isnan(color2[0])) { color1[0] = color2[0] = 0; } - else if ( isnan(color1[0]) ) { + else if ( isnan(color1[0])) { color1[0] = color2[0]; } - else if ( isnan(color2[0]) ) { + else if ( isnan(color2[0])) { color2[0] = color1[0]; } } @@ -1645,7 +1653,7 @@ -(nullable id)debugQuickLookObject { const CGRect rect = CGRectMake(0.0, 0.0, 100.0, 100.0); - return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat scale, CGRect bounds) { + return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat __unused scale, CGRect bounds) { switch ( self.gradientType ) { case CPTGradientTypeAxial: CGContextAddRect(context, bounds); diff --git a/framework/Source/CPTGradientTests.m b/framework/Source/CPTGradientTests.m index 48052b5eb..12fb1d2e3 100644 --- a/framework/Source/CPTGradientTests.m +++ b/framework/Source/CPTGradientTests.m @@ -11,7 +11,7 @@ -(void)testKeyedArchivingRoundTrip { CPTGradient *gradient = [CPTGradient rainbowGradient]; - CPTGradient *newGradient = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:gradient]]; + CPTGradient *newGradient = [self archiveRoundTrip:gradient]; XCTAssertEqualObjects(gradient, newGradient, @"Gradients not equal"); } diff --git a/framework/Source/CPTGraph.h b/framework/Source/CPTGraph.h index 9ace06c35..7c4c397ac 100644 --- a/framework/Source/CPTGraph.h +++ b/framework/Source/CPTGraph.h @@ -14,35 +14,45 @@ @class CPTTextStyle; @class CPTLayerAnnotation; +/** + * @brief Graph notification type. + **/ +typedef NSString *CPTGraphNotification cpt_swift_struct; + +/** + * @brief The userInfo dictionary keys used by CPTGraph plot space notifications. + **/ +typedef NSString *CPTGraphPlotSpaceKey cpt_swift_struct; + /// @name Graph /// @{ /** @brief Notification sent by various objects to tell the graph it should redraw itself. * @ingroup notification **/ -extern NSString *__nonnull const CPTGraphNeedsRedrawNotification; +extern CPTGraphNotification __nonnull const CPTGraphNeedsRedrawNotification NS_SWIFT_NAME(needsRedraw); /** @brief Notification sent by a graph after adding a new plot space. * @ingroup notification * * The notification userInfo dictionary will include the new plot space under the - * CPTGraphPlotSpaceNotificationKey key. + * #CPTGraphPlotSpaceNotificationKey key. **/ -extern NSString *__nonnull const CPTGraphDidAddPlotSpaceNotification; +extern CPTGraphNotification __nonnull const CPTGraphDidAddPlotSpaceNotification NS_SWIFT_NAME(didAddPlotSpace); /** @brief Notification sent by a graph after removing a plot space. * @ingroup notification * * The notification userInfo dictionary will include the removed plot space under the - * CPTGraphPlotSpaceNotificationKey key. + * #CPTGraphPlotSpaceNotificationKey key. **/ -extern NSString *__nonnull const CPTGraphDidRemovePlotSpaceNotification; +extern CPTGraphNotification __nonnull const CPTGraphDidRemovePlotSpaceNotification NS_SWIFT_NAME(didRemovePlotSpace); -/** @brief The userInfo dictionary key used by the CPTGraphDidAddPlotSpaceNotification - * and CPTGraphDidRemovePlotSpaceNotification notifications for the plot space. +/** @brief The userInfo dictionary key used by the #CPTGraphDidAddPlotSpaceNotification + * and #CPTGraphDidRemovePlotSpaceNotification notifications for the plot space. * @ingroup notification **/ -extern NSString *__nonnull const CPTGraphPlotSpaceNotificationKey; +extern CPTGraphPlotSpaceKey __nonnull const CPTGraphPlotSpaceNotificationKey; /// @} @@ -64,7 +74,7 @@ typedef NS_ENUM (NSInteger, CPTGraphLayerType) { /// @name Hosting View /// @{ -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTGraphHostingView *hostingView; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGraphHostingView *hostingView; /// @} /// @name Title @@ -81,7 +91,7 @@ typedef NS_ENUM (NSInteger, CPTGraphLayerType) { @property (nonatomic, readwrite, strong, nullable) CPTAxisSet *axisSet; @property (nonatomic, readwrite, strong, nullable) CPTPlotAreaFrame *plotAreaFrame; @property (nonatomic, readonly, nullable) CPTPlotSpace *defaultPlotSpace; -@property (nonatomic, readwrite, strong, nullable) CPTNumberArray topDownLayerOrder; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *topDownLayerOrder; /// @} /// @name Legend @@ -99,7 +109,7 @@ typedef NS_ENUM (NSInteger, CPTGraphLayerType) { /// @name Retrieving Plots /// @{ --(nonnull CPTPlotArray)allPlots; +-(nonnull CPTPlotArray *)allPlots; -(nullable CPTPlot *)plotAtIndex:(NSUInteger)idx; -(nullable CPTPlot *)plotWithIdentifier:(nullable id)identifier; /// @} @@ -116,7 +126,7 @@ typedef NS_ENUM (NSInteger, CPTGraphLayerType) { /// @name Retrieving Plot Spaces /// @{ --(nonnull CPTPlotSpaceArray)allPlotSpaces; +-(nonnull CPTPlotSpaceArray *)allPlotSpaces; -(nullable CPTPlotSpace *)plotSpaceAtIndex:(NSUInteger)idx; -(nullable CPTPlotSpace *)plotSpaceWithIdentifier:(nullable id)identifier; /// @} diff --git a/framework/Source/CPTGraph.m b/framework/Source/CPTGraph.m index a599806a0..9255efe02 100644 --- a/framework/Source/CPTGraph.m +++ b/framework/Source/CPTGraph.m @@ -17,21 +17,21 @@ /** @defgroup graphAnimation Graphs * @brief Graph properties that can be animated using Core Animation. * @if MacOnly - * @since Custom layer property animation is supported on MacOS 10.6 and later. + * @since Custom layer property animation is supported on macOS 10.6 and later. * @endif * @ingroup animation **/ -NSString *const CPTGraphNeedsRedrawNotification = @"CPTGraphNeedsRedrawNotification"; -NSString *const CPTGraphDidAddPlotSpaceNotification = @"CPTGraphDidAddPlotSpaceNotification"; -NSString *const CPTGraphDidRemovePlotSpaceNotification = @"CPTGraphDidRemovePlotSpaceNotification"; -NSString *const CPTGraphPlotSpaceNotificationKey = @"CPTGraphPlotSpaceNotificationKey"; +CPTGraphNotification const CPTGraphNeedsRedrawNotification = @"CPTGraphNeedsRedrawNotification"; +CPTGraphNotification const CPTGraphDidAddPlotSpaceNotification = @"CPTGraphDidAddPlotSpaceNotification"; +CPTGraphNotification const CPTGraphDidRemovePlotSpaceNotification = @"CPTGraphDidRemovePlotSpaceNotification"; +CPTGraphPlotSpaceKey const CPTGraphPlotSpaceNotificationKey = @"CPTGraphPlotSpaceNotificationKey"; /// @cond @interface CPTGraph() -@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotArray plots; -@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotSpaceArray plotSpaces; +@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotArray *plots; +@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotSpaceArray *plotSpaces; @property (nonatomic, readwrite, strong, nullable) CPTLayerAnnotation *titleAnnotation; @property (nonatomic, readwrite, strong, nullable) CPTLayerAnnotation *legendAnnotation; @property (nonatomic, readwrite, assign) BOOL inTitleUpdate; @@ -66,7 +66,7 @@ -(CGPoint)contentAnchorForRectAnchor:(CPTRectAnchor)anchor; **/ @implementation CPTGraph -/** @property nullable cpt_weak CPTGraphHostingView *hostingView +/** @property nullable CPTGraphHostingView *hostingView * @brief The hosting view that contains the graph. **/ @synthesize hostingView; @@ -83,12 +83,12 @@ @implementation CPTGraph /// @cond -/** @property nonnull CPTMutablePlotArray plots +/** @property nonnull CPTMutablePlotArray *plots * @brief An array of all plots associated with the graph. **/ @synthesize plots; -/** @property nonnull CPTMutablePlotSpaceArray plotSpaces +/** @property nonnull CPTMutablePlotSpaceArray *plotSpaces * @brief An array of all plot spaces associated with the graph. **/ @synthesize plotSpaces; @@ -100,7 +100,7 @@ @implementation CPTGraph **/ @dynamic defaultPlotSpace; -/** @property nullable CPTNumberArray topDownLayerOrder +/** @property nullable CPTNumberArray *topDownLayerOrder * @brief An array of graph layers to be drawn in an order other than the default. * @see CPTPlotArea @link CPTPlotArea::topDownLayerOrder topDownLayerOrder @endlink property. **/ @@ -200,7 +200,7 @@ @implementation CPTGraph **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { hostingView = nil; plots = [[NSMutableArray alloc] init]; @@ -250,7 +250,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTGraph *theLayer = (CPTGraph *)layer; hostingView = theLayer->hostingView; @@ -309,11 +309,14 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - hostingView = [coder decodeObjectForKey:@"CPTGraph.hostingView"]; - plotAreaFrame = [coder decodeObjectForKey:@"CPTGraph.plotAreaFrame"]; - - CPTPlotArray plotArray = [coder decodeObjectForKey:@"CPTGraph.plots"]; + if ((self = [super initWithCoder:coder])) { + hostingView = [coder decodeObjectOfClass:[CPTGraphHostingView class] + forKey:@"CPTGraph.hostingView"]; + plotAreaFrame = [coder decodeObjectOfClass:[CPTPlotAreaFrame class] + forKey:@"CPTGraph.plotAreaFrame"]; + + CPTPlotArray *plotArray = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTPlot class]]] + forKey:@"CPTGraph.plots"]; if ( plotArray ) { plots = [plotArray mutableCopy]; } @@ -321,24 +324,32 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder plots = [[NSMutableArray alloc] init]; } - CPTPlotSpaceArray plotSpaceArray = [coder decodeObjectForKey:@"CPTGraph.plotSpaces"]; + plotSpaces = [[NSMutableArray alloc] init]; + + CPTPlotSpaceArray *plotSpaceArray = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTPlotSpace class]]] + forKey:@"CPTGraph.plotSpaces"]; if ( plotSpaceArray ) { - plotSpaces = [plotSpaceArray mutableCopy]; - } - else { - plotSpaces = [[NSMutableArray alloc] init]; + for ( CPTPlotSpace *space in plotSpaceArray ) { + [self addPlotSpace:space]; + } } - title = [[coder decodeObjectForKey:@"CPTGraph.title"] copy]; - attributedTitle = [[coder decodeObjectForKey:@"CPTGraph.attributedTitle"] copy]; - titleTextStyle = [[coder decodeObjectForKey:@"CPTGraph.titleTextStyle"] copy]; + title = [[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTGraph.title"] copy]; + attributedTitle = [[coder decodeObjectOfClass:[NSAttributedString class] + forKey:@"CPTGraph.attributedTitle"] copy]; + titleTextStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTGraph.titleTextStyle"] copy]; titlePlotAreaFrameAnchor = (CPTRectAnchor)[coder decodeIntegerForKey:@"CPTGraph.titlePlotAreaFrameAnchor"]; titleDisplacement = [coder decodeCPTPointForKey:@"CPTGraph.titleDisplacement"]; - titleAnnotation = [coder decodeObjectForKey:@"CPTGraph.titleAnnotation"]; - legend = [coder decodeObjectForKey:@"CPTGraph.legend"]; - legendAnnotation = [coder decodeObjectForKey:@"CPTGraph.legendAnnotation"]; - legendAnchor = (CPTRectAnchor)[coder decodeIntegerForKey:@"CPTGraph.legendAnchor"]; - legendDisplacement = [coder decodeCPTPointForKey:@"CPTGraph.legendDisplacement"]; + titleAnnotation = [coder decodeObjectOfClass:[CPTLayerAnnotation class] + forKey:@"CPTGraph.titleAnnotation"]; + legend = [coder decodeObjectOfClass:[CPTLegend class] + forKey:@"CPTGraph.legend"]; + legendAnnotation = [coder decodeObjectOfClass:[CPTLayerAnnotation class] + forKey:@"CPTGraph.legendAnnotation"]; + legendAnchor = (CPTRectAnchor)[coder decodeIntegerForKey:@"CPTGraph.legendAnchor"]; + legendDisplacement = [coder decodeCPTPointForKey:@"CPTGraph.legendDisplacement"]; inTitleUpdate = NO; } @@ -347,6 +358,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing @@ -356,7 +379,43 @@ -(void)layoutAndRenderInContext:(nonnull CGContextRef)context { [self reloadDataIfNeeded]; [self.axisSet.axes makeObjectsPerformSelector:@selector(relabel)]; - [super layoutAndRenderInContext:context]; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundeclared-selector" +#if TARGET_OS_OSX + // Workaround since @available macro is not there + if ( [NSView instancesRespondToSelector:@selector(effectiveAppearance)] ) { + NSAppearance *oldAppearance = NSAppearance.currentAppearance; + NSView *view = (NSView *)self.hostingView; + NSAppearance.currentAppearance = view.effectiveAppearance; + [super layoutAndRenderInContext:context]; + NSAppearance.currentAppearance = oldAppearance; + } + else { + [super layoutAndRenderInContext:context]; + } +#else + if ( @available(iOS 13, *)) { + if ( [UITraitCollection instancesRespondToSelector:@selector(performAsCurrentTraitCollection:)] ) { + UITraitCollection *traitCollection = ((UIView *)self.hostingView).traitCollection; + if ( traitCollection ) { + [traitCollection performAsCurrentTraitCollection: ^{ + [super layoutAndRenderInContext:context]; + }]; + } + else { + [super layoutAndRenderInContext:context]; + } + } + else { + [super layoutAndRenderInContext:context]; + } + } + else { + [super layoutAndRenderInContext:context]; + } +#endif +#pragma clang diagnostic pop } /// @endcond @@ -409,7 +468,7 @@ -(void)reloadDataIfNeeded /** @brief All plots associated with the graph. * @return An array of all plots associated with the graph. **/ --(nonnull CPTPlotArray)allPlots +-(nonnull CPTPlotArray *)allPlots { return [NSArray arrayWithArray:self.plots]; } @@ -537,7 +596,7 @@ -(nullable CPTPlotSpace *)defaultPlotSpace /** @brief All plot spaces associated with the graph. * @return An array of all plot spaces associated with the graph. **/ --(nonnull CPTPlotSpaceArray)allPlotSpaces +-(nonnull CPTPlotSpaceArray *)allPlotSpaces { return [NSArray arrayWithArray:self.plotSpaces]; } @@ -759,7 +818,7 @@ -(void)setLegendAnchor:(CPTRectAnchor)newLegendAnchor -(void)setLegendDisplacement:(CGPoint)newLegendDisplacement { - if ( !CGPointEqualToPoint(newLegendDisplacement, legendDisplacement) ) { + if ( !CGPointEqualToPoint(newLegendDisplacement, legendDisplacement)) { legendDisplacement = newLegendDisplacement; self.legendAnnotation.displacement = newLegendDisplacement; } @@ -849,12 +908,12 @@ -(void)setPaddingBottom:(CGFloat)newPadding } } --(nullable CPTNumberArray)topDownLayerOrder +-(nullable CPTNumberArray *)topDownLayerOrder { return self.plotAreaFrame.plotArea.topDownLayerOrder; } --(void)setTopDownLayerOrder:(nullable CPTNumberArray)newArray +-(void)setTopDownLayerOrder:(nullable CPTNumberArray *)newArray { self.plotAreaFrame.plotArea.topDownLayerOrder = newArray; } @@ -873,7 +932,7 @@ -(void)setTitle:(nullable NSString *)newTitle if ( title ) { if ( theTitleAnnotation ) { - ( (CPTTextLayer *)theTitleAnnotation.contentLayer ).text = title; + ((CPTTextLayer *)theTitleAnnotation.contentLayer).text = title; } else { CPTPlotAreaFrame *frameLayer = self.plotAreaFrame; @@ -915,7 +974,7 @@ -(void)setAttributedTitle:(nullable NSAttributedString *)newTitle self.title = [attributedTitle.string copy]; if ( theTitleAnnotation ) { - ( (CPTTextLayer *)theTitleAnnotation.contentLayer ).attributedText = attributedTitle; + ((CPTTextLayer *)theTitleAnnotation.contentLayer).attributedText = attributedTitle; } else { CPTPlotAreaFrame *frameLayer = self.plotAreaFrame; @@ -966,7 +1025,7 @@ -(void)setTitleTextStyle:(nullable CPTTextStyle *)newStyle -(void)setTitleDisplacement:(CGPoint)newDisplace { - if ( !CGPointEqualToPoint(newDisplace, titleDisplacement) ) { + if ( !CGPointEqualToPoint(newDisplace, titleDisplacement)) { titleDisplacement = newDisplace; self.titleAnnotation.displacement = newDisplace; @@ -1106,7 +1165,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in // Plot spaces do not block events, because several spaces may need to receive // the same event sequence (e.g., dragging coordinate translation) for ( CPTPlotSpace *space in self.plotSpaces ) { - if ( !handledEvent || (handledEvent && space.isDragging) ) { + if ( !handledEvent || (handledEvent && space.isDragging)) { BOOL handled = [space pointingDeviceUpEvent:event atPoint:interactionPoint]; handledEvent |= handled; } @@ -1240,7 +1299,7 @@ -(BOOL)pointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event } } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else /** @@ -1300,6 +1359,7 @@ -(BOOL)scrollWheelEvent:(nonnull CPTNativeEvent *)event fromPoint:(CGPoint)fromP return [super scrollWheelEvent:event fromPoint:fromPoint toPoint:toPoint]; } } + #endif /// @} diff --git a/framework/Source/CPTGridLineGroup.h b/framework/Source/CPTGridLineGroup.h index 5e28da35a..bca74c4cd 100644 --- a/framework/Source/CPTGridLineGroup.h +++ b/framework/Source/CPTGridLineGroup.h @@ -4,7 +4,7 @@ @interface CPTGridLineGroup : CPTLayer -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTPlotArea *plotArea; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTPlotArea *plotArea; @property (nonatomic, readwrite) BOOL major; @end diff --git a/framework/Source/CPTGridLineGroup.m b/framework/Source/CPTGridLineGroup.m index 14800f2fe..d68f67fc4 100644 --- a/framework/Source/CPTGridLineGroup.m +++ b/framework/Source/CPTGridLineGroup.m @@ -12,7 +12,7 @@ **/ @implementation CPTGridLineGroup -/** @property nullable cpt_weak CPTPlotArea *plotArea +/** @property nullable CPTPlotArea *plotArea * @brief The plot area that this grid line group belongs to. **/ @synthesize plotArea; @@ -40,7 +40,7 @@ @implementation CPTGridLineGroup **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { plotArea = nil; major = NO; @@ -55,7 +55,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTGridLineGroup *theLayer = (CPTGridLineGroup *)layer; plotArea = theLayer->plotArea; @@ -81,15 +81,28 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - plotArea = [coder decodeObjectForKey:@"CPTGridLineGroup.plotArea"]; - major = [coder decodeBoolForKey:@"CPTGridLineGroup.major"]; + if ((self = [super initWithCoder:coder])) { + plotArea = [coder decodeObjectOfClass:[CPTPlotArea class] + forKey:@"CPTGridLineGroup.plotArea"]; + major = [coder decodeBoolForKey:@"CPTGridLineGroup.major"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing diff --git a/framework/Source/CPTGridLines.h b/framework/Source/CPTGridLines.h index 80650a0b5..f5ee267a7 100644 --- a/framework/Source/CPTGridLines.h +++ b/framework/Source/CPTGridLines.h @@ -4,7 +4,7 @@ @interface CPTGridLines : CPTLayer -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTAxis *axis; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTAxis *axis; @property (nonatomic, readwrite) BOOL major; @end diff --git a/framework/Source/CPTGridLines.m b/framework/Source/CPTGridLines.m index 510fc7c46..6c0992e6b 100644 --- a/framework/Source/CPTGridLines.m +++ b/framework/Source/CPTGridLines.m @@ -7,7 +7,7 @@ **/ @implementation CPTGridLines -/** @property nullable cpt_weak CPTAxis *axis +/** @property nullable CPTAxis *axis * @brief The axis. **/ @synthesize axis; @@ -35,7 +35,7 @@ @implementation CPTGridLines **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { axis = nil; major = NO; @@ -50,7 +50,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTGridLines *theLayer = (CPTGridLines *)layer; axis = theLayer->axis; @@ -76,8 +76,9 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - axis = [coder decodeObjectForKey:@"CPTGridLines.axis"]; + if ((self = [super initWithCoder:coder])) { + axis = [coder decodeObjectOfClass:[CPTAxis class] + forKey:@"CPTGridLines.axis"]; major = [coder decodeBoolForKey:@"CPTGridLines.major"]; } return self; @@ -85,6 +86,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing diff --git a/framework/Source/CPTImage.h b/framework/Source/CPTImage.h index 13903d24c..2708be9a5 100644 --- a/framework/Source/CPTImage.h +++ b/framework/Source/CPTImage.h @@ -1,7 +1,7 @@ #import "CPTDefinitions.h" #import "CPTPlatformSpecificDefines.h" -@interface CPTImage : NSObject +@interface CPTImage : NSObject @property (nonatomic, readwrite, copy, nullable) CPTNativeImage *nativeImage; @property (nonatomic, readwrite, assign, nullable) CGImageRef image; diff --git a/framework/Source/CPTImage.m b/framework/Source/CPTImage.m index 96af7644e..baebbc284 100644 --- a/framework/Source/CPTImage.m +++ b/framework/Source/CPTImage.m @@ -1,5 +1,6 @@ #import "CPTImage.h" +#import "CPTPlatformSpecificDefines.h" #import "CPTUtilities.h" #import "NSCoderExtensions.h" @@ -18,7 +19,7 @@ typedef NS_ENUM (NSInteger, CPTSlice) { }; typedef struct _CPTImageSlices { - CGImageRef slice[9]; ///< The image slices used to render a stretchable image. + __nonnull CGImageRef slice[9]; ///< The image slices used to render a stretchable image. } CPTImageSlices; @@ -133,9 +134,9 @@ -(nonnull instancetype)initWithContentsOfFile:(nonnull NSString *)path **/ -(nonnull instancetype)initWithCGImage:(nullable CGImageRef)anImage scale:(CGFloat)newScale { - NSParameterAssert( newScale > CPTFloat(0.0) ); + NSParameterAssert(newScale > CPTFloat(0.0)); - if ( (self = [super init]) ) { + if ((self = [super init])) { CGImageRetain(anImage); nativeImage = nil; image = anImage; @@ -214,8 +215,9 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - nativeImage = [[coder decodeObjectForKey:@"CPTImage.nativeImage"] copy]; + if ((self = [super init])) { + nativeImage = [[coder decodeObjectOfClass:[CPTNativeImage class] + forKey:@"CPTImage.nativeImage"] copy]; image = [coder newCGImageDecodeForKey:@"CPTImage.image"]; scale = [coder decodeCGFloatForKey:@"CPTImage.scale"]; tiled = [coder decodeBoolForKey:@"CPTImage.tiled"]; @@ -230,6 +232,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark NSCopying Methods @@ -357,35 +371,35 @@ -(BOOL)isEqual:(nullable id)object CGColorSpaceRef otherColorSpace = CGImageGetColorSpace(otherCGImage); if ( equalImages ) { - equalImages = ( CGImageGetWidth(selfCGImage) == CGImageGetWidth(otherCGImage) ); + equalImages = (CGImageGetWidth(selfCGImage) == CGImageGetWidth(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetHeight(selfCGImage) == CGImageGetHeight(otherCGImage) ); + equalImages = (CGImageGetHeight(selfCGImage) == CGImageGetHeight(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetBitsPerComponent(selfCGImage) == CGImageGetBitsPerComponent(otherCGImage) ); + equalImages = (CGImageGetBitsPerComponent(selfCGImage) == CGImageGetBitsPerComponent(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetBitsPerPixel(selfCGImage) == CGImageGetBitsPerPixel(otherCGImage) ); + equalImages = (CGImageGetBitsPerPixel(selfCGImage) == CGImageGetBitsPerPixel(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetBytesPerRow(selfCGImage) == CGImageGetBytesPerRow(otherCGImage) ); + equalImages = (CGImageGetBytesPerRow(selfCGImage) == CGImageGetBytesPerRow(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetBitmapInfo(selfCGImage) == CGImageGetBitmapInfo(otherCGImage) ); + equalImages = (CGImageGetBitmapInfo(selfCGImage) == CGImageGetBitmapInfo(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetShouldInterpolate(selfCGImage) == CGImageGetShouldInterpolate(otherCGImage) ); + equalImages = (CGImageGetShouldInterpolate(selfCGImage) == CGImageGetShouldInterpolate(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetRenderingIntent(selfCGImage) == CGImageGetRenderingIntent(otherCGImage) ); + equalImages = (CGImageGetRenderingIntent(selfCGImage) == CGImageGetRenderingIntent(otherCGImage)); } // decode array @@ -409,15 +423,15 @@ -(BOOL)isEqual:(nullable id)object equalImages = NO; } } - else if ( (selfDecodeArray && !otherDecodeArray) || (!selfDecodeArray && otherDecodeArray) ) { + else if ((selfDecodeArray && !otherDecodeArray) || (!selfDecodeArray && otherDecodeArray)) { equalImages = NO; } } // color space if ( equalImages ) { - equalImages = ( CGColorSpaceGetModel(selfColorSpace) == CGColorSpaceGetModel(otherColorSpace) ) && - ( CGColorSpaceGetNumberOfComponents(selfColorSpace) == CGColorSpaceGetNumberOfComponents(otherColorSpace) ); + equalImages = (CGColorSpaceGetModel(selfColorSpace) == CGColorSpaceGetModel(otherColorSpace)) && + (CGColorSpaceGetNumberOfComponents(selfColorSpace) == CGColorSpaceGetNumberOfComponents(otherColorSpace)); } // data provider @@ -458,13 +472,13 @@ -(NSUInteger)hash // Equal objects must hash the same. CGImageRef selfCGImage = self.image; - return ( CGImageGetWidth(selfCGImage) * CGImageGetHeight(selfCGImage) ) + + return (CGImageGetWidth(selfCGImage) * CGImageGetHeight(selfCGImage)) + CGImageGetBitsPerComponent(selfCGImage) + CGImageGetBitsPerPixel(selfCGImage) + CGImageGetBytesPerRow(selfCGImage) + CGImageGetBitmapInfo(selfCGImage) + CGImageGetShouldInterpolate(selfCGImage) + - CGImageGetRenderingIntent(selfCGImage) * (NSUInteger)self.scale; + (NSUInteger)(CGImageGetRenderingIntent(selfCGImage) * self.scale); } /// @endcond @@ -509,10 +523,10 @@ -(nullable CPTNativeImage *)nativeImage if ( !nativeImage ) { CGImageRef imageRef = self.image; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGFloat theScale = self.scale; - if ( imageRef && ( theScale > CPTFloat(0.0) ) ) { + if ( imageRef && (theScale > CPTFloat(0.0))) { nativeImage = [UIImage imageWithCGImage:imageRef scale:theScale orientation:UIImageOrientationUp]; @@ -522,7 +536,7 @@ -(nullable CPTNativeImage *)nativeImage nativeImage = [[NSImage alloc] initWithCGImage:imageRef size:NSZeroSize]; } else { - CGSize imageSize = CGSizeMake( CGImageGetWidth(imageRef), CGImageGetHeight(imageRef) ); + CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:(NSInteger)imageSize.width @@ -551,7 +565,7 @@ -(nullable CPTNativeImage *)nativeImage -(void)setScale:(CGFloat)newScale { - NSParameterAssert( newScale > CPTFloat(0.0) ); + NSParameterAssert(newScale > CPTFloat(0.0)); if ( newScale != scale ) { scale = newScale; @@ -560,7 +574,7 @@ -(void)setScale:(CGFloat)newScale -(void)setEdgeInsets:(CPTEdgeInsets)newEdgeInsets { - if ( !CPTEdgeInsetsEqualToEdgeInsets(edgeInsets, newEdgeInsets) ) { + if ( !CPTEdgeInsetsEqualToEdgeInsets(edgeInsets, newEdgeInsets)) { edgeInsets = newEdgeInsets; CPTImageSlices imageSlices = {}; @@ -578,7 +592,10 @@ -(void)setSlices:(CPTImageSlices)newSlices for ( NSUInteger i = 0; i < 9; i++ ) { CGImageRelease(slices.slice[i]); - slices.slice[i] = CGImageRetain(newSlices.slice[i]); + CGImageRef slice = CGImageRetain(newSlices.slice[i]); + if ( slice ) { + slices.slice[i] = slice; + } } } @@ -614,47 +631,56 @@ -(void)makeImageSlices } // top row - if ( capTop > CPTFloat(0.0) ) { - if ( capLeft > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceTopLeft] = CGImageCreateWithImageInRect( theImage, CPTRectMake(0.0, 0.0, capLeft, capTop) ); + if ( capTop > CPTFloat(0.0)) { + if ( capLeft > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(0.0, 0.0, capLeft, capTop)); + imageSlices.slice[CPTSliceTopLeft] = sliceImage; } - if ( centerSize.width > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceTop] = CGImageCreateWithImageInRect( theImage, CPTRectMake(capLeft, 0.0, centerSize.width, capTop) ); + if ( centerSize.width > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(capLeft, 0.0, centerSize.width, capTop)); + imageSlices.slice[CPTSliceTop] = sliceImage; } - if ( capRight > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceTopRight] = CGImageCreateWithImageInRect( theImage, CPTRectMake(width - capRight, 0.0, capRight, capTop) ); + if ( capRight > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(width - capRight, 0.0, capRight, capTop)); + imageSlices.slice[CPTSliceTopRight] = sliceImage; } } // middle row - if ( centerSize.height > CPTFloat(0.0) ) { - if ( capLeft > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceLeft] = CGImageCreateWithImageInRect( theImage, CPTRectMake(0.0, capTop, capLeft, centerSize.height) ); + if ( centerSize.height > CPTFloat(0.0)) { + if ( capLeft > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(0.0, capTop, capLeft, centerSize.height)); + imageSlices.slice[CPTSliceLeft] = sliceImage; } - if ( centerSize.width > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceMiddle] = CGImageCreateWithImageInRect( theImage, CPTRectMake(capLeft, capTop, centerSize.width, centerSize.height) ); + if ( centerSize.width > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(capLeft, capTop, centerSize.width, centerSize.height)); + imageSlices.slice[CPTSliceMiddle] = sliceImage; } - if ( capRight > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceRight] = CGImageCreateWithImageInRect( theImage, CPTRectMake(width - capRight, capTop, capRight, centerSize.height) ); + if ( capRight > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(width - capRight, capTop, capRight, centerSize.height)); + imageSlices.slice[CPTSliceRight] = sliceImage; } } // bottom row - if ( capBottom > CPTFloat(0.0) ) { - if ( capLeft > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceBottomLeft] = CGImageCreateWithImageInRect( theImage, CPTRectMake(0.0, height - capBottom, capLeft, capBottom) ); + if ( capBottom > CPTFloat(0.0)) { + if ( capLeft > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(0.0, height - capBottom, capLeft, capBottom)); + imageSlices.slice[CPTSliceBottomLeft] = sliceImage; } - if ( centerSize.width > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceBottom] = CGImageCreateWithImageInRect( theImage, CPTRectMake(capLeft, height - capBottom, centerSize.width, capBottom) ); + if ( centerSize.width > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(capLeft, height - capBottom, centerSize.width, capBottom)); + imageSlices.slice[CPTSliceBottom] = sliceImage; } - if ( capRight > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceBottomRight] = CGImageCreateWithImageInRect( theImage, CPTRectMake(width - capRight, height - capBottom, capRight, capBottom) ); + if ( capRight > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(width - capRight, height - capBottom, capRight, capBottom)); + imageSlices.slice[CPTSliceBottomRight] = sliceImage; } } @@ -666,7 +692,7 @@ -(void)makeImageSlices -(void)drawImage:(nonnull CGImageRef)theImage inContext:(nonnull CGContextRef)context rect:(CGRect)rect scaleRatio:(CGFloat)scaleRatio { - if ( theImage && ( rect.size.width > CPTFloat(0.0) ) && ( rect.size.height > CPTFloat(0.0) ) ) { + if ( theImage && (rect.size.width > CPTFloat(0.0)) && (rect.size.height > CPTFloat(0.0))) { CGFloat imageScale = self.scale; CGContextSaveGState(context); @@ -709,26 +735,23 @@ -(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context CGFloat lastScale = self.lastDrawnScale; CGFloat contextScale = CPTFloat(1.0); - if ( rect.size.height != CPTFloat(0.0) ) { + if ( rect.size.height != CPTFloat(0.0)) { CGRect deviceRect = CGContextConvertRectToDeviceSpace(context, rect); contextScale = deviceRect.size.height / rect.size.height; } // generate a Core Graphics image if needed - if ( !theImage || (contextScale != lastScale) ) { + if ( !theImage || (contextScale != lastScale)) { CPTNativeImage *theNativeImage = self.nativeImage; if ( theNativeImage ) { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE theImage = theNativeImage.CGImage; self.scale = theNativeImage.scale; #else - NSSize imageSize = theNativeImage.size; - CGFloat sizeScale = CPTFloat(theNativeImage.representations.count + 1) - contextScale; - imageSize.width /= sizeScale; - imageSize.height /= sizeScale; - + NSSize imageSize = theNativeImage.size; NSRect drawingRect = NSMakeRect(0.0, 0.0, imageSize.width, imageSize.height); + theImage = [theNativeImage CGImageForProposedRect:&drawingRect context:[NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:NO] hints:nil]; @@ -738,13 +761,17 @@ -(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context } } + if ( !theImage ) { + return; + } + // draw the image CGFloat imageScale = self.scale; CGFloat scaleRatio = contextScale / imageScale; CPTEdgeInsets insets = self.edgeInsets; - if ( CPTEdgeInsetsEqualToEdgeInsets(insets, CPTEdgeInsetsZero) ) { + if ( CPTEdgeInsetsEqualToEdgeInsets(insets, CPTEdgeInsetsZero)) { [self drawImage:theImage inContext:context rect:rect scaleRatio:scaleRatio]; } else { @@ -759,7 +786,7 @@ -(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context } // create new slices if needed - if ( !hasSlices || (contextScale != lastScale) ) { + if ( !hasSlices || (contextScale != lastScale)) { [self makeImageSlices]; imageSlices = self.slices; } diff --git a/framework/Source/CPTImageTests.m b/framework/Source/CPTImageTests.m index d17af8461..b106c54f2 100644 --- a/framework/Source/CPTImageTests.m +++ b/framework/Source/CPTImageTests.m @@ -14,7 +14,7 @@ -(void)testKeyedArchivingRoundTrip size_t bytesPerRow = (4 * width + 15) & ~15ul; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); #else CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); @@ -30,7 +30,7 @@ -(void)testKeyedArchivingRoundTrip CGColorSpaceRelease(colorSpace); CGImageRelease(cgImage); - CPTImage *newImage = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:image]]; + CPTImage *newImage = [self archiveRoundTrip:image]; XCTAssertEqualObjects(image, newImage, @"Images not equal"); } diff --git a/framework/Source/CPTLayer.h b/framework/Source/CPTLayer.h index fcbe15701..4cca2d8b4 100644 --- a/framework/Source/CPTLayer.h +++ b/framework/Source/CPTLayer.h @@ -5,43 +5,86 @@ /// @file @class CPTGraph; +@class CPTLayer; @class CPTShadow; +/** + * @brief Layer notification type. + **/ +typedef NSString *CPTLayerNotification cpt_swift_struct; + /// @name Layout /// @{ /** @brief Notification sent by all layers when the layer @link CALayer::bounds bounds @endlink change. * @ingroup notification **/ -extern NSString *__nonnull const CPTLayerBoundsDidChangeNotification; +extern CPTLayerNotification __nonnull const CPTLayerBoundsDidChangeNotification NS_SWIFT_NAME(boundsDidChange); /// @} +/** + * @brief An array of CPTLayer objects. + **/ +typedef NSArray CPTLayerArray; + +/** + * @brief A mutable array of CPTLayer objects. + **/ +typedef NSMutableArray CPTMutableLayerArray; + +/** + * @brief A set of CPTLayer objects. + **/ +typedef NSSet CPTLayerSet; + +/** + * @brief A mutable set of CPTLayer objects. + **/ +typedef NSMutableSet CPTMutableLayerSet; + /** * @brief An array of CALayer objects. **/ -typedef NSArray *CPTSublayerArray; +typedef NSArray CPTSublayerArray; /** * @brief A mutable array of CALayer objects. **/ -typedef NSMutableArray *CPTMutableSublayerArray; +typedef NSMutableArray CPTMutableSublayerArray; /** * @brief A set of CALayer objects. **/ -typedef NSSet *CPTSublayerSet; +typedef NSSet CPTSublayerSet; /** * @brief A mutable set of CALayer objects. **/ -typedef NSMutableSet *CPTMutableSublayerSet; +typedef NSMutableSet CPTMutableSublayerSet; + +#pragma mark - + +/** + * @brief Layer delegate. + **/ +#if ((TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 100000)) \ + || (TARGET_OS_MAC && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101200)) +// CALayerDelegate is defined by Core Animation in iOS 10.0+, macOS 10.12+, and tvOS 10.0+ +@protocol CPTLayerDelegate +#else +@protocol CPTLayerDelegate +#endif + +@end + +#pragma mark - -@interface CPTLayer : CALayer +@interface CPTLayer : CALayer /// @name Graph /// @{ -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTGraph *graph; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGraph *graph; /// @} /// @name Padding @@ -76,7 +119,7 @@ typedef NSMutableSet *CPTMutableSublayerSet; /// @name Layout /// @{ -@property (nonatomic, readonly, nullable) CPTSublayerSet sublayersExcludedFromAutomaticLayout; +@property (nonatomic, readonly, nullable) CPTSublayerSet *sublayersExcludedFromAutomaticLayout; /// @} /// @name Initialization @@ -88,6 +131,7 @@ typedef NSMutableSet *CPTMutableSublayerSet; /// @name Drawing /// @{ +-(void)setNeedsDisplayAllLayers; -(void)renderAsVectorInContext:(nonnull CGContextRef)context; -(void)recursivelyRenderInContext:(nonnull CGContextRef)context; -(void)layoutAndRenderInContext:(nonnull CGContextRef)context; diff --git a/framework/Source/CPTLayer.m b/framework/Source/CPTLayer.m index 41094b182..eef476e9a 100644 --- a/framework/Source/CPTLayer.m +++ b/framework/Source/CPTLayer.m @@ -6,17 +6,16 @@ #import "CPTPlatformSpecificFunctions.h" #import "CPTShadow.h" #import "CPTUtilities.h" -#import "CorePlotProbes.h" #import "NSCoderExtensions.h" #import #import -NSString *const CPTLayerBoundsDidChangeNotification = @"CPTLayerBoundsDidChangeNotification"; +CPTLayerNotification const CPTLayerBoundsDidChangeNotification = @"CPTLayerBoundsDidChangeNotification"; /** @defgroup animation Animatable Properties * @brief Custom layer properties that can be animated using Core Animation. * @if MacOnly - * @since Custom layer property animation is supported on MacOS 10.6 and later. + * @since Custom layer property animation is supported on macOS 10.6 and later. * @endif **/ @@ -51,7 +50,7 @@ -(nonnull NSString *)subLayersAtIndex:(NSUInteger)idx; **/ @implementation CPTLayer -/** @property nullable cpt_weak CPTGraph *graph +/** @property nullable CPTGraph *graph * @brief The graph for the layer. **/ @synthesize graph; @@ -123,7 +122,7 @@ @implementation CPTLayer **/ @dynamic sublayerMaskingPath; -/** @property nullable CPTSublayerSet sublayersExcludedFromAutomaticLayout +/** @property nullable CPTSublayerSet *sublayersExcludedFromAutomaticLayout * @brief A set of sublayers that should be excluded from the automatic sublayer layout. **/ @dynamic sublayersExcludedFromAutomaticLayout; @@ -167,7 +166,7 @@ @implementation CPTLayer **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super init]) ) { + if ((self = [super init])) { paddingLeft = CPTFloat(0.0); paddingTop = CPTFloat(0.0); paddingRight = CPTFloat(0.0); @@ -208,7 +207,7 @@ -(nonnull instancetype)init */ -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTLayer *theLayer = (CPTLayer *)layer; paddingLeft = theLayer->paddingLeft; @@ -269,15 +268,18 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { + if ((self = [super initWithCoder:coder])) { paddingLeft = [coder decodeCGFloatForKey:@"CPTLayer.paddingLeft"]; paddingTop = [coder decodeCGFloatForKey:@"CPTLayer.paddingTop"]; paddingRight = [coder decodeCGFloatForKey:@"CPTLayer.paddingRight"]; paddingBottom = [coder decodeCGFloatForKey:@"CPTLayer.paddingBottom"]; masksToBorder = [coder decodeBoolForKey:@"CPTLayer.masksToBorder"]; - shadow = [[coder decodeObjectForKey:@"CPTLayer.shadow"] copy]; - graph = [coder decodeObjectForKey:@"CPTLayer.graph"]; - identifier = [[coder decodeObjectForKey:@"CPTLayer.identifier"] copy]; + shadow = [[coder decodeObjectOfClass:[CPTShadow class] + forKey:@"CPTLayer.shadow"] copy]; + graph = [coder decodeObjectOfClass:[CPTGraph class] + forKey:@"CPTLayer.graph"]; + identifier = [[coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTLayer.identifier"] copy]; renderingRecursively = NO; outerBorderPath = NULL; @@ -286,12 +288,24 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Animation /// @cond --(id)actionForKey:(nonnull NSString *)aKey +-(id)actionForKey:(nonnull NSString *__unused)aKey { return nil; } @@ -309,7 +323,42 @@ -(void)display return; } else { - [super display]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundeclared-selector" +#if TARGET_OS_OSX + // Workaround since @available macro is not there + + if ( [NSView instancesRespondToSelector:@selector(effectiveAppearance)] ) { + NSAppearance *oldAppearance = NSAppearance.currentAppearance; + NSAppearance.currentAppearance = ((NSView *)self.graph.hostingView).effectiveAppearance; + [super display]; + NSAppearance.currentAppearance = oldAppearance; + } + else { + [super display]; + } +#else + if ( @available(iOS 13, *)) { + if ( [UITraitCollection instancesRespondToSelector:@selector(performAsCurrentTraitCollection:)] ) { + UITraitCollection *traitCollection = ((UIView *)self.graph.hostingView).traitCollection; + if ( traitCollection ) { + [traitCollection performAsCurrentTraitCollection: ^{ + [super display]; + }]; + } + else { + [super display]; + } + } + else { + [super display]; + } + } + else { + [super display]; + } +#endif +#pragma clang diagnostic pop } } @@ -327,6 +376,23 @@ -(void)drawInContext:(nonnull CGContextRef)context /// @endcond +/** + * @brief Recursively marks this layer and all sublayers as needing to be redrawn. + **/ +-(void)setNeedsDisplayAllLayers +{ + [self setNeedsDisplay]; + + for ( CPTLayer *subLayer in self.sublayers ) { + if ( [subLayer respondsToSelector:@selector(setNeedsDisplayAllLayers)] ) { + [subLayer setNeedsDisplayAllLayers]; + } + else { + [subLayer setNeedsDisplay]; + } + } +} + /** @brief Draws layer content into the provided graphics context. * * This method replaces the CALayer @link CALayer::drawInContext: -drawInContext: @endlink method @@ -367,7 +433,7 @@ -(void)recursivelyRenderInContext:(nonnull CGContextRef)context self.renderingRecursively = NO; // render sublayers - CPTSublayerArray sublayersCopy = [self.sublayers copy]; + CPTSublayerArray *sublayersCopy = [self.sublayers copy]; for ( CALayer *currentSublayer in sublayersCopy ) { CGContextSaveGState(context); @@ -398,15 +464,15 @@ -(void)recursivelyRenderInContext:(nonnull CGContextRef)context -(void)applyTransform:(CATransform3D)transform3D toContext:(nonnull CGContextRef)context { - if ( !CATransform3DIsIdentity(transform3D) ) { - if ( CATransform3DIsAffine(transform3D) ) { + if ( !CATransform3DIsIdentity(transform3D)) { + if ( CATransform3DIsAffine(transform3D)) { CGRect selfBounds = self.bounds; CGPoint anchorPoint = self.anchorPoint; CGPoint anchorOffset = CPTPointMake(anchorOffset.x = selfBounds.origin.x + anchorPoint.x * selfBounds.size.width, anchorOffset.y = selfBounds.origin.y + anchorPoint.y * selfBounds.size.height); CGAffineTransform affineTransform = CGAffineTransformMakeTranslation(-anchorOffset.x, -anchorOffset.y); - affineTransform = CGAffineTransformConcat( affineTransform, CATransform3DGetAffineTransform(transform3D) ); + affineTransform = CGAffineTransformConcat(affineTransform, CATransform3DGetAffineTransform(transform3D)); affineTransform = CGAffineTransformTranslate(affineTransform, anchorOffset.x, anchorOffset.y); CGRect transformedBounds = CGRectApplyAffineTransform(selfBounds, affineTransform); @@ -434,7 +500,7 @@ -(void)layoutAndRenderInContext:(nonnull CGContextRef)context -(nonnull NSData *)dataForPDFRepresentationOfLayer { NSMutableData *pdfData = [[NSMutableData alloc] init]; - CGDataConsumerRef dataConsumer = CGDataConsumerCreateWithCFData( (__bridge CFMutableDataRef)pdfData ); + CGDataConsumerRef dataConsumer = CGDataConsumerCreateWithCFData((__bridge CFMutableDataRef)pdfData); const CGRect mediaBox = CPTRectMake(0.0, 0.0, self.bounds.size.width, self.bounds.size.height); CGContextRef pdfContext = CGPDFContextCreate(dataConsumer, &mediaBox, NULL); @@ -460,32 +526,33 @@ -(nonnull NSData *)dataForPDFRepresentationOfLayer /// @name User Interaction /// @{ --(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)interactionPoint { return NO; } --(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)interactionPoint { return NO; } --(BOOL)pointingDeviceDraggedEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDraggedEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)interactionPoint { return NO; } --(BOOL)pointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event +-(BOOL)pointingDeviceCancelledEvent:(nonnull CPTNativeEvent *__unused)event { return NO; } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else --(BOOL)scrollWheelEvent:(nonnull CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint +-(BOOL)scrollWheelEvent:(nonnull CPTNativeEvent *__unused)event fromPoint:(CGPoint __unused)fromPoint toPoint:(CGPoint __unused)toPoint { return NO; } + #endif /// @} @@ -506,38 +573,38 @@ -(void)pixelAlign CGPoint newPosition; - if ( CGSizeEqualToSize(boundsSize, frameSize) ) { // rotated 0° or 180° + if ( CGSizeEqualToSize(boundsSize, frameSize)) { // rotated 0° or 180° CGPoint anchor = self.anchorPoint; CGPoint newAnchor = CGPointMake(boundsSize.width * anchor.x, boundsSize.height * anchor.y); - if ( scale == CPTFloat(1.0) ) { - newPosition.x = ceil( currentPosition.x - newAnchor.x - CPTFloat(0.5) ) + newAnchor.x; - newPosition.y = ceil( currentPosition.y - newAnchor.y - CPTFloat(0.5) ) + newAnchor.y; + if ( scale == CPTFloat(1.0)) { + newPosition.x = ceil(currentPosition.x - newAnchor.x - CPTFloat(0.5)) + newAnchor.x; + newPosition.y = ceil(currentPosition.y - newAnchor.y - CPTFloat(0.5)) + newAnchor.y; } else { - newPosition.x = ceil( (currentPosition.x - newAnchor.x) * scale - CPTFloat(0.5) ) / scale + newAnchor.x; - newPosition.y = ceil( (currentPosition.y - newAnchor.y) * scale - CPTFloat(0.5) ) / scale + newAnchor.y; + newPosition.x = ceil((currentPosition.x - newAnchor.x) * scale - CPTFloat(0.5)) / scale + newAnchor.x; + newPosition.y = ceil((currentPosition.y - newAnchor.y) * scale - CPTFloat(0.5)) / scale + newAnchor.y; } } - else if ( (boundsSize.width == frameSize.height) && (boundsSize.height == frameSize.width) ) { // rotated 90° or 270° + else if ((boundsSize.width == frameSize.height) && (boundsSize.height == frameSize.width)) { // rotated 90° or 270° CGPoint anchor = self.anchorPoint; CGPoint newAnchor = CGPointMake(boundsSize.height * anchor.y, boundsSize.width * anchor.x); - if ( scale == CPTFloat(1.0) ) { - newPosition.x = ceil( currentPosition.x - newAnchor.x - CPTFloat(0.5) ) + newAnchor.x; - newPosition.y = ceil( currentPosition.y - newAnchor.y - CPTFloat(0.5) ) + newAnchor.y; + if ( scale == CPTFloat(1.0)) { + newPosition.x = ceil(currentPosition.x - newAnchor.x - CPTFloat(0.5)) + newAnchor.x; + newPosition.y = ceil(currentPosition.y - newAnchor.y - CPTFloat(0.5)) + newAnchor.y; } else { - newPosition.x = ceil( (currentPosition.x - newAnchor.x) * scale - CPTFloat(0.5) ) / scale + newAnchor.x; - newPosition.y = ceil( (currentPosition.y - newAnchor.y) * scale - CPTFloat(0.5) ) / scale + newAnchor.y; + newPosition.x = ceil((currentPosition.x - newAnchor.x) * scale - CPTFloat(0.5)) / scale + newAnchor.x; + newPosition.y = ceil((currentPosition.y - newAnchor.y) * scale - CPTFloat(0.5)) / scale + newAnchor.y; } } else { - if ( scale == CPTFloat(1.0) ) { + if ( scale == CPTFloat(1.0)) { newPosition.x = round(currentPosition.x); newPosition.y = round(currentPosition.y); } @@ -594,7 +661,7 @@ -(CGSize)shadowMargin CGSize shadowOffset = myShadow.shadowOffset; CGFloat shadowRadius = myShadow.shadowBlurRadius; - margin = CGSizeMake( ceil( ABS(shadowOffset.width) + ABS(shadowRadius) ), ceil( ABS(shadowOffset.height) + ABS(shadowRadius) ) ); + margin = CGSizeMake(ceil(ABS(shadowOffset.width) + ABS(shadowRadius)), ceil(ABS(shadowOffset.height) + ABS(shadowRadius))); } return margin; @@ -615,7 +682,7 @@ -(void)layoutSublayers { CGRect selfBounds = self.bounds; - CPTSublayerArray mySublayers = self.sublayers; + CPTSublayerArray *mySublayers = self.sublayers; if ( mySublayers.count > 0 ) { CGFloat leftPadding, topPadding, rightPadding, bottomPadding; @@ -624,18 +691,18 @@ -(void)layoutSublayers CGSize subLayerSize = selfBounds.size; subLayerSize.width -= leftPadding + rightPadding; - subLayerSize.width = MAX( subLayerSize.width, CPTFloat(0.0) ); + subLayerSize.width = MAX(subLayerSize.width, CPTFloat(0.0)); subLayerSize.width = round(subLayerSize.width); subLayerSize.height -= topPadding + bottomPadding; - subLayerSize.height = MAX( subLayerSize.height, CPTFloat(0.0) ); + subLayerSize.height = MAX(subLayerSize.height, CPTFloat(0.0)); subLayerSize.height = round(subLayerSize.height); CGRect subLayerFrame; - subLayerFrame.origin = CGPointMake( round(leftPadding), round(bottomPadding) ); + subLayerFrame.origin = CGPointMake(round(leftPadding), round(bottomPadding)); subLayerFrame.size = subLayerSize; - CPTSublayerSet excludedSublayers = self.sublayersExcludedFromAutomaticLayout; - Class layerClass = [CPTLayer class]; + CPTSublayerSet *excludedSublayers = self.sublayersExcludedFromAutomaticLayout; + Class layerClass = [CPTLayer class]; for ( CALayer *subLayer in mySublayers ) { if ( [subLayer isKindOfClass:layerClass] && ![excludedSublayers containsObject:subLayer] ) { subLayer.frame = subLayerFrame; @@ -648,7 +715,7 @@ -(void)layoutSublayers /// @cond --(nullable CPTSublayerSet)sublayersExcludedFromAutomaticLayout +-(nullable CPTSublayerSet *)sublayersExcludedFromAutomaticLayout { return nil; } @@ -674,7 +741,7 @@ -(void)sublayerMarginLeft:(nonnull CGFloat *)left top:(nonnull CGFloat *)top rig /// @cond --(void)setSublayers:(nullable CPTSublayerArray)sublayers +-(void)setSublayers:(nullable CPTSublayerArray *)sublayers { super.sublayers = sublayers; @@ -682,7 +749,7 @@ -(void)setSublayers:(nullable CPTSublayerArray)sublayers CGFloat scale = self.contentsScale; for ( CALayer *layer in sublayers ) { if ( [layer isKindOfClass:layerClass] ) { - ( (CPTLayer *)layer ).contentsScale = scale; + ((CPTLayer *)layer).contentsScale = scale; } } } @@ -692,7 +759,7 @@ -(void)addSublayer:(nonnull CALayer *)layer [super addSublayer:layer]; if ( [layer isKindOfClass:[CPTLayer class]] ) { - ( (CPTLayer *)layer ).contentsScale = self.contentsScale; + ((CPTLayer *)layer).contentsScale = self.contentsScale; } } @@ -701,7 +768,7 @@ -(void)insertSublayer:(nonnull CALayer *)layer atIndex:(unsigned)idx [super insertSublayer:layer atIndex:idx]; if ( [layer isKindOfClass:[CPTLayer class]] ) { - ( (CPTLayer *)layer ).contentsScale = self.contentsScale; + ((CPTLayer *)layer).contentsScale = self.contentsScale; } } @@ -710,7 +777,7 @@ -(void)insertSublayer:(nonnull CALayer *)layer below:(nullable CALayer *)sibling [super insertSublayer:layer below:sibling]; if ( [layer isKindOfClass:[CPTLayer class]] ) { - ( (CPTLayer *)layer ).contentsScale = self.contentsScale; + ((CPTLayer *)layer).contentsScale = self.contentsScale; } } @@ -719,7 +786,7 @@ -(void)insertSublayer:(nonnull CALayer *)layer above:(nullable CALayer *)sibling [super insertSublayer:layer above:sibling]; if ( [layer isKindOfClass:[CPTLayer class]] ) { - ( (CPTLayer *)layer ).contentsScale = self.contentsScale; + ((CPTLayer *)layer).contentsScale = self.contentsScale; } } @@ -728,7 +795,7 @@ -(void)replaceSublayer:(nonnull CALayer *)layer with:(nonnull CALayer *)layer2 [super replaceSublayer:layer with:layer2]; if ( [layer2 isKindOfClass:[CPTLayer class]] ) { - ( (CPTLayer *)layer2 ).contentsScale = self.contentsScale; + ((CPTLayer *)layer2).contentsScale = self.contentsScale; } } @@ -787,7 +854,7 @@ -(void)applySublayerMaskToContext:(nonnull CGContextRef)context forSublayer:(non } CGAffineTransform sublayerTransform = CATransform3DGetAffineTransform(sublayer.transform); - CGContextConcatCTM( context, CGAffineTransformInvert(sublayerTransform) ); + CGContextConcatCTM(context, CGAffineTransformInvert(sublayerTransform)); CALayer *superlayer = self.superlayer; if ( [superlayer isKindOfClass:[CPTLayer class]] ) { @@ -861,16 +928,6 @@ -(void)setNeedsDisplay -(void)setPosition:(CGPoint)newPosition { super.position = newPosition; - if ( COREPLOT_LAYER_POSITION_CHANGE_ENABLED() ) { - CGRect currentFrame = self.frame; - if ( !CGRectEqualToRect( currentFrame, CGRectIntegral(self.frame) ) ) { - COREPLOT_LAYER_POSITION_CHANGE( (const char *)class_getName([self class]), - (int)lrint( ceil( currentFrame.origin.x * CPTFloat(1000.0) ) ), - (int)lrint( ceil( currentFrame.origin.y * CPTFloat(1000.0) ) ), - (int)lrint( ceil( currentFrame.size.width * CPTFloat(1000.0) ) ), - (int)lrint( ceil( currentFrame.size.height * CPTFloat(1000.0) ) ) ); - } - } } -(void)setHidden:(BOOL)newHidden @@ -885,7 +942,7 @@ -(void)setHidden:(BOOL)newHidden -(void)setContentsScale:(CGFloat)newContentsScale { - NSParameterAssert( newContentsScale > CPTFloat(0.0) ); + NSParameterAssert(newContentsScale > CPTFloat(0.0)); if ( self.contentsScale != newContentsScale ) { if ( [CALayer instancesRespondToSelector:@selector(setContentsScale:)] ) { @@ -957,7 +1014,7 @@ -(CGRect)bounds -(void)setBounds:(CGRect)newBounds { - if ( !CGRectEqualToRect(self.bounds, newBounds) ) { + if ( !CGRectEqualToRect(self.bounds, newBounds)) { if ( self.shadow ) { CGSize sizeOffset = self.shadowMargin; @@ -984,14 +1041,14 @@ -(CGPoint)anchorPoint if ( self.shadow ) { CGSize sizeOffset = self.shadowMargin; CGRect selfBounds = self.bounds; - CGSize adjustedSize = CGSizeMake( selfBounds.size.width + sizeOffset.width * CPTFloat(2.0), - selfBounds.size.height + sizeOffset.height * CPTFloat(2.0) ); + CGSize adjustedSize = CGSizeMake(selfBounds.size.width + sizeOffset.width * CPTFloat(2.0), + selfBounds.size.height + sizeOffset.height * CPTFloat(2.0)); - if ( selfBounds.size.width > CPTFloat(0.0) ) { - adjustedAnchor.x = ( adjustedAnchor.x - CPTFloat(0.5) ) * (adjustedSize.width / selfBounds.size.width) + CPTFloat(0.5); + if ( selfBounds.size.width > CPTFloat(0.0)) { + adjustedAnchor.x = (adjustedAnchor.x - CPTFloat(0.5)) * (adjustedSize.width / selfBounds.size.width) + CPTFloat(0.5); } - if ( selfBounds.size.height > CPTFloat(0.0) ) { - adjustedAnchor.y = ( adjustedAnchor.y - CPTFloat(0.5) ) * (adjustedSize.height / selfBounds.size.height) + CPTFloat(0.5); + if ( selfBounds.size.height > CPTFloat(0.0)) { + adjustedAnchor.y = (adjustedAnchor.y - CPTFloat(0.5)) * (adjustedSize.height / selfBounds.size.height) + CPTFloat(0.5); } } @@ -1003,14 +1060,14 @@ -(void)setAnchorPoint:(CGPoint)newAnchorPoint if ( self.shadow ) { CGSize sizeOffset = self.shadowMargin; CGRect selfBounds = self.bounds; - CGSize adjustedSize = CGSizeMake( selfBounds.size.width + sizeOffset.width * CPTFloat(2.0), - selfBounds.size.height + sizeOffset.height * CPTFloat(2.0) ); + CGSize adjustedSize = CGSizeMake(selfBounds.size.width + sizeOffset.width * CPTFloat(2.0), + selfBounds.size.height + sizeOffset.height * CPTFloat(2.0)); - if ( adjustedSize.width > CPTFloat(0.0) ) { - newAnchorPoint.x = ( newAnchorPoint.x - CPTFloat(0.5) ) * (selfBounds.size.width / adjustedSize.width) + CPTFloat(0.5); + if ( adjustedSize.width > CPTFloat(0.0)) { + newAnchorPoint.x = (newAnchorPoint.x - CPTFloat(0.5)) * (selfBounds.size.width / adjustedSize.width) + CPTFloat(0.5); } - if ( adjustedSize.height > CPTFloat(0.0) ) { - newAnchorPoint.y = ( newAnchorPoint.y - CPTFloat(0.5) ) * (selfBounds.size.height / adjustedSize.height) + CPTFloat(0.5); + if ( adjustedSize.height > CPTFloat(0.0)) { + newAnchorPoint.y = (newAnchorPoint.y - CPTFloat(0.5)) * (selfBounds.size.height / adjustedSize.height) + CPTFloat(0.5); } } diff --git a/framework/Source/CPTLayerAnnotation.h b/framework/Source/CPTLayerAnnotation.h index 67c31862e..23e1afeea 100644 --- a/framework/Source/CPTLayerAnnotation.h +++ b/framework/Source/CPTLayerAnnotation.h @@ -5,8 +5,10 @@ @interface CPTLayerAnnotation : CPTAnnotation -@property (nonatomic, readonly, nullable) cpt_weak CPTLayer *anchorLayer; +@property (nonatomic, readonly, cpt_weak_property, nullable) CPTLayer *anchorLayer; @property (nonatomic, readwrite, assign) CPTRectAnchor rectAnchor; +@property (nonatomic, readwrite, strong, nullable) CPTConstraints *xConstraints; +@property (nonatomic, readwrite, strong, nullable) CPTConstraints *yConstraints; /// @name Initialization /// @{ diff --git a/framework/Source/CPTLayerAnnotation.m b/framework/Source/CPTLayerAnnotation.m index 34e48c4a0..69c68d6da 100644 --- a/framework/Source/CPTLayerAnnotation.m +++ b/framework/Source/CPTLayerAnnotation.m @@ -7,9 +7,6 @@ /// @cond @interface CPTLayerAnnotation() -@property (nonatomic, readwrite, strong, nullable) CPTConstraints *xConstraints; -@property (nonatomic, readwrite, strong, nullable) CPTConstraints *yConstraints; - -(void)setConstraints; @end @@ -26,7 +23,7 @@ -(void)setConstraints; **/ @implementation CPTLayerAnnotation -/** @property nullable cpt_weak CPTLayer *anchorLayer +/** @property nullable CPTLayer *anchorLayer * @brief The reference layer. **/ @synthesize anchorLayer; @@ -36,7 +33,14 @@ @implementation CPTLayerAnnotation **/ @synthesize rectAnchor; +/** @property CPTConstraints *xConstraints + * @brief The constraints used to position the content layer relative to the reference layer in the x-direction. Setting the @ref rectAnchor resets the constraints. + **/ @synthesize xConstraints; + +/** @property CPTConstraints *yConstraints + * @brief The constraints used to position the content layer relative to the reference layer in the y-direction. Setting the @ref rectAnchor resets the constraints. + **/ @synthesize yConstraints; #pragma mark - @@ -57,7 +61,7 @@ -(nonnull instancetype)initWithAnchorLayer:(nonnull CPTLayer *)newAnchorLayer { NSParameterAssert(newAnchorLayer); - if ( (self = [super init]) ) { + if ((self = [super init])) { anchorLayer = newAnchorLayer; rectAnchor = CPTRectAnchorTop; xConstraints = nil; @@ -114,11 +118,23 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - anchorLayer = [coder decodeObjectForKey:@"CPTLayerAnnotation.anchorLayer"]; - xConstraints = [coder decodeObjectForKey:@"CPTLayerAnnotation.xConstraints"]; - yConstraints = [coder decodeObjectForKey:@"CPTLayerAnnotation.yConstraints"]; - rectAnchor = (CPTRectAnchor)[coder decodeIntegerForKey:@"CPTLayerAnnotation.rectAnchor"]; + if ((self = [super initWithCoder:coder])) { + CPTLayer *anchor = [coder decodeObjectOfClass:[CPTLayer class] + forKey:@"CPTLayerAnnotation.anchorLayer"]; + xConstraints = [coder decodeObjectOfClass:[CPTConstraints class] + forKey:@"CPTLayerAnnotation.xConstraints"]; + yConstraints = [coder decodeObjectOfClass:[CPTConstraints class] + forKey:@"CPTLayerAnnotation.yConstraints"]; + rectAnchor = (CPTRectAnchor)[coder decodeIntegerForKey:@"CPTLayerAnnotation.rectAnchor"]; + + if ( anchor ) { + anchorLayer = anchor; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(positionContentLayer) + name:CPTLayerBoundsDidChangeNotification + object:anchor]; + } } return self; } @@ -152,7 +168,7 @@ -(void)positionContentLayer content.anchorPoint = self.contentAnchorPoint; content.position = newPosition; - content.transform = CATransform3DMakeRotation( self.rotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0) ); + content.transform = CATransform3DMakeRotation(self.rotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0)); [content pixelAlign]; } } @@ -160,6 +176,18 @@ -(void)positionContentLayer /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Constraints @@ -234,6 +262,21 @@ -(void)setRectAnchor:(CPTRectAnchor)newAnchor if ( newAnchor != rectAnchor ) { rectAnchor = newAnchor; [self setConstraints]; + } +} + +-(void)setXConstraints:(CPTConstraints *)newConstraints +{ + if ( newConstraints != xConstraints ) { + xConstraints = newConstraints; + [self positionContentLayer]; + } +} + +-(void)setYConstraints:(CPTConstraints *)newConstraints +{ + if ( newConstraints != yConstraints ) { + yConstraints = newConstraints; [self positionContentLayer]; } } diff --git a/framework/Source/CPTLayerTests.h b/framework/Source/CPTLayerTests.h index af9553bf2..fa9b9ba33 100644 --- a/framework/Source/CPTLayerTests.h +++ b/framework/Source/CPTLayerTests.h @@ -7,6 +7,6 @@ @interface CPTLayerTests : CPTTestCase @property (nonatomic, readwrite, strong, nonnull) CPTLayer *layer; -@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray positions; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *positions; @end diff --git a/framework/Source/CPTLayerTests.m b/framework/Source/CPTLayerTests.m index 78337db38..d94be1dc5 100644 --- a/framework/Source/CPTLayerTests.m +++ b/framework/Source/CPTLayerTests.m @@ -4,11 +4,11 @@ #import "CPTUtilities.h" #import "NSNumberExtensions.h" -static const double precision = 1.0e-6; +static const CGFloat precision = CPTFloat(1.0e-6); @interface CPTLayerTests() --(void)testPositionsWithScale:(CGFloat)scale anchorPoint:(CGPoint)anchor expected:(CPTNumberArray)expected; +-(void)testPositionsWithScale:(CGFloat)scale anchorPoint:(CGPoint)anchor expected:(CPTNumberArray *)expected; @end @@ -40,7 +40,7 @@ -(void)tearDown -(void)testPixelAlign1xLeft { - CPTNumberArray expected = @[@10.0, @10.0, @11.0, @11.0, @11.0, @11.0]; + CPTNumberArray *expected = @[@10.0, @10.0, @11.0, @11.0, @11.0, @11.0]; [self testPositionsWithScale:CPTFloat(1.0) anchorPoint:CGPointZero @@ -49,7 +49,7 @@ -(void)testPixelAlign1xLeft -(void)testPixelAlign1xLeftMiddle { - CPTNumberArray expected = @[@10.75, @10.75, @10.75, @10.75, @10.75, @10.75]; + CPTNumberArray *expected = @[@10.75, @10.75, @10.75, @10.75, @10.75, @10.75]; [self testPositionsWithScale:CPTFloat(1.0) anchorPoint:CPTPointMake(0.25, 0.25) @@ -58,7 +58,7 @@ -(void)testPixelAlign1xLeftMiddle -(void)testPixelAlign1xMiddle { - CPTNumberArray expected = @[@10.5, @10.5, @10.5, @10.5, @10.5, @11.5]; + CPTNumberArray *expected = @[@10.5, @10.5, @10.5, @10.5, @10.5, @11.5]; [self testPositionsWithScale:CPTFloat(1.0) anchorPoint:CPTPointMake(0.5, 0.5) @@ -67,7 +67,7 @@ -(void)testPixelAlign1xMiddle -(void)testPixelAlign1xRightMiddle { - CPTNumberArray expected = @[@10.25, @10.25, @10.25, @11.25, @11.25, @11.25]; + CPTNumberArray *expected = @[@10.25, @10.25, @10.25, @11.25, @11.25, @11.25]; [self testPositionsWithScale:CPTFloat(1.0) anchorPoint:CPTPointMake(0.75, 0.75) @@ -76,7 +76,7 @@ -(void)testPixelAlign1xRightMiddle -(void)testPixelAlign1xRight { - CPTNumberArray expected = @[@10.0, @10.0, @11.0, @11.0, @11.0, @11.0]; + CPTNumberArray *expected = @[@10.0, @10.0, @11.0, @11.0, @11.0, @11.0]; [self testPositionsWithScale:CPTFloat(1.0) anchorPoint:CPTPointMake(1.0, 1.0) @@ -87,7 +87,7 @@ -(void)testPixelAlign1xRight -(void)testPixelAlign2xLeft { - CPTNumberArray expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; + CPTNumberArray *expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; [self testPositionsWithScale:CPTFloat(2.0) anchorPoint:CGPointZero @@ -96,7 +96,7 @@ -(void)testPixelAlign2xLeft -(void)testPixelAlign2xLeftMiddle { - CPTNumberArray expected = @[@10.25, @10.25, @10.75, @10.75, @10.75, @11.25]; + CPTNumberArray *expected = @[@10.25, @10.25, @10.75, @10.75, @10.75, @11.25]; [self testPositionsWithScale:CPTFloat(2.0) anchorPoint:CPTPointMake(0.25, 0.25) @@ -105,7 +105,7 @@ -(void)testPixelAlign2xLeftMiddle -(void)testPixelAlign2xMiddle { - CPTNumberArray expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; + CPTNumberArray *expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; [self testPositionsWithScale:CPTFloat(2.0) anchorPoint:CPTPointMake(0.5, 0.5) @@ -114,7 +114,7 @@ -(void)testPixelAlign2xMiddle -(void)testPixelAlign2xRightMiddle { - CPTNumberArray expected = @[@10.25, @10.25, @10.75, @10.75, @10.75, @11.25]; + CPTNumberArray *expected = @[@10.25, @10.25, @10.75, @10.75, @10.75, @11.25]; [self testPositionsWithScale:CPTFloat(2.0) anchorPoint:CPTPointMake(0.75, 0.75) @@ -123,7 +123,7 @@ -(void)testPixelAlign2xRightMiddle -(void)testPixelAlign2xRight { - CPTNumberArray expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; + CPTNumberArray *expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; [self testPositionsWithScale:CPTFloat(2.0) anchorPoint:CPTPointMake(1.0, 1.0) @@ -132,7 +132,7 @@ -(void)testPixelAlign2xRight #pragma mark - Utility methods --(void)testPositionsWithScale:(CGFloat)scale anchorPoint:(CGPoint)anchor expected:(CPTNumberArray)expectedValues +-(void)testPositionsWithScale:(CGFloat)scale anchorPoint:(CGPoint)anchor expected:(CPTNumberArray *)expectedValues { NSUInteger positionCount = self.positions.count; @@ -142,20 +142,20 @@ -(void)testPositionsWithScale:(CGFloat)scale anchorPoint:(CGPoint)anchor expecte self.layer.anchorPoint = anchor; for ( NSUInteger i = 0; i < positionCount; i++ ) { - CGFloat position = ( (NSNumber *)( (self.positions)[i] ) ).cgFloatValue; + CGFloat position = ((NSNumber *)((self.positions)[i])).cgFloatValue; CGPoint layerPosition = CGPointMake(position, position); self.layer.position = layerPosition; [self.layer pixelAlign]; CGPoint alignedPoint = self.layer.position; - CGFloat expected = ( (NSNumber *)(expectedValues[i]) ).cgFloatValue; + CGFloat expected = ((NSNumber *)(expectedValues[i])).cgFloatValue; NSString *errMessage; - errMessage = [NSString stringWithFormat:@"pixelAlign at x = %g with scale %g and anchor %@", position, scale, CPTStringFromPoint(anchor)]; + errMessage = [NSString stringWithFormat:@"pixelAlign at x = %g with scale %g and anchor %@", (double)position, (double)scale, CPTStringFromPoint(anchor)]; XCTAssertEqualWithAccuracy(alignedPoint.x, expected, precision, @"%@", errMessage); - errMessage = [NSString stringWithFormat:@"pixelAlign at y = %g with scale %g and anchor %@", position, scale, CPTStringFromPoint(anchor)]; + errMessage = [NSString stringWithFormat:@"pixelAlign at y = %g with scale %g and anchor %@", (double)position, (double)scale, CPTStringFromPoint(anchor)]; XCTAssertEqualWithAccuracy(alignedPoint.y, expected, precision, @"%@", errMessage); } } diff --git a/framework/Source/CPTLegend.h b/framework/Source/CPTLegend.h index dcb319f7a..d865a3e21 100644 --- a/framework/Source/CPTLegend.h +++ b/framework/Source/CPTLegend.h @@ -8,30 +8,47 @@ @class CPTLineStyle; @class CPTTextStyle; +/** + * @brief Graph notification type. + **/ +typedef NSString *CPTLegendNotification cpt_swift_struct; + /// @name Legend /// @{ /** @brief Notification sent by plots to tell the legend it should redraw itself. * @ingroup notification **/ -extern NSString *__nonnull const CPTLegendNeedsRedrawForPlotNotification; +extern CPTLegendNotification __nonnull const CPTLegendNeedsRedrawForPlotNotification NS_SWIFT_NAME(needsRedrawForPlot); /** @brief Notification sent by plots to tell the legend it should update its layout and redraw itself. * @ingroup notification **/ -extern NSString *__nonnull const CPTLegendNeedsLayoutForPlotNotification; +extern CPTLegendNotification __nonnull const CPTLegendNeedsLayoutForPlotNotification NS_SWIFT_NAME(needsLayoutForPlot); /** @brief Notification sent by plots to tell the legend it should reload all legend entries. * @ingroup notification **/ -extern NSString *__nonnull const CPTLegendNeedsReloadEntriesForPlotNotification; +extern CPTLegendNotification __nonnull const CPTLegendNeedsReloadEntriesForPlotNotification NS_SWIFT_NAME(needsReloadEntriesForPlot); /// @} +/** + * @brief Enumeration of legend layout options. + **/ +typedef NS_ENUM (NSInteger, CPTLegendSwatchLayout) { + CPTLegendSwatchLayoutLeft, ///< Lay out the swatch to the left side of the title. + CPTLegendSwatchLayoutRight, ///< Lay out the swatch to the right side of the title. + CPTLegendSwatchLayoutTop, ///< Lay out the swatch above the title. + CPTLegendSwatchLayoutBottom ///< Lay out the swatch below the title. +}; + +#pragma mark - + /** * @brief Legend delegate. **/ -@protocol CPTLegendDelegate +@protocol CPTLegendDelegate @optional @@ -190,30 +207,31 @@ extern NSString *__nonnull const CPTLegendNeedsReloadEntriesForPlotNotification; @property (nonatomic, readwrite, assign) NSUInteger numberOfColumns; @property (nonatomic, readwrite, assign) BOOL equalRows; @property (nonatomic, readwrite, assign) BOOL equalColumns; -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray rowHeights; -@property (nonatomic, readonly, nullable) CPTNumberArray rowHeightsThatFit; -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray columnWidths; -@property (nonatomic, readonly, nullable) CPTNumberArray columnWidthsThatFit; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *rowHeights; +@property (nonatomic, readonly, nullable) CPTNumberArray *rowHeightsThatFit; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *columnWidths; +@property (nonatomic, readonly, nullable) CPTNumberArray *columnWidthsThatFit; @property (nonatomic, readwrite, assign) CGFloat columnMargin; @property (nonatomic, readwrite, assign) CGFloat rowMargin; @property (nonatomic, readwrite, assign) CGFloat titleOffset; +@property (nonatomic, readwrite, assign) CPTLegendSwatchLayout swatchLayout; /// @} /// @name Factory Methods /// @{ -+(nonnull instancetype)legendWithPlots:(nullable CPTPlotArray)newPlots; ++(nonnull instancetype)legendWithPlots:(nullable CPTPlotArray *)newPlots; +(nonnull instancetype)legendWithGraph:(nullable __kindof CPTGraph *)graph; /// @} /// @name Initialization /// @{ --(nonnull instancetype)initWithPlots:(nullable CPTPlotArray)newPlots; +-(nonnull instancetype)initWithPlots:(nullable CPTPlotArray *)newPlots; -(nonnull instancetype)initWithGraph:(nullable __kindof CPTGraph *)graph; /// @} /// @name Plots /// @{ --(nonnull CPTPlotArray)allPlots; +-(nonnull CPTPlotArray *)allPlots; -(nullable CPTPlot *)plotAtIndex:(NSUInteger)idx; -(nullable CPTPlot *)plotWithIdentifier:(nullable id)identifier; diff --git a/framework/Source/CPTLegend.m b/framework/Source/CPTLegend.m index e80866abe..c5fcb69c4 100644 --- a/framework/Source/CPTLegend.m +++ b/framework/Source/CPTLegend.m @@ -15,24 +15,24 @@ /** @defgroup legendAnimation Legends * @brief Legend properties that can be animated using Core Animation. * @if MacOnly - * @since Custom layer property animation is supported on MacOS 10.6 and later. + * @since Custom layer property animation is supported on macOS 10.6 and later. * @endif * @ingroup animation **/ -NSString *const CPTLegendNeedsRedrawForPlotNotification = @"CPTLegendNeedsRedrawForPlotNotification"; -NSString *const CPTLegendNeedsLayoutForPlotNotification = @"CPTLegendNeedsLayoutForPlotNotification"; -NSString *const CPTLegendNeedsReloadEntriesForPlotNotification = @"CPTLegendNeedsReloadEntriesForPlotNotification"; +CPTLegendNotification const CPTLegendNeedsRedrawForPlotNotification = @"CPTLegendNeedsRedrawForPlotNotification"; +CPTLegendNotification const CPTLegendNeedsLayoutForPlotNotification = @"CPTLegendNeedsLayoutForPlotNotification"; +CPTLegendNotification const CPTLegendNeedsReloadEntriesForPlotNotification = @"CPTLegendNeedsReloadEntriesForPlotNotification"; /// @cond @interface CPTLegend() -@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotArray plots; -@property (nonatomic, readwrite, strong, nonnull) CPTMutableLegendEntryArray legendEntries; -@property (nonatomic, readwrite, strong, nullable) CPTNumberArray rowHeightsThatFit; -@property (nonatomic, readwrite, strong, nullable) CPTNumberArray columnWidthsThatFit; +@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotArray *plots; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableLegendEntryArray *legendEntries; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *rowHeightsThatFit; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *columnWidthsThatFit; @property (nonatomic, readwrite, assign) BOOL layoutChanged; -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTLegendEntry *pointingDeviceDownEntry; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTLegendEntry *pointingDeviceDownEntry; -(void)recalculateLayout; -(void)removeLegendEntriesForPlot:(nonnull CPTPlot *)plot; @@ -160,7 +160,7 @@ @implementation CPTLegend **/ @synthesize equalColumns; -/** @property nullable CPTNumberArray rowHeights +/** @property nullable CPTNumberArray *rowHeights * @brief The desired height of each row of legend entries, including the swatch and title. * Each element in this array should be an NSNumber representing the height of the corresponding row in device units. * Rows are numbered from top to bottom starting from zero (@num{0}). If @nil, all rows will be sized automatically. @@ -169,14 +169,14 @@ @implementation CPTLegend **/ @synthesize rowHeights; -/** @property nullable CPTNumberArray rowHeightsThatFit +/** @property nullable CPTNumberArray *rowHeightsThatFit * @brief The computed best-fit height of each row of legend entries, including the swatch and title. * Each element in this array is an NSNumber representing the height of the corresponding row in device units. * Rows are numbered from top to bottom starting from zero (@num{0}). **/ @synthesize rowHeightsThatFit; -/** @property nullable CPTNumberArray columnWidths +/** @property nullable CPTNumberArray *columnWidths * @brief The desired width of each column of legend entries, including the swatch, title, and title offset. * Each element in this array should be an NSNumber representing the width of the corresponding column in device units. * Columns are numbered from left to right starting from zero (@num{0}). If @nil, all columns will be sized automatically. @@ -185,7 +185,7 @@ @implementation CPTLegend **/ @synthesize columnWidths; -/** @property nullable CPTNumberArray columnWidthsThatFit +/** @property nullable CPTNumberArray *columnWidthsThatFit * @brief The computed best-fit width of each column of legend entries, including the swatch, title, and title offset. * Each element in this array is an NSNumber representing the width of the corresponding column in device units. * Columns are numbered from left to right starting from zero (@num{0}). @@ -207,14 +207,19 @@ @implementation CPTLegend **/ @synthesize titleOffset; +/** @property CPTLegendSwatchLayout swatchLayout + * @brief Where to draw the legend swatch relative to the title. Default is #CPTLegendSwatchLayoutLeft. + **/ +@synthesize swatchLayout; + /** @internal - * @property nonnull CPTMutablePlotArray plots + * @property nonnull CPTMutablePlotArray *plots * @brief An array of all plots associated with the legend. **/ @synthesize plots; /** @internal - * @property nonnull CPTMutableLegendEntryArray legendEntries + * @property nonnull CPTMutableLegendEntryArray *legendEntries * @brief An array of all legend entries. **/ @synthesize legendEntries; @@ -225,7 +230,7 @@ @implementation CPTLegend @synthesize layoutChanged; /** @internal - * @property nullable cpt_weak CPTLegendEntry *pointingDeviceDownEntry + * @property nullable CPTLegendEntry *pointingDeviceDownEntry * @brief The legend entry that was selected on the pointing device down event. **/ @synthesize pointingDeviceDownEntry; @@ -237,7 +242,7 @@ @implementation CPTLegend * @param newPlots An array of plots. * @return A new CPTLegend instance. **/ -+(nonnull instancetype)legendWithPlots:(nullable CPTPlotArray)newPlots ++(nonnull instancetype)legendWithPlots:(nullable CPTPlotArray *)newPlots { return [[self alloc] initWithPlots:newPlots]; } @@ -284,6 +289,7 @@ +(nonnull instancetype)legendWithGraph:(nullable __kindof CPTGraph *)graph * - @ref columnMargin = @num{10.0} * - @ref rowMargin = @num{5.0} * - @ref titleOffset = @num{5.0} + * - @ref swatchLayout = #CPTLegendSwatchLayoutLeft * - @ref paddingLeft = @num{5.0} * - @ref paddingTop = @num{5.0} * - @ref paddingRight = @num{5.0} @@ -295,7 +301,7 @@ +(nonnull instancetype)legendWithGraph:(nullable __kindof CPTGraph *)graph **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { plots = [[NSMutableArray alloc] init]; legendEntries = [[NSMutableArray alloc] init]; layoutChanged = YES; @@ -322,6 +328,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame columnMargin = CPTFloat(10.0); rowMargin = CPTFloat(5.0); titleOffset = CPTFloat(5.0); + swatchLayout = CPTLegendSwatchLayoutLeft; pointingDeviceDownEntry = nil; @@ -341,9 +348,9 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame * @param newPlots An array of plots. * @return The initialized CPTLegend object. **/ --(nonnull instancetype)initWithPlots:(nullable CPTPlotArray)newPlots +-(nonnull instancetype)initWithPlots:(nullable CPTPlotArray *)newPlots { - if ( (self = [self initWithFrame:CGRectZero]) ) { + if ((self = [self initWithFrame:CGRectZero])) { for ( CPTPlot *plot in newPlots ) { [self addPlot:plot]; } @@ -357,7 +364,7 @@ -(nonnull instancetype)initWithPlots:(nullable CPTPlotArray)newPlots **/ -(nonnull instancetype)initWithGraph:(nullable __kindof CPTGraph *)graph { - if ( (self = [self initWithFrame:CGRectZero]) ) { + if ((self = [self initWithFrame:CGRectZero])) { for ( CPTPlot *plot in [graph allPlots] ) { [self addPlot:plot]; } @@ -369,7 +376,7 @@ -(nonnull instancetype)initWithGraph:(nullable __kindof CPTGraph *)graph -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTLegend *theLayer = (CPTLegend *)layer; plots = theLayer->plots; @@ -398,6 +405,7 @@ -(nonnull instancetype)initWithLayer:(nonnull id)layer columnMargin = theLayer->columnMargin; rowMargin = theLayer->rowMargin; titleOffset = theLayer->titleOffset; + swatchLayout = theLayer->swatchLayout; pointingDeviceDownEntry = theLayer->pointingDeviceDownEntry; } @@ -446,6 +454,7 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder [coder encodeCGFloat:self.columnMargin forKey:@"CPTLegend.columnMargin"]; [coder encodeCGFloat:self.rowMargin forKey:@"CPTLegend.rowMargin"]; [coder encodeCGFloat:self.titleOffset forKey:@"CPTLegend.titleOffset"]; + [coder encodeInteger:(NSInteger)self.swatchLayout forKey:@"CPTLegend.swatchLayout"]; // No need to archive these properties: // pointingDeviceDownEntry @@ -453,8 +462,9 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - NSArray *plotArray = [coder decodeObjectForKey:@"CPTLegend.plots"]; + if ((self = [super initWithCoder:coder])) { + NSArray *plotArray = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTPlot class]]] + forKey:@"CPTLegend.plots"]; if ( plotArray ) { plots = [plotArray mutableCopy]; } @@ -462,7 +472,8 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder plots = [[NSMutableArray alloc] init]; } - NSArray *entries = [coder decodeObjectForKey:@"CPTLegend.legendEntries"]; + NSArray *entries = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTLegendEntry class]]] + forKey:@"CPTLegend.legendEntries"]; if ( entries ) { legendEntries = [entries mutableCopy]; } @@ -470,30 +481,40 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder legendEntries = [[NSMutableArray alloc] init]; } - layoutChanged = [coder decodeBoolForKey:@"CPTLegend.layoutChanged"]; - textStyle = [[coder decodeObjectForKey:@"CPTLegend.textStyle"] copy]; + layoutChanged = [coder decodeBoolForKey:@"CPTLegend.layoutChanged"]; + textStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTLegend.textStyle"] copy]; swatchSize = [coder decodeCPTSizeForKey:@"CPTLegend.swatchSize"]; - swatchBorderLineStyle = [[coder decodeObjectForKey:@"CPTLegend.swatchBorderLineStyle"] copy]; - swatchCornerRadius = [coder decodeCGFloatForKey:@"CPTLegend.swatchCornerRadius"]; - swatchFill = [[coder decodeObjectForKey:@"CPTLegend.swatchFill"] copy]; - entryBorderLineStyle = [[coder decodeObjectForKey:@"CPTLegend.entryBorderLineStyle"] copy]; - entryCornerRadius = [coder decodeCGFloatForKey:@"CPTLegend.entryCornerRadius"]; - entryFill = [[coder decodeObjectForKey:@"CPTLegend.entryFill"] copy]; - entryPaddingLeft = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingLeft"]; - entryPaddingTop = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingTop"]; - entryPaddingRight = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingRight"]; - entryPaddingBottom = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingBottom"]; - numberOfRows = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegend.numberOfRows"]; - numberOfColumns = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegend.numberOfColumns"]; - equalRows = [coder decodeBoolForKey:@"CPTLegend.equalRows"]; - equalColumns = [coder decodeBoolForKey:@"CPTLegend.equalColumns"]; - rowHeights = [[coder decodeObjectForKey:@"CPTLegend.rowHeights"] copy]; - rowHeightsThatFit = [coder decodeObjectForKey:@"CPTLegend.rowHeightsThatFit"]; - columnWidths = [[coder decodeObjectForKey:@"CPTLegend.columnWidths"] copy]; - columnWidthsThatFit = [coder decodeObjectForKey:@"CPTLegend.columnWidthsThatFit"]; - columnMargin = [coder decodeCGFloatForKey:@"CPTLegend.columnMargin"]; - rowMargin = [coder decodeCGFloatForKey:@"CPTLegend.rowMargin"]; - titleOffset = [coder decodeCGFloatForKey:@"CPTLegend.titleOffset"]; + swatchBorderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTLegend.swatchBorderLineStyle"] copy]; + swatchCornerRadius = [coder decodeCGFloatForKey:@"CPTLegend.swatchCornerRadius"]; + swatchFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTLegend.swatchFill"] copy]; + entryBorderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTLegend.entryBorderLineStyle"] copy]; + entryCornerRadius = [coder decodeCGFloatForKey:@"CPTLegend.entryCornerRadius"]; + entryFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTLegend.entryFill"] copy]; + entryPaddingLeft = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingLeft"]; + entryPaddingTop = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingTop"]; + entryPaddingRight = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingRight"]; + entryPaddingBottom = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingBottom"]; + numberOfRows = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegend.numberOfRows"]; + numberOfColumns = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegend.numberOfColumns"]; + equalRows = [coder decodeBoolForKey:@"CPTLegend.equalRows"]; + equalColumns = [coder decodeBoolForKey:@"CPTLegend.equalColumns"]; + rowHeights = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTLegend.rowHeights"] copy]; + rowHeightsThatFit = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTLegend.rowHeightsThatFit"]; + columnWidths = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTLegend.columnWidths"] copy]; + columnWidthsThatFit = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTLegend.columnWidthsThatFit"]; + columnMargin = [coder decodeCGFloatForKey:@"CPTLegend.columnMargin"]; + rowMargin = [coder decodeCGFloatForKey:@"CPTLegend.rowMargin"]; + titleOffset = [coder decodeCGFloatForKey:@"CPTLegend.titleOffset"]; + swatchLayout = (CPTLegendSwatchLayout)[coder decodeIntegerForKey:@"CPTLegend.swatchLayout"]; pointingDeviceDownEntry = nil; } @@ -502,6 +523,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing @@ -519,11 +552,25 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context return; } + BOOL isHorizontalLayout; + + switch ( self.swatchLayout ) { + case CPTLegendSwatchLayoutLeft: + case CPTLegendSwatchLayoutRight: + isHorizontalLayout = YES; + break; + + case CPTLegendSwatchLayoutTop: + case CPTLegendSwatchLayoutBottom: + isHorizontalLayout = NO; + break; + } + // calculate column positions - CPTNumberArray computedColumnWidths = self.columnWidthsThatFit; - NSUInteger columnCount = computedColumnWidths.count; - CGFloat *actualColumnWidths = malloc(sizeof(CGFloat) * columnCount); - CGFloat *columnPositions = malloc(sizeof(CGFloat) * columnCount); + CPTNumberArray *computedColumnWidths = self.columnWidthsThatFit; + NSUInteger columnCount = computedColumnWidths.count; + CGFloat *actualColumnWidths = calloc(columnCount, sizeof(CGFloat)); + CGFloat *columnPositions = calloc(columnCount, sizeof(CGFloat)); columnPositions[0] = self.paddingLeft; CGFloat theOffset = self.titleOffset; CGSize theSwatchSize = self.swatchSize; @@ -539,15 +586,15 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CGFloat width = [colWidth cgFloatValue]; actualColumnWidths[col] = width; if ( col < columnCount - 1 ) { - columnPositions[col + 1] = columnPositions[col] + padLeft + width + padRight + theOffset + theSwatchSize.width + theColumnMargin; + columnPositions[col + 1] = columnPositions[col] + padLeft + width + padRight + (isHorizontalLayout ? theOffset + theSwatchSize.width : CPTFloat(0.0)) + theColumnMargin; } } // calculate row positions - CPTNumberArray computedRowHeights = self.rowHeightsThatFit; - NSUInteger rowCount = computedRowHeights.count; - CGFloat *actualRowHeights = malloc(sizeof(CGFloat) * rowCount); - CGFloat *rowPositions = malloc(sizeof(CGFloat) * rowCount); + CPTNumberArray *computedRowHeights = self.rowHeightsThatFit; + NSUInteger rowCount = computedRowHeights.count; + CGFloat *actualRowHeights = calloc(rowCount, sizeof(CGFloat)); + CGFloat *rowPositions = calloc(rowCount, sizeof(CGFloat)); rowPositions[rowCount - 1] = self.paddingBottom; CGFloat theRowMargin = self.rowMargin; CGFloat lastRowHeight = 0.0; @@ -558,7 +605,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CGFloat height = [rowHeight cgFloatValue]; actualRowHeights[row] = height; if ( row < rowCount - 1 ) { - rowPositions[row] = rowPositions[row + 1] + padBottom + lastRowHeight + padTop + theRowMargin; + rowPositions[row] = rowPositions[row + 1] + padBottom + lastRowHeight + padTop + (isHorizontalLayout ? CPTFloat(0.0) : theOffset + theSwatchSize.height) + theRowMargin; } lastRowHeight = height; } @@ -580,17 +627,28 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context NSUInteger row = legendEntry.row; NSUInteger col = legendEntry.column; - if ( ( (desiredRowCount == 0) || (row < desiredRowCount) ) && - ( (desiredColumnCount == 0) || (col < desiredColumnCount) ) ) { + if (((desiredRowCount == 0) || (row < desiredRowCount)) && + ((desiredColumnCount == 0) || (col < desiredColumnCount))) { NSUInteger entryIndex = legendEntry.index; CPTPlot *entryPlot = legendEntry.plot; CGFloat left = columnPositions[col]; CGFloat rowPosition = rowPositions[row]; - CGRect entryRect = CPTRectMake(left, - rowPosition, - padLeft + theSwatchSize.width + theOffset + actualColumnWidths[col] + CPTFloat(1.0) + padRight, - padBottom + actualRowHeights[row] + padTop); + + CGRect entryRect; + + if ( isHorizontalLayout ) { + entryRect = CPTRectMake(left, + rowPosition, + padLeft + theSwatchSize.width + theOffset + actualColumnWidths[col] + CPTFloat(1.0) + padRight, + padBottom + actualRowHeights[row] + padTop); + } + else { + entryRect = CPTRectMake(left, + rowPosition, + padLeft + MAX(theSwatchSize.width, actualColumnWidths[col]) + CPTFloat(1.0) + padRight, + padBottom + theSwatchSize.height + theOffset + actualRowHeights[row] + padTop); + } // draw background CPTFill *theFill = nil; @@ -620,12 +678,50 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context [theLineStyle strokePathInContext:context]; } + // lay out swatch and title + CGFloat swatchLeft, swatchBottom; + CGFloat titleLeft, titleBottom; + + switch ( self.swatchLayout ) { + case CPTLegendSwatchLayoutLeft: + swatchLeft = CGRectGetMinX(entryRect) + padLeft; + swatchBottom = CGRectGetMinY(entryRect) + (entryRect.size.height - theSwatchSize.height) * CPTFloat(0.5); + + titleLeft = swatchLeft + theSwatchSize.width + theOffset; + titleBottom = CGRectGetMinY(entryRect) + padBottom; + break; + + case CPTLegendSwatchLayoutRight: + swatchLeft = CGRectGetMaxX(entryRect) - padRight - theSwatchSize.width; + swatchBottom = CGRectGetMinY(entryRect) + (entryRect.size.height - theSwatchSize.height) * CPTFloat(0.5); + + titleLeft = CGRectGetMinX(entryRect) + padLeft; + titleBottom = CGRectGetMinY(entryRect) + padBottom; + break; + + case CPTLegendSwatchLayoutTop: + swatchLeft = CGRectGetMidX(entryRect) - theSwatchSize.width * CPTFloat(0.5); + swatchBottom = CGRectGetMaxY(entryRect) - padTop - theSwatchSize.height; + + titleLeft = CGRectGetMidX(entryRect) - actualColumnWidths[col] * CPTFloat(0.5); + titleBottom = CGRectGetMinY(entryRect) + padBottom; + break; + + case CPTLegendSwatchLayoutBottom: + swatchLeft = CGRectGetMidX(entryRect) - theSwatchSize.width * CPTFloat(0.5); + swatchBottom = CGRectGetMinY(entryRect) + padBottom; + + titleLeft = CGRectGetMidX(entryRect) - actualColumnWidths[col] * CPTFloat(0.5); + titleBottom = swatchBottom + theOffset + theSwatchSize.height; + break; + } + // draw swatch - left += padLeft; - CGRect swatchRect = CPTRectMake(left, - rowPosition + (entryRect.size.height - theSwatchSize.height) * CPTFloat(0.5), + CGRect swatchRect = CPTRectMake(swatchLeft, + swatchBottom, theSwatchSize.width, theSwatchSize.height); + BOOL legendShouldDrawSwatch = YES; if ( delegateCanDraw ) { legendShouldDrawSwatch = [theDelegate legend:self @@ -642,9 +738,12 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context } // draw title - left += theSwatchSize.width + theOffset; + CGRect titleRect = CPTRectMake(titleLeft, + titleBottom, + actualColumnWidths[col] + CPTFloat(1.0), + actualRowHeights[row]); - [legendEntry drawTitleInRect:CPTAlignRectToUserSpace( context, CPTRectMake(left, rowPosition + padBottom, actualColumnWidths[col] + CPTFloat(1.0), actualRowHeights[row]) ) + [legendEntry drawTitleInRect:CPTAlignRectToUserSpace(context, titleRect) inContext:context scale:self.contentsScale]; } @@ -708,6 +807,20 @@ -(void)recalculateLayout return; } + BOOL isHorizontalLayout; + + switch ( self.swatchLayout ) { + case CPTLegendSwatchLayoutLeft: + case CPTLegendSwatchLayoutRight: + isHorizontalLayout = YES; + break; + + case CPTLegendSwatchLayoutTop: + case CPTLegendSwatchLayoutBottom: + isHorizontalLayout = NO; + break; + } + // compute the number of rows and columns needed to hold the legend entries NSUInteger rowCount = self.numberOfRows; NSUInteger columnCount = self.numberOfColumns; @@ -715,8 +828,8 @@ -(void)recalculateLayout NSUInteger desiredColumnCount = columnCount; NSUInteger legendEntryCount = self.legendEntries.count; - if ( (rowCount == 0) && (columnCount == 0) ) { - rowCount = (NSUInteger)lrint( sqrt( (double)legendEntryCount ) ); + if ((rowCount == 0) && (columnCount == 0)) { + rowCount = (NSUInteger)lrint(sqrt((double)legendEntryCount)); columnCount = rowCount; if ( rowCount * columnCount < legendEntryCount ) { columnCount++; @@ -725,13 +838,13 @@ -(void)recalculateLayout rowCount++; } } - else if ( (rowCount == 0) && (columnCount > 0) ) { + else if ((rowCount == 0) && (columnCount > 0)) { rowCount = legendEntryCount / columnCount; if ( legendEntryCount % columnCount ) { rowCount++; } } - else if ( (rowCount > 0) && (columnCount == 0) ) { + else if ((rowCount > 0) && (columnCount == 0)) { columnCount = legendEntryCount / rowCount; if ( legendEntryCount % rowCount ) { columnCount++; @@ -739,22 +852,25 @@ -(void)recalculateLayout } // compute row heights and column widths - NSUInteger row = 0; - NSUInteger col = 0; - CGFloat *maxTitleHeight = calloc( rowCount, sizeof(CGFloat) ); - CGFloat *maxTitleWidth = calloc( columnCount, sizeof(CGFloat) ); - CGSize theSwatchSize = self.swatchSize; - CPTNumberArray desiredRowHeights = self.rowHeights; - CPTNumberArray desiredColumnWidths = self.columnWidths; - Class numberClass = [NSNumber class]; + NSUInteger row = 0; + NSUInteger col = 0; + CGFloat *maxTitleHeight = calloc(rowCount, sizeof(CGFloat)); + CGFloat *maxTitleWidth = calloc(columnCount, sizeof(CGFloat)); + CGSize theSwatchSize = self.swatchSize; + CPTNumberArray *desiredRowHeights = self.rowHeights; + CPTNumberArray *desiredColumnWidths = self.columnWidths; + Class numberClass = [NSNumber class]; for ( CPTLegendEntry *legendEntry in self.legendEntries ) { legendEntry.row = row; legendEntry.column = col; CGSize titleSize = legendEntry.titleSize; - if ( (desiredRowCount == 0) || (row < desiredRowCount) ) { - maxTitleHeight[row] = MAX(MAX(maxTitleHeight[row], titleSize.height), theSwatchSize.height); + if ((desiredRowCount == 0) || (row < desiredRowCount)) { + maxTitleHeight[row] = MAX(maxTitleHeight[row], titleSize.height); + if ( isHorizontalLayout ) { + maxTitleHeight[row] = MAX(maxTitleHeight[row], theSwatchSize.height); + } if ( row < desiredRowHeights.count ) { id desiredRowHeight = desiredRowHeights[row]; @@ -764,8 +880,11 @@ -(void)recalculateLayout } } - if ( (desiredColumnCount == 0) || (col < desiredColumnCount) ) { - maxTitleWidth[col] = MAX(MAX(maxTitleWidth[col], titleSize.width), theSwatchSize.width); + if ((desiredColumnCount == 0) || (col < desiredColumnCount)) { + maxTitleWidth[col] = MAX(maxTitleWidth[col], titleSize.width); + if ( !isHorizontalLayout ) { + maxTitleWidth[col] = MAX(maxTitleWidth[col], theSwatchSize.width); + } if ( col < desiredColumnWidths.count ) { id desiredColumnWidth = desiredColumnWidths[col]; @@ -786,13 +905,13 @@ -(void)recalculateLayout } // save row heights and column widths - CPTMutableNumberArray maxRowHeights = [[NSMutableArray alloc] initWithCapacity:rowCount]; + CPTMutableNumberArray *maxRowHeights = [[NSMutableArray alloc] initWithCapacity:rowCount]; for ( NSUInteger i = 0; i < rowCount; i++ ) { [maxRowHeights addObject:@(maxTitleHeight[i])]; } self.rowHeightsThatFit = maxRowHeights; - CPTMutableNumberArray maxColumnWidths = [[NSMutableArray alloc] initWithCapacity:columnCount]; + CPTMutableNumberArray *maxColumnWidths = [[NSMutableArray alloc] initWithCapacity:columnCount]; for ( NSUInteger i = 0; i < columnCount; i++ ) { [maxColumnWidths addObject:@(maxTitleWidth[i])]; } @@ -818,7 +937,10 @@ -(void)recalculateLayout } } if ( columnCount > 0 ) { - legendSize.width += ( (theSwatchSize.width + self.titleOffset + self.entryPaddingLeft + self.entryPaddingRight) * columnCount ) + ( self.columnMargin * (columnCount - 1) ); + legendSize.width += ((self.entryPaddingLeft + self.entryPaddingRight) * columnCount) + (self.columnMargin * (columnCount - 1)); + if ( isHorizontalLayout ) { + legendSize.width += (theSwatchSize.width + self.titleOffset) * columnCount; + } } NSUInteger rows = row; @@ -829,10 +951,13 @@ -(void)recalculateLayout legendSize.height += [height cgFloatValue]; } if ( rows > 0 ) { - legendSize.height += ( (self.entryPaddingBottom + self.entryPaddingTop) * rowCount ) + ( self.rowMargin * (rows - 1) ); + legendSize.height += ((self.entryPaddingBottom + self.entryPaddingTop) * rowCount) + (self.rowMargin * (rows - 1)); + if ( !isHorizontalLayout ) { + legendSize.height += (theSwatchSize.height + self.titleOffset) * rowCount; + } } - self.bounds = CPTRectMake( 0.0, 0.0, ceil(legendSize.width), ceil(legendSize.height) ); + self.bounds = CPTRectMake(0.0, 0.0, ceil(legendSize.width), ceil(legendSize.height)); [self pixelAlign]; self.layoutChanged = NO; @@ -846,7 +971,7 @@ -(void)recalculateLayout /** @brief All plots associated with the legend. * @return An array of all plots associated with the legend. **/ --(nonnull CPTPlotArray)allPlots +-(nonnull CPTPlotArray *)allPlots { return [NSArray arrayWithArray:self.plots]; } @@ -891,9 +1016,9 @@ -(void)addPlot:(nonnull CPTPlot *)plot [self.plots addObject:plot]; self.layoutChanged = YES; - CPTMutableLegendEntryArray theLegendEntries = self.legendEntries; - CPTTextStyle *theTextStyle = self.textStyle; - NSUInteger numberOfLegendEntries = [plot numberOfLegendEntries]; + CPTMutableLegendEntryArray *theLegendEntries = self.legendEntries; + CPTTextStyle *theTextStyle = self.textStyle; + NSUInteger numberOfLegendEntries = [plot numberOfLegendEntries]; for ( NSUInteger i = 0; i < numberOfLegendEntries; i++ ) { NSString *newTitle = [plot titleForLegendEntryAtIndex:i]; if ( newTitle ) { @@ -917,11 +1042,11 @@ -(void)addPlot:(nonnull CPTPlot *)plot -(void)insertPlot:(nonnull CPTPlot *)plot atIndex:(NSUInteger)idx { if ( [plot isKindOfClass:[CPTPlot class]] ) { - CPTMutablePlotArray thePlots = self.plots; + CPTMutablePlotArray *thePlots = self.plots; NSAssert(idx <= thePlots.count, @"index greater than the number of plots"); - CPTMutableLegendEntryArray theLegendEntries = self.legendEntries; - NSUInteger legendEntryIndex = 0; + CPTMutableLegendEntryArray *theLegendEntries = self.legendEntries; + NSUInteger legendEntryIndex = 0; if ( idx == thePlots.count ) { legendEntryIndex = theLegendEntries.count; } @@ -999,8 +1124,8 @@ -(void)removePlotWithIdentifier:(nullable id)identifier **/ -(void)removeLegendEntriesForPlot:(nonnull CPTPlot *)plot { - CPTMutableLegendEntryArray theLegendEntries = self.legendEntries; - CPTMutableLegendEntryArray entriesToRemove = [[NSMutableArray alloc] init]; + CPTMutableLegendEntryArray *theLegendEntries = self.legendEntries; + CPTMutableLegendEntryArray *entriesToRemove = [[NSMutableArray alloc] init]; for ( CPTLegendEntry *legendEntry in theLegendEntries ) { if ( legendEntry.plot == plot ) { @@ -1017,12 +1142,12 @@ -(void)removeLegendEntriesForPlot:(nonnull CPTPlot *)plot /// @cond --(void)legendNeedsRedraw:(nonnull NSNotification *)notif +-(void)legendNeedsRedraw:(nonnull NSNotification *__unused)notif { [self setNeedsDisplay]; } --(void)legendNeedsLayout:(nonnull NSNotification *)notif +-(void)legendNeedsLayout:(nonnull NSNotification *__unused)notif { self.layoutChanged = YES; [self setNeedsDisplay]; @@ -1032,7 +1157,7 @@ -(void)legendNeedsReloadEntries:(nonnull NSNotification *)notif { CPTPlot *thePlot = (CPTPlot *)notif.object; - CPTMutableLegendEntryArray theLegendEntries = self.legendEntries; + CPTMutableLegendEntryArray *theLegendEntries = self.legendEntries; NSUInteger legendEntryIndex = 0; @@ -1105,7 +1230,7 @@ -(void)legendEntryForInteractionPoint:(CGPoint)interactionPoint row:(nonnull NSU for ( NSNumber *height in self.rowHeightsThatFit ) { CGFloat rowHeight = height.cgFloatValue + padVertical; - if ( (interactionPoint.y <= position) && (interactionPoint.y >= position - rowHeight) ) { + if ((interactionPoint.y <= position) && (interactionPoint.y >= position - rowHeight)) { *row = i; break; } @@ -1121,7 +1246,7 @@ -(void)legendEntryForInteractionPoint:(CGPoint)interactionPoint row:(nonnull NSU for ( NSNumber *width in self.columnWidthsThatFit ) { CGFloat colWidth = width.cgFloatValue + swatchWidth + padHorizontal; - if ( (interactionPoint.x >= position) && (interactionPoint.x <= position + colWidth) ) { + if ((interactionPoint.x >= position) && (interactionPoint.x <= position + colWidth)) { *col = i; break; } @@ -1155,11 +1280,11 @@ -(void)legendEntryForInteractionPoint:(CGPoint)interactionPoint row:(nonnull NSU **/ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { - if ( self.hidden || (self.plots.count == 0) ) { + if ( self.hidden || (self.plots.count == 0)) { return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:touchDownAtIndex:)] || [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:touchDownAtIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:wasSelectedAtIndex:)] || @@ -1169,9 +1294,9 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) [self legendEntryForInteractionPoint:interactionPoint row:&row col:&col]; // Notify the delegate if we found a hit - if ( (row != NSNotFound) && (col != NSNotFound) ) { + if ((row != NSNotFound) && (col != NSNotFound)) { for ( CPTLegendEntry *legendEntry in self.legendEntries ) { - if ( (legendEntry.row == row) && (legendEntry.column == col) ) { + if ((legendEntry.row == row) && (legendEntry.column == col)) { self.pointingDeviceDownEntry = legendEntry; CPTPlot *legendPlot = legendEntry.plot; @@ -1226,11 +1351,11 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in self.pointingDeviceDownEntry = nil; - if ( self.hidden || (self.plots.count == 0) ) { + if ( self.hidden || (self.plots.count == 0)) { return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:touchUpAtIndex:)] || [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:touchUpAtIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:wasSelectedAtIndex:)] || @@ -1240,9 +1365,9 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in [self legendEntryForInteractionPoint:interactionPoint row:&row col:&col]; // Notify the delegate if we found a hit - if ( (row != NSNotFound) && (col != NSNotFound) ) { + if ((row != NSNotFound) && (col != NSNotFound)) { for ( CPTLegendEntry *legendEntry in self.legendEntries ) { - if ( (legendEntry.row == row) && (legendEntry.column == col) ) { + if ((legendEntry.row == row) && (legendEntry.column == col)) { BOOL handled = NO; CPTPlot *entryPlot = legendEntry.plot; @@ -1309,7 +1434,7 @@ -(void)setTextStyle:(nullable CPTTextStyle *)newTextStyle -(void)setSwatchSize:(CGSize)newSwatchSize { - if ( !CGSizeEqualToSize(newSwatchSize, swatchSize) ) { + if ( !CGSizeEqualToSize(newSwatchSize, swatchSize)) { swatchSize = newSwatchSize; self.layoutChanged = YES; } @@ -1319,10 +1444,10 @@ -(CGSize)swatchSize { CGSize theSwatchSize = swatchSize; - if ( CGSizeEqualToSize(theSwatchSize, CGSizeZero) ) { + if ( CGSizeEqualToSize(theSwatchSize, CGSizeZero)) { CPTTextStyle *theTextStyle = self.textStyle; CGFloat fontSize = theTextStyle.fontSize; - if ( fontSize > CPTFloat(0.0) ) { + if ( fontSize > CPTFloat(0.0)) { fontSize *= CPTFloat(1.5); fontSize = round(fontSize); theSwatchSize = CPTSizeMake(fontSize, fontSize); @@ -1446,7 +1571,7 @@ -(void)setEqualColumns:(BOOL)newEqualColumns } } --(void)setRowHeights:(nullable CPTNumberArray)newRowHeights +-(void)setRowHeights:(nullable CPTNumberArray *)newRowHeights { if ( newRowHeights != rowHeights ) { rowHeights = [newRowHeights copy]; @@ -1454,7 +1579,7 @@ -(void)setRowHeights:(nullable CPTNumberArray)newRowHeights } } --(void)setColumnWidths:(nullable CPTNumberArray)newColumnWidths +-(void)setColumnWidths:(nullable CPTNumberArray *)newColumnWidths { if ( newColumnWidths != columnWidths ) { columnWidths = [newColumnWidths copy]; @@ -1486,6 +1611,14 @@ -(void)setTitleOffset:(CGFloat)newTitleOffset } } +-(void)setSwatchLayout:(CPTLegendSwatchLayout)newSwatchLayout +{ + if ( newSwatchLayout != swatchLayout ) { + swatchLayout = newSwatchLayout; + self.layoutChanged = YES; + } +} + -(void)setLayoutChanged:(BOOL)newLayoutChanged { if ( newLayoutChanged != layoutChanged ) { @@ -1543,7 +1676,7 @@ -(void)setBorderLineStyle:(nullable CPTLineStyle *)newLineStyle } } --(nullable CPTNumberArray)rowHeightsThatFit +-(nullable CPTNumberArray *)rowHeightsThatFit { if ( !rowHeightsThatFit ) { [self recalculateLayout]; @@ -1551,7 +1684,7 @@ -(nullable CPTNumberArray)rowHeightsThatFit return rowHeightsThatFit; } --(nullable CPTNumberArray)columnWidthsThatFit +-(nullable CPTNumberArray *)columnWidthsThatFit { if ( !columnWidthsThatFit ) { [self recalculateLayout]; diff --git a/framework/Source/CPTLegendEntry.h b/framework/Source/CPTLegendEntry.h index f9fbe5d90..ce7af2388 100644 --- a/framework/Source/CPTLegendEntry.h +++ b/framework/Source/CPTLegendEntry.h @@ -9,18 +9,18 @@ /** * @brief An array of CPTLegendEntry objects. **/ -typedef NSArray *CPTLegendEntryArray; +typedef NSArray CPTLegendEntryArray; /** * @brief A mutable array of CPTLegendEntry objects. **/ -typedef NSMutableArray *CPTMutableLegendEntryArray; +typedef NSMutableArray CPTMutableLegendEntryArray; -@interface CPTLegendEntry : NSObject +@interface CPTLegendEntry : NSObject /// @name Plot Info /// @{ -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTPlot *plot; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTPlot *plot; @property (nonatomic, readwrite, assign) NSUInteger index; /// @} diff --git a/framework/Source/CPTLegendEntry.m b/framework/Source/CPTLegendEntry.m index 8fe8c9634..02f5bc365 100644 --- a/framework/Source/CPTLegendEntry.m +++ b/framework/Source/CPTLegendEntry.m @@ -23,7 +23,7 @@ @interface CPTLegendEntry() **/ @implementation CPTLegendEntry -/** @property nullable cpt_weak CPTPlot *plot +/** @property nullable CPTPlot *plot * @brief The plot associated with this legend entry. **/ @synthesize plot; @@ -86,7 +86,7 @@ @implementation CPTLegendEntry **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { plot = nil; index = 0; row = 0; @@ -114,18 +114,32 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - plot = [coder decodeObjectForKey:@"CPTLegendEntry.plot"]; + if ((self = [super init])) { + plot = [coder decodeObjectOfClass:[CPTPlot class] + forKey:@"CPTLegendEntry.plot"]; index = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegendEntry.index"]; row = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegendEntry.row"]; column = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegendEntry.column"]; - textStyle = [coder decodeObjectForKey:@"CPTLegendEntry.textStyle"]; + textStyle = [coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTLegendEntry.textStyle"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing @@ -136,18 +150,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder **/ -(void)drawTitleInRect:(CGRect)rect inContext:(nonnull CGContextRef)context scale:(CGFloat)scale { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGContextSaveGState(context); CGContextTranslateCTM(context, CPTFloat(0.0), rect.origin.y); - CGContextScaleCTM( context, CPTFloat(1.0), CPTFloat(-1.0) ); - CGContextTranslateCTM( context, CPTFloat(0.0), -CGRectGetMaxY(rect) ); + CGContextScaleCTM(context, CPTFloat(1.0), CPTFloat(-1.0)); + CGContextTranslateCTM(context, CPTFloat(0.0), -CGRectGetMaxY(rect)); #endif // center the title vertically CGRect textRect = rect; CGSize theTitleSize = self.titleSize; if ( theTitleSize.height < textRect.size.height ) { CGFloat offset = (textRect.size.height - theTitleSize.height) / CPTFloat(2.0); - if ( scale == CPTFloat(1.0) ) { + if ( scale == CPTFloat(1.0)) { offset = round(offset); } else { @@ -159,7 +173,7 @@ -(void)drawTitleInRect:(CGRect)rect inContext:(nonnull CGContextRef)context scal NSAttributedString *styledTitle = self.attributedTitle; - if ( (styledTitle.length > 0) && [styledTitle respondsToSelector:@selector(drawInRect:)] ) { + if ((styledTitle.length > 0) && [styledTitle respondsToSelector:@selector(drawInRect:)] ) { [styledTitle drawInRect:textRect inContext:context]; } @@ -175,7 +189,7 @@ -(void)drawTitleInRect:(CGRect)rect inContext:(nonnull CGContextRef)context scal inContext:context]; } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGContextRestoreGState(context); #endif } @@ -205,12 +219,8 @@ -(CGSize)titleSize NSAttributedString *styledTitle = self.attributedTitle; - if ( (styledTitle.length > 0) && [styledTitle respondsToSelector:@selector(size)] ) { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - theTitleSize = styledTitle.size; -#else - theTitleSize = NSSizeToCGSize(styledTitle.size); -#endif + if ( styledTitle.length > 0 ) { + theTitleSize = [styledTitle sizeAsDrawn]; } else { NSString *theTitle = styledTitle.string; diff --git a/framework/Source/CPTLimitBand.h b/framework/Source/CPTLimitBand.h index f15389e8c..e4c7700a3 100644 --- a/framework/Source/CPTLimitBand.h +++ b/framework/Source/CPTLimitBand.h @@ -7,14 +7,14 @@ /** * @brief An array of limit bands. **/ -typedef NSArray *CPTLimitBandArray; +typedef NSArray CPTLimitBandArray; /** * @brief A mutable array of limit bands. **/ -typedef NSMutableArray *CPTMutableLimitBandArray; +typedef NSMutableArray CPTMutableLimitBandArray; -@interface CPTLimitBand : NSObject +@interface CPTLimitBand : NSObject @property (nonatomic, readwrite, strong, nullable) CPTPlotRange *range; @property (nonatomic, readwrite, strong, nullable) CPTFill *fill; diff --git a/framework/Source/CPTLimitBand.m b/framework/Source/CPTLimitBand.m index f8738a301..2f75847c5 100644 --- a/framework/Source/CPTLimitBand.m +++ b/framework/Source/CPTLimitBand.m @@ -28,7 +28,7 @@ @implementation CPTLimitBand **/ +(nonnull instancetype)limitBandWithRange:(nullable CPTPlotRange *)newRange fill:(nullable CPTFill *)newFill { - return [[CPTLimitBand alloc] initWithRange:newRange fill:newFill]; + return [[self alloc] initWithRange:newRange fill:newFill]; } /** @brief Initializes a newly allocated CPTLimitBand object with the provided range and fill. @@ -38,7 +38,7 @@ +(nonnull instancetype)limitBandWithRange:(nullable CPTPlotRange *)newRange fill **/ -(nonnull instancetype)initWithRange:(nullable CPTPlotRange *)newRange fill:(nullable CPTFill *)newFill { - if ( (self = [super init]) ) { + if ((self = [super init])) { range = newRange; fill = newFill; } @@ -79,14 +79,8 @@ -(nonnull id)copyWithZone:(nullable NSZone *)zone -(void)encodeWithCoder:(nonnull NSCoder *)encoder { - if ( encoder.allowsKeyedCoding ) { - [encoder encodeObject:self.range forKey:@"CPTLimitBand.range"]; - [encoder encodeObject:self.fill forKey:@"CPTLimitBand.fill"]; - } - else { - [encoder encodeObject:self.range]; - [encoder encodeObject:self.fill]; - } + [encoder encodeObject:self.range forKey:@"CPTLimitBand.range"]; + [encoder encodeObject:self.fill forKey:@"CPTLimitBand.fill"]; } /// @endcond @@ -97,19 +91,27 @@ -(void)encodeWithCoder:(nonnull NSCoder *)encoder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder { - if ( (self = [super init]) ) { - if ( decoder.allowsKeyedCoding ) { - range = [decoder decodeObjectForKey:@"CPTLimitBand.range"]; - fill = [decoder decodeObjectForKey:@"CPTLimitBand.fill"]; - } - else { - range = [decoder decodeObject]; - fill = [decoder decodeObject]; - } + if ((self = [super init])) { + range = [decoder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTLimitBand.range"]; + fill = [decoder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTLimitBand.fill"]; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Description diff --git a/framework/Source/CPTLineCap.h b/framework/Source/CPTLineCap.h index b1ab81115..e6c0605ac 100644 --- a/framework/Source/CPTLineCap.h +++ b/framework/Source/CPTLineCap.h @@ -22,7 +22,7 @@ typedef NS_ENUM (NSInteger, CPTLineCapType) { CPTLineCapTypeCustom ///< Custom line cap. }; -@interface CPTLineCap : NSObject +@interface CPTLineCap : NSObject @property (nonatomic, readwrite, assign) CGSize size; @property (nonatomic, readwrite, assign) CPTLineCapType lineCapType; diff --git a/framework/Source/CPTLineCap.m b/framework/Source/CPTLineCap.m index 4bd91cf5d..5350d1149 100644 --- a/framework/Source/CPTLineCap.m +++ b/framework/Source/CPTLineCap.m @@ -80,7 +80,7 @@ @implementation CPTLineCap **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { size = CPTSizeMake(5.0, 5.0); lineCapType = CPTLineCapTypeNone; lineStyle = [[CPTLineStyle alloc] init]; @@ -124,11 +124,13 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - size = [coder decodeCPTSizeForKey:@"CPTLineCap.size"]; - lineCapType = (CPTLineCapType)[coder decodeIntegerForKey:@"CPTLineCap.lineCapType"]; - lineStyle = [coder decodeObjectForKey:@"CPTLineCap.lineStyle"]; - fill = [coder decodeObjectForKey:@"CPTLineCap.fill"]; + if ((self = [super init])) { + size = [coder decodeCPTSizeForKey:@"CPTLineCap.size"]; + lineCapType = (CPTLineCapType)[coder decodeIntegerForKey:@"CPTLineCap.lineCapType"]; + lineStyle = [coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTLineCap.lineStyle"]; + fill = [coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTLineCap.fill"]; customLineCapPath = [coder newCGPathDecodeForKey:@"CPTLineCap.customLineCapPath"]; usesEvenOddClipRule = [coder decodeBoolForKey:@"CPTLineCap.usesEvenOddClipRule"]; @@ -139,6 +141,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Accessors @@ -146,7 +160,7 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder -(void)setSize:(CGSize)newSize { - if ( !CGSizeEqualToSize(newSize, size) ) { + if ( !CGSizeEqualToSize(newSize, size)) { size = newSize; self.cachedLineCapPath = NULL; } @@ -417,16 +431,16 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context atPoint:(CGPoint)ce if ( theLineStyle || theFill ) { CGContextSaveGState(context); CGContextTranslateCTM(context, center.x, center.y); - CGContextRotateCTM( context, atan2(direction.y, direction.x) - CPTFloat(M_PI_2) ); // standard symbol points up + CGContextRotateCTM(context, atan2(direction.y, direction.x) - CPTFloat(M_PI_2)); // standard symbol points up if ( theFill ) { // use fillRect instead of fillPath so that images and gradients are properly centered in the symbol CGSize symbolSize = self.size; - CGSize halfSize = CPTSizeMake( symbolSize.width / CPTFloat(2.0), symbolSize.height / CPTFloat(2.0) ); + CGSize halfSize = CPTSizeMake(symbolSize.width / CPTFloat(2.0), symbolSize.height / CPTFloat(2.0)); CGRect bounds = CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height); CGContextSaveGState(context); - if ( !CGPathIsEmpty(theLineCapPath) ) { + if ( !CGPathIsEmpty(theLineCapPath)) { CGContextBeginPath(context); CGContextAddPath(context, theLineCapPath); if ( self.usesEvenOddClipRule ) { @@ -466,7 +480,7 @@ -(nonnull CGPathRef)newLineCapPath { CGFloat dx, dy; CGSize lineCapSize = self.size; - CGSize halfSize = CPTSizeMake( lineCapSize.width / CPTFloat(2.0), lineCapSize.height / CPTFloat(2.0) ); + CGSize halfSize = CPTSizeMake(lineCapSize.width / CPTFloat(2.0), lineCapSize.height / CPTFloat(2.0)); CGMutablePathRef lineCapPath = CGPathCreateMutable(); @@ -477,47 +491,47 @@ -(nonnull CGPathRef)newLineCapPath case CPTLineCapTypeOpenArrow: CGPathMoveToPoint(lineCapPath, NULL, -halfSize.width, -halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0) ); + CGPathAddLineToPoint(lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0)); CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width, -halfSize.height); break; case CPTLineCapTypeSolidArrow: CGPathMoveToPoint(lineCapPath, NULL, -halfSize.width, -halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0) ); + CGPathAddLineToPoint(lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0)); CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width, -halfSize.height); CGPathCloseSubpath(lineCapPath); break; case CPTLineCapTypeSweptArrow: CGPathMoveToPoint(lineCapPath, NULL, -halfSize.width, -halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0) ); + CGPathAddLineToPoint(lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0)); CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width, -halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, CPTFloat(0.0), -lineCapSize.height * CPTFloat(0.375) ); + CGPathAddLineToPoint(lineCapPath, NULL, CPTFloat(0.0), -lineCapSize.height * CPTFloat(0.375)); CGPathCloseSubpath(lineCapPath); break; case CPTLineCapTypeRectangle: - CGPathAddRect( lineCapPath, NULL, CPTRectMake( -halfSize.width, -halfSize.height, halfSize.width * CPTFloat(2.0), halfSize.height * CPTFloat(2.0) ) ); + CGPathAddRect(lineCapPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, halfSize.width * CPTFloat(2.0), halfSize.height * CPTFloat(2.0))); break; case CPTLineCapTypeEllipse: - CGPathAddEllipseInRect( lineCapPath, NULL, CPTRectMake( -halfSize.width, -halfSize.height, halfSize.width * CPTFloat(2.0), halfSize.height * CPTFloat(2.0) ) ); + CGPathAddEllipseInRect(lineCapPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, halfSize.width * CPTFloat(2.0), halfSize.height * CPTFloat(2.0))); break; case CPTLineCapTypeDiamond: CGPathMoveToPoint(lineCapPath, NULL, CPTFloat(0.0), halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, halfSize.width, CPTFloat(0.0) ); + CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width, CPTFloat(0.0)); CGPathAddLineToPoint(lineCapPath, NULL, CPTFloat(0.0), -halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, -halfSize.width, CPTFloat(0.0) ); + CGPathAddLineToPoint(lineCapPath, NULL, -halfSize.width, CPTFloat(0.0)); CGPathCloseSubpath(lineCapPath); break; case CPTLineCapTypePentagon: CGPathMoveToPoint(lineCapPath, NULL, CPTFloat(0.0), halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); - CGPathAddLineToPoint( lineCapPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( lineCapPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( lineCapPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); + CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); + CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(lineCapPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(lineCapPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); CGPathCloseSubpath(lineCapPath); break; @@ -535,8 +549,8 @@ -(nonnull CGPathRef)newLineCapPath break; case CPTLineCapTypeBar: - CGPathMoveToPoint( lineCapPath, NULL, halfSize.width, CPTFloat(0.0) ); - CGPathAddLineToPoint( lineCapPath, NULL, -halfSize.width, CPTFloat(0.0) ); + CGPathMoveToPoint(lineCapPath, NULL, halfSize.width, CPTFloat(0.0)); + CGPathAddLineToPoint(lineCapPath, NULL, -halfSize.width, CPTFloat(0.0)); break; case CPTLineCapTypeCross: @@ -567,8 +581,8 @@ -(nonnull CGPathRef)newLineCapPath CGFloat dy1 = lineCapSize.height / oldBounds.size.height; CGAffineTransform scaleTransform = CGAffineTransformScale(CGAffineTransformIdentity, dx1, dy1); - scaleTransform = CGAffineTransformConcat( scaleTransform, - CGAffineTransformMakeTranslation(-halfSize.width, -halfSize.height) ); + scaleTransform = CGAffineTransformConcat(scaleTransform, + CGAffineTransformMakeTranslation(-halfSize.width, -halfSize.height)); CGPathAddPath(lineCapPath, &scaleTransform, customPath); } } @@ -587,11 +601,11 @@ -(nonnull CGPathRef)newLineCapPath -(nullable id)debugQuickLookObject { const CGSize symbolSize = self.size; - const CGSize halfSize = CPTSizeMake( symbolSize.width * CPTFloat(0.5), symbolSize.height * CPTFloat(0.5) ); + const CGSize halfSize = CPTSizeMake(symbolSize.width * CPTFloat(0.5), symbolSize.height * CPTFloat(0.5)); const CGRect rect = CGRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height); const CGPoint centerPoint = CGPointMake(halfSize.width, halfSize.height); - return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat scale, CGRect bounds) { + return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat __unused scale, CGRect bounds __unused) { [self renderAsVectorInContext:context atPoint:centerPoint inDirection:CGPointMake(1.0, 0.0)]; }); } diff --git a/framework/Source/CPTLineStyle.h b/framework/Source/CPTLineStyle.h index bb9534d16..2b5c687b7 100644 --- a/framework/Source/CPTLineStyle.h +++ b/framework/Source/CPTLineStyle.h @@ -10,20 +10,20 @@ /** * @brief An array of line styles. **/ -typedef NSArray *CPTLineStyleArray; +typedef NSArray CPTLineStyleArray; /** * @brief A mutable array of line styles. **/ -typedef NSMutableArray *CPTMutableLineStyleArray; +typedef NSMutableArray CPTMutableLineStyleArray; -@interface CPTLineStyle : NSObject +@interface CPTLineStyle : NSObject @property (nonatomic, readonly) CGLineCap lineCap; @property (nonatomic, readonly) CGLineJoin lineJoin; @property (nonatomic, readonly) CGFloat miterLimit; @property (nonatomic, readonly) CGFloat lineWidth; -@property (nonatomic, readonly, nullable) CPTNumberArray dashPattern; +@property (nonatomic, readonly, nullable) CPTNumberArray *dashPattern; @property (nonatomic, readonly) CGFloat patternPhase; @property (nonatomic, readonly, nullable) CPTColor *lineColor; @property (nonatomic, readonly, nullable) CPTFill *lineFill; diff --git a/framework/Source/CPTLineStyle.m b/framework/Source/CPTLineStyle.m index f01f95fd1..2208471f6 100644 --- a/framework/Source/CPTLineStyle.m +++ b/framework/Source/CPTLineStyle.m @@ -16,7 +16,7 @@ @interface CPTLineStyle() @property (nonatomic, readwrite, assign) CGLineJoin lineJoin; @property (nonatomic, readwrite, assign) CGFloat miterLimit; @property (nonatomic, readwrite, assign) CGFloat lineWidth; -@property (nonatomic, readwrite, strong, nullable) CPTNumberArray dashPattern; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *dashPattern; @property (nonatomic, readwrite, assign) CGFloat patternPhase; @property (nonatomic, readwrite, strong, nullable) CPTColor *lineColor; @property (nonatomic, readwrite, strong, nullable) CPTFill *lineFill; @@ -65,7 +65,7 @@ @implementation CPTLineStyle **/ @synthesize lineWidth; -/** @property nullable CPTNumberArray dashPattern +/** @property nullable CPTNumberArray *dashPattern * @brief The dash-and-space pattern for the line. Default is @nil. **/ @synthesize dashPattern; @@ -154,7 +154,7 @@ +(nonnull instancetype)lineStyleWithStyle:(nullable CPTLineStyle *)lineStyle **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { lineCap = kCGLineCapButt; lineJoin = kCGLineJoinMiter; miterLimit = CPTFloat(10.0); @@ -190,22 +190,38 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - lineCap = (CGLineCap)[coder decodeIntForKey:@"CPTLineStyle.lineCap"]; - lineJoin = (CGLineJoin)[coder decodeIntForKey:@"CPTLineStyle.lineJoin"]; - miterLimit = [coder decodeCGFloatForKey:@"CPTLineStyle.miterLimit"]; - lineWidth = [coder decodeCGFloatForKey:@"CPTLineStyle.lineWidth"]; - dashPattern = [coder decodeObjectForKey:@"CPTLineStyle.dashPattern"]; + if ((self = [super init])) { + lineCap = (CGLineCap)[coder decodeIntForKey:@"CPTLineStyle.lineCap"]; + lineJoin = (CGLineJoin)[coder decodeIntForKey:@"CPTLineStyle.lineJoin"]; + miterLimit = [coder decodeCGFloatForKey:@"CPTLineStyle.miterLimit"]; + lineWidth = [coder decodeCGFloatForKey:@"CPTLineStyle.lineWidth"]; + dashPattern = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTLineStyle.dashPattern"]; patternPhase = [coder decodeCGFloatForKey:@"CPTLineStyle.patternPhase"]; - lineColor = [coder decodeObjectForKey:@"CPTLineStyle.lineColor"]; - lineFill = [coder decodeObjectForKey:@"CPTLineStyle.lineFill"]; - lineGradient = [coder decodeObjectForKey:@"CPTLineStyle.lineGradient"]; + lineColor = [coder decodeObjectOfClass:[CPTColor class] + forKey:@"CPTLineStyle.lineColor"]; + lineFill = [coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTLineStyle.lineFill"]; + lineGradient = [coder decodeObjectOfClass:[CPTGradient class] + forKey:@"CPTLineStyle.lineGradient"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing @@ -219,11 +235,11 @@ -(void)setLineStyleInContext:(nonnull CGContextRef)context CGContextSetMiterLimit(context, self.miterLimit); CGContextSetLineWidth(context, self.lineWidth); - CPTNumberArray myDashPattern = self.dashPattern; + CPTNumberArray *myDashPattern = self.dashPattern; NSUInteger dashCount = myDashPattern.count; if ( dashCount > 0 ) { - CGFloat *dashLengths = (CGFloat *)calloc( dashCount, sizeof(CGFloat) ); + CGFloat *dashLengths = (CGFloat *)calloc(dashCount, sizeof(CGFloat)); NSUInteger dashCounter = 0; for ( NSNumber *currentDashLength in myDashPattern ) { @@ -293,7 +309,7 @@ -(void)strokeRect:(CGRect)rect inContext:(nonnull CGContextRef)context -(void)strokePathWithGradient:(nonnull CPTGradient *)gradient inContext:(nonnull CGContextRef)context { if ( gradient ) { - CGRect deviceRect = CGContextConvertRectToDeviceSpace( context, CPTRectMake(0.0, 0.0, 1.0, 1.0) ); + CGRect deviceRect = CGContextConvertRectToDeviceSpace(context, CPTRectMake(0.0, 0.0, 1.0, 1.0)); CGFloat step = CPTFloat(2.0) / deviceRect.size.height; @@ -303,7 +319,7 @@ -(void)strokePathWithGradient:(nonnull CPTGradient *)gradient inContext:(nonnull CGContextBeginPath(context); CGFloat width = startWidth; - while ( width > CPTFloat(0.0) ) { + while ( width > CPTFloat(0.0)) { CGContextSetLineWidth(context, width); CGColorRef gradientColor = [gradient newColorAtPosition:CPTFloat(1.0) - width / startWidth]; @@ -405,7 +421,7 @@ -(nullable id)debugQuickLookObject { const CGRect rect = CGRectMake(0.0, 0.0, 100.0, 100.0); - return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat scale, CGRect bounds) { + return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat __unused scale, CGRect bounds) { const CGRect alignedRect = CPTAlignBorderedRectToUserSpace(context, bounds, self); [self setLineStyleInContext:context]; diff --git a/framework/Source/CPTLineStyleTests.m b/framework/Source/CPTLineStyleTests.m index ec90f91cc..89772788a 100644 --- a/framework/Source/CPTLineStyleTests.m +++ b/framework/Source/CPTLineStyleTests.m @@ -11,7 +11,7 @@ -(void)testKeyedArchivingRoundTrip { CPTLineStyle *lineStyle = [CPTLineStyle lineStyle]; - CPTLineStyle *newLineStyle = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:lineStyle]]; + CPTLineStyle *newLineStyle = [self archiveRoundTrip:lineStyle]; XCTAssertEqual(newLineStyle.lineCap, lineStyle.lineCap, @"Line cap not equal"); XCTAssertEqual(newLineStyle.lineJoin, lineStyle.lineJoin, @"Line join not equal"); diff --git a/framework/Source/CPTMutableLineStyle.h b/framework/Source/CPTMutableLineStyle.h index a42eadb47..0d69bb453 100644 --- a/framework/Source/CPTMutableLineStyle.h +++ b/framework/Source/CPTMutableLineStyle.h @@ -8,7 +8,7 @@ @property (nonatomic, readwrite, assign) CGLineJoin lineJoin; @property (nonatomic, readwrite, assign) CGFloat miterLimit; @property (nonatomic, readwrite, assign) CGFloat lineWidth; -@property (nonatomic, readwrite, strong, nullable) CPTNumberArray dashPattern; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *dashPattern; @property (nonatomic, readwrite, assign) CGFloat patternPhase; @property (nonatomic, readwrite, strong, nullable) CPTColor *lineColor; @property (nonatomic, readwrite, strong, nullable) CPTFill *lineFill; diff --git a/framework/Source/CPTMutableLineStyle.m b/framework/Source/CPTMutableLineStyle.m index c5a4b4e89..1a69123e2 100644 --- a/framework/Source/CPTMutableLineStyle.m +++ b/framework/Source/CPTMutableLineStyle.m @@ -29,7 +29,7 @@ @implementation CPTMutableLineStyle **/ @dynamic lineWidth; -/** @property nullable CPTNumberArray dashPattern +/** @property nullable CPTNumberArray *dashPattern * @brief The dash-and-space pattern for the line. Default is @nil. **/ @dynamic dashPattern; diff --git a/framework/Source/CPTMutableNumericData.h b/framework/Source/CPTMutableNumericData.h index a53de71c3..32d299487 100644 --- a/framework/Source/CPTMutableNumericData.h +++ b/framework/Source/CPTMutableNumericData.h @@ -10,13 +10,13 @@ /// @name Dimensions /// @{ -@property (nonatomic, readwrite, copy, nonnull) CPTNumberArray shape; +@property (nonatomic, readwrite, copy, nonnull) CPTNumberArray *shape; /// @} /// @name Samples /// @{ -(nullable void *)mutableSamplePointer:(NSUInteger)sample NS_RETURNS_INNER_POINTER; --(nullable void *)mutableSamplePointerAtIndex:(NSUInteger)idx, ...NS_RETURNS_INNER_POINTER; +-(nullable void *)mutableSamplePointerAtIndex:(NSUInteger)idx, ... NS_RETURNS_INNER_POINTER; /// @} @end diff --git a/framework/Source/CPTMutableNumericData.m b/framework/Source/CPTMutableNumericData.m index d977e5ae6..631d70704 100644 --- a/framework/Source/CPTMutableNumericData.m +++ b/framework/Source/CPTMutableNumericData.m @@ -29,7 +29,7 @@ @implementation CPTMutableNumericData **/ @dynamic mutableBytes; -/** @property nonnull CPTNumberArray shape +/** @property nonnull CPTNumberArray *shape * @brief The shape of the data buffer array. Set a new shape to change the size of the data buffer. * * The shape describes the dimensions of the sample array stored in @@ -49,7 +49,7 @@ @implementation CPTMutableNumericData -(nullable void *)mutableSamplePointer:(NSUInteger)sample { if ( sample < self.numberOfSamples ) { - return (void *)( (char *)self.mutableBytes + sample * self.sampleBytes ); + return (void *)((char *)self.mutableBytes + sample * self.sampleBytes); } else { return NULL; @@ -62,7 +62,7 @@ -(nullable void *)mutableSamplePointer:(NSUInteger)sample * @return A pointer to the sample or @NULL if any of the sample indices are out of bounds. **/ -(nullable void *)mutableSamplePointerAtIndex:(NSUInteger)idx, ... - { +{ NSUInteger newIndex; if ( self.numberOfDimensions > 1 ) { @@ -87,7 +87,7 @@ -(nullable void *)mutableSamplePointerAtIndex:(NSUInteger)idx, ... -(nonnull void *)mutableBytes { - return ( (NSMutableData *)self.data ).mutableBytes; + return ((NSMutableData *)self.data).mutableBytes; } /// @endcond diff --git a/framework/Source/CPTMutableNumericDataTests.m b/framework/Source/CPTMutableNumericDataTests.m index a1bf3d728..d5cc0870a 100644 --- a/framework/Source/CPTMutableNumericDataTests.m +++ b/framework/Source/CPTMutableNumericDataTests.m @@ -28,7 +28,7 @@ -(void)testNumberOfDimensionsGivesShapeCount NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; CPTMutableNumericData *nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:shape]; XCTAssertEqual(nd.numberOfDimensions, nd.shape.count, @"numberOfDimensions == shape.count == 3"); @@ -47,7 +47,7 @@ -(void)testNilShapeCorrectElementCount NSUInteger prod = 1; for ( NSNumber *num in nd.shape ) { - prod *= num.unsignedIntValue; + prod *= num.unsignedIntegerValue; } XCTAssertEqual(prod, nElems, @"prod == nElems"); @@ -64,7 +64,7 @@ -(void)testIllegalShapeRaisesException NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(NSUInteger)]; XCTAssertThrowsSpecificNamed(testData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTUnsignedIntegerDataType, sizeof(NSUInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTUnsignedIntegerDataType, sizeof(NSUInteger), NSHostByteOrder()) shape:shape], NSException, CPTNumericDataException, @@ -95,7 +95,7 @@ -(void)testBytesEqualDataBytes } CPTMutableNumericData *nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()) shape:nil]; NSMutableData *expected = data; @@ -113,10 +113,10 @@ -(void)testArchivingRoundTrip } CPTMutableNumericData *nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - CPTMutableNumericData *nd2 = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:nd]]; + CPTMutableNumericData *nd2 = [self archiveRoundTrip:nd]; XCTAssertTrue([nd.data isEqualToData:nd2.data], @"equal data"); @@ -140,7 +140,7 @@ -(void)testNumberOfSamplesCorrectForDataType } CPTMutableNumericData *nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd numberOfSamples], nElems, @"numberOfSamples == nElems"); @@ -153,7 +153,7 @@ -(void)testNumberOfSamplesCorrectForDataType } nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(char), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(char), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd numberOfSamples], nElems, @"numberOfSamples == nElems"); @@ -170,7 +170,7 @@ -(void)testDataTypeAccessorsCorrectForDataType } CPTMutableNumericData *nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd dataTypeFormat], CPTFloatingPointDataType, @"dataTypeFormat"); @@ -189,7 +189,7 @@ -(void)testConvertTypeConvertsType } CPTMutableNumericData *fd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; CPTNumericData *dd = [fd dataByConvertingToType:CPTFloatingPointDataType @@ -198,7 +198,7 @@ -(void)testConvertTypeConvertsType const double *doubleSamples = (const double *)dd.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertTrue( (double)samples[i] == doubleSamples[i], @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i] ); + XCTAssertTrue((double)samples[i] == doubleSamples[i], @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i]); } } @@ -213,12 +213,12 @@ -(void)testSamplePointerCorrect } CPTMutableNumericData *fd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - XCTAssertEqual( ( (float *)[fd mutableBytes] ) + 4, (float *)[fd mutableSamplePointer:4], @"%p,%p", samples + 4, (float *)[fd mutableSamplePointer:4] ); - XCTAssertEqual( ( (float *)[fd mutableBytes] ), (float *)[fd mutableSamplePointer:0], @"" ); - XCTAssertEqual( ( (float *)[fd mutableBytes] ) + nElems - 1, (float *)[fd mutableSamplePointer:nElems - 1], @"" ); + XCTAssertEqual(((float *)[fd mutableBytes]) + 4, (float *)[fd mutableSamplePointer:4], @"%p,%p", samples + 4, (float *)[fd mutableSamplePointer:4]); + XCTAssertEqual(((float *)[fd mutableBytes]), (float *)[fd mutableSamplePointer:0], @""); + XCTAssertEqual(((float *)[fd mutableBytes]) + nElems - 1, (float *)[fd mutableSamplePointer:nElems - 1], @""); XCTAssertNil([fd samplePointer:nElems], @"too many samples"); } @@ -233,7 +233,7 @@ -(void)testSampleValueCorrect } CPTMutableNumericData *fd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqualWithAccuracy([[fd sampleValue:0] doubleValue], sin(0), 0.01, @"sample value"); @@ -245,13 +245,13 @@ -(void)testMutableCopy const NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; CPTMutableNumericData *ndCopy = [nd mutableCopy]; // should be mutable--if not, this will error - ndCopy.dataType = CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ); + ndCopy.dataType = CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()); } @end diff --git a/framework/Source/CPTMutableNumericDataTypeConversionTests.m b/framework/Source/CPTMutableNumericDataTypeConversionTests.m index ff8105309..2c01ecfe5 100644 --- a/framework/Source/CPTMutableNumericDataTypeConversionTests.m +++ b/framework/Source/CPTMutableNumericDataTypeConversionTests.m @@ -18,14 +18,14 @@ -(void)testFloatToDoubleInPlaceConversion } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; numericData.sampleBytes = sizeof(double); const double *doubleSamples = (const double *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (double)samples[i], doubleSamples[i], precision, @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i] ); + XCTAssertEqualWithAccuracy((double)samples[i], doubleSamples[i], precision, @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i]); } } @@ -39,14 +39,14 @@ -(void)testDoubleToFloatInPlaceConversion } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()) shape:nil]; numericData.sampleBytes = sizeof(float); const float *floatSamples = (const float *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (double)floatSamples[i], samples[i], precision, @"(float)%g != (double)%g", (double)floatSamples[i], samples[i] ); + XCTAssertEqualWithAccuracy((double)floatSamples[i], samples[i], precision, @"(float)%g != (double)%g", (double)floatSamples[i], samples[i]); } } @@ -60,14 +60,14 @@ -(void)testFloatToIntegerInPlaceConversion } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - numericData.dataType = CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ); + numericData.dataType = CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()); const NSInteger *intSamples = (const NSInteger *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (NSInteger)samples[i], intSamples[i], precision, @"(float)%g != (NSInteger)%ld", (double)samples[i], (long)intSamples[i] ); + XCTAssertEqualWithAccuracy((NSInteger)samples[i], intSamples[i], precision, @"(float)%g != (NSInteger)%ld", (double)samples[i], (long)intSamples[i]); } } @@ -81,10 +81,10 @@ -(void)testIntegerToFloatInPlaceConversion } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()) shape:nil]; - numericData.dataType = CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ); + numericData.dataType = CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()); const float *floatSamples = (const float *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { @@ -98,14 +98,14 @@ -(void)testDecimalToDoubleInPlaceConversion NSDecimal *samples = (NSDecimal *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - samples[i] = CPTDecimalFromDouble( sin(i) ); + samples[i] = CPTDecimalFromDouble(sin(i)); } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder() ) + dataType:CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder()) shape:nil]; - numericData.dataType = CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ); + numericData.dataType = CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()); const double *doubleSamples = (const double *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { @@ -123,14 +123,14 @@ -(void)testDoubleToDecimalInPlaceConversion } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()) shape:nil]; - numericData.dataType = CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder() ); + numericData.dataType = CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder()); const NSDecimal *decimalSamples = (const NSDecimal *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertTrue(CPTDecimalEquals( decimalSamples[i], CPTDecimalFromDouble(samples[i]) ), @"(NSDecimal)%@ != (double)%g", CPTDecimalStringValue(decimalSamples[i]), samples[i]); + XCTAssertTrue(CPTDecimalEquals(decimalSamples[i], CPTDecimalFromDouble(samples[i])), @"(NSDecimal)%@ != (double)%g", CPTDecimalStringValue(decimalSamples[i]), samples[i]); } } @@ -177,7 +177,7 @@ -(void)testTypeConversionSwapsByteOrderDoubleInPlace uint64_t end = *(const uint64_t *)numericData.bytes; union swap { - double v; + double v; CFSwappedFloat64 sv; } result; diff --git a/framework/Source/CPTMutablePlotRange.m b/framework/Source/CPTMutablePlotRange.m index 4f17749f1..eb1079824 100644 --- a/framework/Source/CPTMutablePlotRange.m +++ b/framework/Source/CPTMutablePlotRange.m @@ -73,24 +73,76 @@ -(void)unionPlotRange:(nullable CPTPlotRange *)other NSDecimal min1 = self.minLimitDecimal; NSDecimal min2 = other.minLimitDecimal; - NSDecimal minimum = CPTDecimalLessThan(min1, min2) ? min1 : min2; + NSDecimal minimum = CPTDecimalMin(min1, min2); NSDecimal max1 = self.maxLimitDecimal; NSDecimal max2 = other.maxLimitDecimal; - NSDecimal maximum = CPTDecimalGreaterThan(max1, max2) ? max1 : max2; - - NSDecimal newLocation, newLength; - if ( CPTDecimalGreaterThanOrEqualTo( self.lengthDecimal, CPTDecimalFromInteger(0) ) ) { - newLocation = minimum; - newLength = CPTDecimalSubtract(maximum, minimum); + NSDecimal maximum = CPTDecimalMax(max1, max2); + + if ( self.isInfinite && other.isInfinite ) { + if ( self.lengthSign == other.lengthSign ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + break; + + case CPTSignNegative: + self.locationDecimal = maximum; + break; + + default: + break; + } + } + else { + self.locationDouble = -HUGE_VAL; + self.lengthDouble = HUGE_VAL; + } + } + else if ( self.isInfinite && !other.isInfinite ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + break; + + case CPTSignNegative: + self.locationDecimal = maximum; + break; + + default: + break; + } + } + else if ( !self.isInfinite && other.isInfinite ) { + switch ( other.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + self.lengthDouble = HUGE_VAL; + break; + + case CPTSignNegative: + self.locationDecimal = maximum; + self.lengthDouble = -HUGE_VAL; + break; + + default: + break; + } + } + else if ( NSDecimalIsNotANumber(&minimum) || NSDecimalIsNotANumber(&maximum)) { + self.locationDecimal = CPTDecimalNaN(); + self.lengthDecimal = CPTDecimalNaN(); } else { - newLocation = maximum; - newLength = CPTDecimalSubtract(minimum, maximum); + if ( CPTDecimalGreaterThanOrEqualTo(self.lengthDecimal, CPTDecimalFromInteger(0))) { + self.locationDecimal = minimum; + self.lengthDecimal = CPTDecimalSubtract(maximum, minimum); + } + else { + self.locationDecimal = maximum; + self.lengthDecimal = CPTDecimalSubtract(minimum, maximum); + } } - - self.locationDecimal = newLocation; - self.lengthDecimal = newLength; } /** @brief Sets the messaged object to the intersection with another range. The sign of @ref length is unchanged. @@ -104,28 +156,75 @@ -(void)intersectionPlotRange:(nullable CPTPlotRange *)other NSDecimal min1 = self.minLimitDecimal; NSDecimal min2 = other.minLimitDecimal; - NSDecimal minimum = CPTDecimalGreaterThan(min1, min2) ? min1 : min2; + NSDecimal minimum = CPTDecimalMax(min1, min2); NSDecimal max1 = self.maxLimitDecimal; NSDecimal max2 = other.maxLimitDecimal; - NSDecimal maximum = CPTDecimalLessThan(max1, max2) ? max1 : max2; + NSDecimal maximum = CPTDecimalMin(max1, max2); - if ( CPTDecimalGreaterThanOrEqualTo(maximum, minimum) ) { - NSDecimal newLocation, newLength; - if ( CPTDecimalGreaterThanOrEqualTo( self.lengthDecimal, CPTDecimalFromInteger(0) ) ) { - newLocation = minimum; - newLength = CPTDecimalSubtract(maximum, minimum); + if ( ![self intersectsRange:other] ) { + self.locationDecimal = CPTDecimalNaN(); + self.lengthDecimal = CPTDecimalNaN(); + } + else if ( self.isInfinite && other.isInfinite ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + break; + + case CPTSignNegative: + self.locationDecimal = maximum; + break; + + default: + break; } - else { - newLocation = maximum; - newLength = CPTDecimalSubtract(minimum, maximum); + } + else if ( self.isInfinite && !other.isInfinite ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + self.lengthDecimal = CPTDecimalSubtract(other.maxLimitDecimal, minimum); + break; + + case CPTSignNegative: + self.locationDecimal = maximum; + self.lengthDecimal = CPTDecimalSubtract(other.minLimitDecimal, maximum); + break; + + default: + break; + } + } + else if ( !self.isInfinite && other.isInfinite ) { + switch ( other.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + self.lengthDecimal = CPTDecimalSubtract(self.maxLimitDecimal, minimum); + break; + + case CPTSignNegative: + self.locationDecimal = maximum; + self.lengthDecimal = CPTDecimalSubtract(self.minLimitDecimal, maximum); + break; + + default: + break; } - - self.locationDecimal = newLocation; - self.lengthDecimal = newLength; + } + else if ( NSDecimalIsNotANumber(&minimum) || NSDecimalIsNotANumber(&maximum)) { + self.locationDecimal = CPTDecimalNaN(); + self.lengthDecimal = CPTDecimalNaN(); } else { - self.lengthDecimal = CPTDecimalFromInteger(0); + if ( CPTDecimalGreaterThanOrEqualTo(self.lengthDecimal, CPTDecimalFromInteger(0))) { + self.locationDecimal = minimum; + self.lengthDecimal = CPTDecimalSubtract(maximum, minimum); + } + else { + self.locationDecimal = maximum; + self.lengthDecimal = CPTDecimalSubtract(minimum, maximum); + } } } @@ -140,7 +239,7 @@ -(void)expandRangeByFactor:(nonnull NSNumber *)factor { NSDecimal oldLength = self.lengthDecimal; NSDecimal newLength = CPTDecimalMultiply(oldLength, factor.decimalValue); - NSDecimal locationOffset = CPTDecimalDivide( CPTDecimalSubtract(oldLength, newLength), CPTDecimalFromInteger(2) ); + NSDecimal locationOffset = CPTDecimalDivide(CPTDecimalSubtract(oldLength, newLength), CPTDecimalFromInteger(2)); NSDecimal newLocation = CPTDecimalAdd(self.locationDecimal, locationOffset); self.locationDecimal = newLocation; @@ -201,8 +300,10 @@ -(void)shiftEndToFitInRange:(nonnull CPTPlotRange *)otherRange /// @cond --(void)setLocation:(NSNumber *)newLocation +-(void)setLocation:(nonnull NSNumber *)newLocation { + NSParameterAssert(newLocation); + self.inValueUpdate = YES; self.locationDecimal = newLocation.decimalValue; @@ -211,8 +312,10 @@ -(void)setLocation:(NSNumber *)newLocation self.inValueUpdate = NO; } --(void)setLength:(NSNumber *)newLength +-(void)setLength:(nonnull NSNumber *)newLength { + NSParameterAssert(newLength); + self.inValueUpdate = YES; self.lengthDecimal = newLength.decimalValue; diff --git a/framework/Source/CPTMutableTextStyle.h b/framework/Source/CPTMutableTextStyle.h index 471a79bb0..e63ec361f 100644 --- a/framework/Source/CPTMutableTextStyle.h +++ b/framework/Source/CPTMutableTextStyle.h @@ -4,6 +4,7 @@ @interface CPTMutableTextStyle : CPTTextStyle +@property (readwrite, strong, nonatomic, nullable) CPTNativeFont *font; @property (readwrite, copy, nonatomic, nullable) NSString *fontName; @property (readwrite, assign, nonatomic) CGFloat fontSize; @property (readwrite, copy, nonatomic, nullable) CPTColor *color; diff --git a/framework/Source/CPTMutableTextStyle.m b/framework/Source/CPTMutableTextStyle.m index 0d63a221f..50cce383a 100644 --- a/framework/Source/CPTMutableTextStyle.m +++ b/framework/Source/CPTMutableTextStyle.m @@ -7,13 +7,20 @@ @implementation CPTMutableTextStyle +/** @property CPTNativeFont* font + * @brief The font. Default is @nil. + * + * Font will override fontName and fontSize if not @nil. + **/ +@synthesize font; + /** @property CGFloat fontSize - * @brief The font size. Default is @num{12.0}. + * @brief The font size. Default is @num{12.0}. Ignored if font is not @nil. **/ @dynamic fontSize; /** @property nullable NSString *fontName - * @brief The font name. Default is Helvetica. + * @brief The font name. Default is Helvetica. Ignored if font is not @nil. **/ @dynamic fontName; diff --git a/framework/Source/CPTNumericData+TypeConversion.m b/framework/Source/CPTNumericData+TypeConversion.m index 2790710ab..2ebfd19a1 100644 --- a/framework/Source/CPTNumericData+TypeConversion.m +++ b/framework/Source/CPTNumericData+TypeConversion.m @@ -1,7 +1,7 @@ #import "CPTNumericData+TypeConversion.h" -#import "CPTUtilities.h" #import "complex.h" +#import "CPTUtilities.h" @implementation CPTNumericData(TypeConversion) @@ -29,17 +29,17 @@ -(nonnull CPTNumericData *)dataByConvertingToDataType:(CPTNumericDataType)newDat NSParameterAssert(myDataType.dataTypeFormat != CPTUndefinedDataType); NSParameterAssert(myDataType.byteOrder != CFByteOrderUnknown); - NSParameterAssert( CPTDataTypeIsSupported(newDataType) ); + NSParameterAssert(CPTDataTypeIsSupported(newDataType)); NSParameterAssert(newDataType.dataTypeFormat != CPTUndefinedDataType); NSParameterAssert(newDataType.byteOrder != CFByteOrderUnknown); NSData *newData = nil; CFByteOrder hostByteOrder = CFByteOrderGetCurrent(); - if ( CPTDataTypeEqualToDataType(myDataType, newDataType) ) { + if ( CPTDataTypeEqualToDataType(myDataType, newDataType)) { newData = self.data; } - else if ( ( myDataType.sampleBytes == sizeof(int8_t) ) && ( newDataType.sampleBytes == sizeof(int8_t) ) ) { + else if ((myDataType.sampleBytes == sizeof(int8_t)) && (newDataType.sampleBytes == sizeof(int8_t))) { newData = self.data; } else { @@ -105,7 +105,7 @@ case sizeof(int8_t): switch ( destDataType->sampleBytes ) { case sizeof(int8_t): { // int8_t -> int8_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int8_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int8_t)); } break; @@ -281,7 +281,7 @@ case sizeof(int8_t): case sizeof(int16_t): { // int16_t -> int16_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int16_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int16_t)); } break; @@ -457,7 +457,7 @@ case sizeof(int16_t): case sizeof(int32_t): { // int32_t -> int32_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int32_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int32_t)); } break; @@ -633,7 +633,7 @@ case sizeof(int32_t): case sizeof(int64_t): { // int64_t -> int64_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int64_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int64_t)); } break; } @@ -817,7 +817,7 @@ case sizeof(int64_t): switch ( destDataType->sampleBytes ) { case sizeof(uint8_t): { // uint8_t -> uint8_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint8_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint8_t)); } break; @@ -993,7 +993,7 @@ case sizeof(uint8_t): case sizeof(uint16_t): { // uint16_t -> uint16_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint16_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint16_t)); } break; @@ -1169,7 +1169,7 @@ case sizeof(uint16_t): case sizeof(uint32_t): { // uint32_t -> uint32_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint32_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint32_t)); } break; @@ -1345,7 +1345,7 @@ case sizeof(uint32_t): case sizeof(uint64_t): { // uint64_t -> uint64_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint64_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint64_t)); } break; } @@ -1529,7 +1529,7 @@ case sizeof(uint64_t): switch ( destDataType->sampleBytes ) { case sizeof(float): { // float -> float - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(float) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(float)); } break; @@ -1705,7 +1705,7 @@ case sizeof(float): case sizeof(double): { // double -> double - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(double) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(double)); } break; } @@ -1889,7 +1889,7 @@ case sizeof(double): switch ( destDataType->sampleBytes ) { case sizeof(float complex): { // float complex -> float complex - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(float complex) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(float complex)); } break; @@ -1914,7 +1914,7 @@ case sizeof(NSDecimal): const float complex *lastSample = fromBytes + sampleCount; NSDecimal *toBytes = (NSDecimal *)destData.mutableBytes; while ( fromBytes < lastSample ) { - *toBytes++ = CPTDecimalFromFloat( crealf(*fromBytes++) ); + *toBytes++ = CPTDecimalFromFloat(crealf(*fromBytes++)); } } break; @@ -2065,7 +2065,7 @@ case sizeof(float complex): case sizeof(double complex): { // double complex -> double complex - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(double complex) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(double complex)); } break; } @@ -2079,7 +2079,7 @@ case sizeof(NSDecimal): const double complex *lastSample = fromBytes + sampleCount; NSDecimal *toBytes = (NSDecimal *)destData.mutableBytes; while ( fromBytes < lastSample ) { - *toBytes++ = CPTDecimalFromDouble( creal(*fromBytes++) ); + *toBytes++ = CPTDecimalFromDouble(creal(*fromBytes++)); } } break; @@ -2249,7 +2249,7 @@ case sizeof(double complex): switch ( destDataType->sampleBytes ) { case sizeof(NSDecimal): { // NSDecimal -> NSDecimal - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(NSDecimal) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(NSDecimal)); } break; } diff --git a/framework/Source/CPTNumericData.h b/framework/Source/CPTNumericData.h index 5eaee1435..0215482fc 100644 --- a/framework/Source/CPTNumericData.h +++ b/framework/Source/CPTNumericData.h @@ -1,7 +1,7 @@ #import "CPTDefinitions.h" #import "CPTNumericDataType.h" -@interface CPTNumericData : NSObject +@interface CPTNumericData : NSObject /// @name Data Buffer /// @{ @@ -20,7 +20,7 @@ /// @name Dimensions /// @{ -@property (nonatomic, readonly, copy, nonnull) CPTNumberArray shape; +@property (nonatomic, readonly, copy, nonnull) CPTNumberArray *shape; @property (nonatomic, readonly) NSUInteger numberOfDimensions; @property (nonatomic, readonly) NSUInteger numberOfSamples; @property (nonatomic, readonly) CPTDataOrder dataOrder; @@ -28,28 +28,28 @@ /// @name Factory Methods /// @{ -+(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray)shapeArray; -+(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray)shapeArray; -+(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray)shapeArray; -+(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray)shapeArray; ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray; ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray; ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray; ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray; -+(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray)shapeArray dataOrder:(CPTDataOrder)order; -+(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray)shapeArray dataOrder:(CPTDataOrder)order; -+(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray)shapeArray dataOrder:(CPTDataOrder)order; -+(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray)shapeArray dataOrder:(CPTDataOrder)order; ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; /// @} /// @name Initialization /// @{ --(nonnull instancetype)initWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray)shapeArray; --(nonnull instancetype)initWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray)shapeArray; --(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray)shapeArray; --(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray)shapeArray; +-(nonnull instancetype)initWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray; +-(nonnull instancetype)initWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray; +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray; +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray; --(nonnull instancetype)initWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray)shapeArray dataOrder:(CPTDataOrder)order NS_DESIGNATED_INITIALIZER; --(nonnull instancetype)initWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray)shapeArray dataOrder:(CPTDataOrder)order; --(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray)shapeArray dataOrder:(CPTDataOrder)order; --(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray)shapeArray dataOrder:(CPTDataOrder)order; +-(nonnull instancetype)initWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; /// @} @@ -58,10 +58,10 @@ /// @{ -(NSUInteger)sampleIndex:(NSUInteger)idx, ...; -(nullable const void *)samplePointer:(NSUInteger)sample NS_RETURNS_INNER_POINTER; --(nullable const void *)samplePointerAtIndex:(NSUInteger)idx, ...NS_RETURNS_INNER_POINTER; +-(nullable const void *)samplePointerAtIndex:(NSUInteger)idx, ... NS_RETURNS_INNER_POINTER; -(nullable NSNumber *)sampleValue:(NSUInteger)sample; -(nullable NSNumber *)sampleValueAtIndex:(NSUInteger)idx, ...; --(nonnull CPTNumberArray)sampleArray; +-(nonnull CPTNumberArray *)sampleArray; /// @} @end diff --git a/framework/Source/CPTNumericData.m b/framework/Source/CPTNumericData.m index 97290b859..b8c5d1243 100644 --- a/framework/Source/CPTNumericData.m +++ b/framework/Source/CPTNumericData.m @@ -1,22 +1,22 @@ #import "CPTNumericData.h" +#import "complex.h" #import "CPTExceptions.h" #import "CPTMutableNumericData.h" #import "CPTNumericData+TypeConversion.h" #import "CPTUtilities.h" -#import "complex.h" /// @cond @interface CPTNumericData() @property (nonatomic, readwrite, copy, nonnull) NSData *data; @property (nonatomic, readwrite, assign) CPTNumericDataType dataType; -@property (nonatomic, readwrite, copy, nonnull) CPTNumberArray shape; +@property (nonatomic, readwrite, copy, nonnull) CPTNumberArray *shape; @property (nonatomic, readwrite, assign) CPTDataOrder dataOrder; --(void)commonInitWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray)shapeArray dataOrder:(CPTDataOrder)order; +-(void)commonInitWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; -(NSUInteger)sampleIndex:(NSUInteger)idx indexList:(va_list)indexList; --(nonnull NSData *)dataFromArray:(nonnull CPTNumberArray)newData dataType:(CPTNumericDataType)newDataType; +-(nonnull NSData *)dataFromArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType; @end @@ -81,7 +81,7 @@ @implementation CPTNumericData **/ @dynamic byteOrder; -/** @property nonnull CPTNumberArray shape +/** @property nonnull CPTNumberArray *shape * @brief The shape of the data buffer array. * * The shape describes the dimensions of the sample array stored in @@ -117,7 +117,7 @@ @implementation CPTNumericData **/ +(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray { return [[self alloc] initWithData:newData dataType:newDataType @@ -132,7 +132,7 @@ +(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData **/ +(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray { return [[self alloc] initWithData:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -149,9 +149,9 @@ +(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return A new CPTNumericData instance. **/ -+(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray { return [[self alloc] initWithArray:newData dataType:newDataType @@ -168,9 +168,9 @@ +(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return A new CPTNumericData instance. **/ -+(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray { return [[self alloc] initWithArray:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -186,7 +186,7 @@ +(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData **/ +(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order { return [[self alloc] initWithData:newData @@ -204,7 +204,7 @@ +(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData **/ +(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order { return [[self alloc] initWithData:newData @@ -224,9 +224,9 @@ +(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return A new CPTNumericData instance. **/ -+(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order { return [[self alloc] initWithArray:newData @@ -246,9 +246,9 @@ +(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return A new CPTNumericData instance. **/ -+(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order { return [[self alloc] initWithArray:newData @@ -268,7 +268,7 @@ +(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray)newData **/ -(nonnull instancetype)initWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray { return [self initWithData:newData dataType:newDataType @@ -284,7 +284,7 @@ -(nonnull instancetype)initWithData:(nonnull NSData *)newData **/ -(nonnull instancetype)initWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray { return [self initWithData:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -301,9 +301,9 @@ -(nonnull instancetype)initWithData:(nonnull NSData *)newData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return The initialized CPTNumericData instance. **/ --(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray { return [self initWithData:[self dataFromArray:newData dataType:newDataType] dataType:newDataType @@ -320,9 +320,9 @@ -(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return The initialized CPTNumericData instance. **/ --(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray { return [self initWithArray:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -338,10 +338,10 @@ -(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData **/ -(nonnull instancetype)initWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order { - if ( (self = [super init]) ) { + if ((self = [super init])) { [self commonInitWithData:newData dataType:newDataType shape:shapeArray @@ -360,7 +360,7 @@ -(nonnull instancetype)initWithData:(nonnull NSData *)newData **/ -(nonnull instancetype)initWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order { return [self initWithData:newData @@ -380,9 +380,9 @@ -(nonnull instancetype)initWithData:(nonnull NSData *)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return The initialized CPTNumericData instance. **/ --(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order { return [self initWithData:[self dataFromArray:newData dataType:newDataType] @@ -402,9 +402,9 @@ -(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return The initialized CPTNumericData instance. **/ --(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order { return [self initWithArray:newData @@ -418,22 +418,22 @@ -(nonnull instancetype)initWithArray:(nonnull CPTNumberArray)newData -(nonnull instancetype)init { return [self initWithData:[NSData data] - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) shape:nil]; } -(void)commonInitWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType - shape:(nullable CPTNumberArray)shapeArray + shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order { - NSParameterAssert( CPTDataTypeIsSupported(newDataType) ); + NSParameterAssert(CPTDataTypeIsSupported(newDataType)); self.data = newData; self.dataType = newDataType; self.dataOrder = order; - CPTNumberArray theShape = shapeArray; + CPTNumberArray *theShape = shapeArray; if ( theShape == nil ) { self.shape = @[@(self.numberOfSamples)]; @@ -511,21 +511,21 @@ -(void)setDataType:(CPTNumericDataType)newDataType { CPTNumericDataType oldDataType = dataType; - if ( CPTDataTypeEqualToDataType(oldDataType, newDataType) ) { + if ( CPTDataTypeEqualToDataType(oldDataType, newDataType)) { return; } - NSParameterAssert( CPTDataTypeIsSupported(newDataType) ); + NSParameterAssert(CPTDataTypeIsSupported(newDataType)); NSParameterAssert(newDataType.dataTypeFormat != CPTUndefinedDataType); NSParameterAssert(newDataType.byteOrder != CFByteOrderUnknown); dataType = newDataType; - if ( ( oldDataType.sampleBytes == sizeof(int8_t) ) && ( newDataType.sampleBytes == sizeof(int8_t) ) ) { + if ((oldDataType.sampleBytes == sizeof(int8_t)) && (newDataType.sampleBytes == sizeof(int8_t))) { return; } - if ( (oldDataType.dataTypeFormat != CPTUndefinedDataType) && (oldDataType.byteOrder != CFByteOrderUnknown) ) { + if ((oldDataType.dataTypeFormat != CPTUndefinedDataType) && (oldDataType.byteOrder != CFByteOrderUnknown)) { NSMutableData *myData = (NSMutableData *)self.data; CFByteOrder hostByteOrder = CFByteOrderGetCurrent(); @@ -551,7 +551,7 @@ -(void)setDataType:(CPTNumericDataType)newDataType } } --(void)setShape:(nonnull CPTNumberArray)newShape +-(void)setShape:(nonnull CPTNumberArray *)newShape { if ( newShape != shape ) { shape = [newShape copy]; @@ -582,7 +582,7 @@ -(void)setShape:(nonnull CPTNumberArray)newShape * dimension of the data buffer, this method returns @ref NSNotFound. **/ -(NSUInteger)sampleIndex:(NSUInteger)idx, ... - { +{ va_list indices; va_start(indices, idx); @@ -669,11 +669,11 @@ case sizeof(double): case CPTComplexFloatingPointDataType: switch ( self.sampleBytes ) { case sizeof(float complex): - result = @( crealf(*(const float complex *)[self samplePointer:sample]) ); + result = @(crealf(*(const float complex *)[self samplePointer:sample])); break; case sizeof(double complex): - result = @( creal(*(const double complex *)[self samplePointer:sample]) ); + result = @(creal(*(const double complex *)[self samplePointer:sample])); break; } break; @@ -703,7 +703,7 @@ case sizeof(NSDecimal): * @float or @double before being wrapped in an instance of NSNumber. **/ -(NSNumber *)sampleValueAtIndex:(NSUInteger)idx, ... - { +{ NSUInteger newIndex; if ( self.numberOfDimensions > 1 ) { @@ -728,7 +728,7 @@ -(NSNumber *)sampleValueAtIndex:(NSUInteger)idx, ... -(nullable const void *)samplePointer:(NSUInteger)sample { if ( sample < self.numberOfSamples ) { - return (const void *)( (const char *)self.bytes + sample * self.sampleBytes ); + return (const void *)((const char *)self.bytes + sample * self.sampleBytes); } else { return NULL; @@ -741,7 +741,7 @@ -(nullable const void *)samplePointer:(NSUInteger)sample * @return A pointer to the sample or @NULL if any of the sample indices are out of bounds. **/ -(nullable const void *)samplePointerAtIndex:(NSUInteger)idx, ... - { +{ NSUInteger newIndex; if ( self.numberOfDimensions > 1 ) { @@ -765,11 +765,11 @@ -(nullable const void *)samplePointerAtIndex:(NSUInteger)idx, ... * @note NSNumber does not support complex numbers. Complex number types will be cast to * @float or @double before being wrapped in an instance of NSNumber. **/ --(nonnull CPTNumberArray)sampleArray +-(nonnull CPTNumberArray *)sampleArray { NSUInteger sampleCount = self.numberOfSamples; - CPTMutableNumberArray samples = [[NSMutableArray alloc] initWithCapacity:sampleCount]; + CPTMutableNumberArray *samples = [[NSMutableArray alloc] initWithCapacity:sampleCount]; for ( NSUInteger i = 0; i < sampleCount; i++ ) { NSNumber *sampleValue = [self sampleValue:i]; @@ -778,7 +778,7 @@ -(nonnull CPTNumberArray)sampleArray } } - CPTNumberArray result = [NSArray arrayWithArray:samples]; + CPTNumberArray *result = [NSArray arrayWithArray:samples]; return result; } @@ -797,14 +797,14 @@ -(nonnull CPTNumberArray)sampleArray **/ -(NSUInteger)sampleIndex:(NSUInteger)idx indexList:(va_list)indexList { - CPTNumberArray theShape = self.shape; - NSUInteger numDims = theShape.count; - NSUInteger newIndex = 0; + CPTNumberArray *theShape = self.shape; + NSUInteger numDims = theShape.count; + NSUInteger newIndex = 0; if ( numDims > 1 ) { - NSUInteger *dims = calloc( numDims, sizeof(NSUInteger) ); - NSUInteger *dimProducts = calloc( numDims, sizeof(NSUInteger) ); - NSUInteger *indices = calloc( numDims, sizeof(NSUInteger) ); + NSUInteger *dims = calloc(numDims, sizeof(NSUInteger)); + NSUInteger *dimProducts = calloc(numDims, sizeof(NSUInteger)); + NSUInteger *indices = calloc(numDims, sizeof(NSUInteger)); NSUInteger argIndex = 0; indices[0] = idx; @@ -863,9 +863,9 @@ -(NSUInteger)sampleIndex:(NSUInteger)idx indexList:(va_list)indexList return newIndex; } --(nonnull NSData *)dataFromArray:(nonnull CPTNumberArray)newData dataType:(CPTNumericDataType)newDataType +-(nonnull NSData *)dataFromArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType { - NSParameterAssert( CPTDataTypeIsSupported(newDataType) ); + NSParameterAssert(CPTDataTypeIsSupported(newDataType)); NSParameterAssert(newDataType.dataTypeFormat != CPTUndefinedDataType); NSParameterAssert(newDataType.dataTypeFormat != CPTComplexFloatingPointDataType); @@ -1085,7 +1085,7 @@ case sizeof(NSDecimal): // End of code generated with "CPTNumericData+TypeConversions_Generation.py" // ======================================================================== - if ( ( newDataType.byteOrder != CFByteOrderGetCurrent() ) && (newDataType.byteOrder != CFByteOrderUnknown) ) { + if ((newDataType.byteOrder != CFByteOrderGetCurrent()) && (newDataType.byteOrder != CFByteOrderUnknown)) { [self swapByteOrderForData:sampleData sampleSize:newDataType.sampleBytes]; } @@ -1137,7 +1137,7 @@ -(nonnull id)mutableCopyWithZone:(nullable NSZone *)zone /// @endcond #pragma mark - -#pragma mark NSCoding Methods +#pragma mark NSCopying Methods /// @cond @@ -1152,36 +1152,21 @@ -(nonnull id)copyWithZone:(nullable NSZone *)zone /// @endcond #pragma mark - -#pragma mark NSCopying Methods +#pragma mark NSCoding Methods /// @cond -(void)encodeWithCoder:(nonnull NSCoder *)encoder { - if ( encoder.allowsKeyedCoding ) { - [encoder encodeObject:self.data forKey:@"CPTNumericData.data"]; - - CPTNumericDataType selfDataType = self.dataType; - [encoder encodeInteger:selfDataType.dataTypeFormat forKey:@"CPTNumericData.dataType.dataTypeFormat"]; - [encoder encodeInt64:(int64_t)selfDataType.sampleBytes forKey:@"CPTNumericData.dataType.sampleBytes"]; - [encoder encodeInt64:selfDataType.byteOrder forKey:@"CPTNumericData.dataType.byteOrder"]; - - [encoder encodeObject:self.shape forKey:@"CPTNumericData.shape"]; - [encoder encodeInteger:self.dataOrder forKey:@"CPTNumericData.dataOrder"]; - } - else { - [encoder encodeObject:self.data]; - - CPTNumericDataType selfDataType = self.dataType; - [encoder encodeValueOfObjCType:@encode(CPTDataTypeFormat) at:&(selfDataType.dataTypeFormat)]; - [encoder encodeValueOfObjCType:@encode(size_t) at:&(selfDataType.sampleBytes)]; - [encoder encodeValueOfObjCType:@encode(CFByteOrder) at:&(selfDataType.byteOrder)]; + [encoder encodeObject:self.data forKey:@"CPTNumericData.data"]; - [encoder encodeObject:self.shape]; + CPTNumericDataType selfDataType = self.dataType; + [encoder encodeInteger:selfDataType.dataTypeFormat forKey:@"CPTNumericData.dataType.dataTypeFormat"]; + [encoder encodeInt64:(int64_t)selfDataType.sampleBytes forKey:@"CPTNumericData.dataType.sampleBytes"]; + [encoder encodeInt64:selfDataType.byteOrder forKey:@"CPTNumericData.dataType.byteOrder"]; - CPTDataOrder order = self.dataOrder; - [encoder encodeValueOfObjCType:@encode(CPTDataOrder) at:&order]; - } + [encoder encodeObject:self.shape forKey:@"CPTNumericData.shape"]; + [encoder encodeInteger:self.dataOrder forKey:@"CPTNumericData.dataOrder"]; } /// @endcond @@ -1192,32 +1177,23 @@ -(void)encodeWithCoder:(nonnull NSCoder *)encoder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder { - if ( (self = [super init]) ) { + if ((self = [super init])) { NSData *newData; CPTNumericDataType newDataType; - CPTNumberArray shapeArray; + CPTNumberArray *shapeArray; CPTDataOrder order; - if ( decoder.allowsKeyedCoding ) { - newData = [decoder decodeObjectForKey:@"CPTNumericData.data"]; + newData = [decoder decodeObjectOfClass:[NSData class] + forKey:@"CPTNumericData.data"]; - newDataType = CPTDataType( (CPTDataTypeFormat)[decoder decodeIntegerForKey:@"CPTNumericData.dataType.dataTypeFormat"], - (size_t)[decoder decodeInt64ForKey:@"CPTNumericData.dataType.sampleBytes"], - (CFByteOrder)[decoder decodeInt64ForKey:@"CPTNumericData.dataType.byteOrder"] ); + newDataType = CPTDataType((CPTDataTypeFormat)[decoder decodeIntegerForKey:@"CPTNumericData.dataType.dataTypeFormat"], + (size_t)[decoder decodeInt64ForKey:@"CPTNumericData.dataType.sampleBytes"], + (CFByteOrder)[decoder decodeInt64ForKey:@"CPTNumericData.dataType.byteOrder"]); - shapeArray = [decoder decodeObjectForKey:@"CPTNumericData.shape"]; - order = (CPTDataOrder)[decoder decodeIntegerForKey:@"CPTNumericData.dataOrder"]; - } - else { - newData = [decoder decodeObject]; + shapeArray = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTNumericData.shape"]; - [decoder decodeValueOfObjCType:@encode(CPTDataTypeFormat) at:&(newDataType.dataTypeFormat)]; - [decoder decodeValueOfObjCType:@encode(size_t) at:&(newDataType.sampleBytes)]; - [decoder decodeValueOfObjCType:@encode(CFByteOrder) at:&(newDataType.byteOrder)]; - - shapeArray = [decoder decodeObject]; - [decoder decodeValueOfObjCType:@encode(CPTDataOrder) at:&order]; - } + order = (CPTDataOrder)[decoder decodeIntegerForKey:@"CPTNumericData.dataOrder"]; [self commonInitWithData:newData dataType:newDataType shape:shapeArray dataOrder:order]; } @@ -1225,4 +1201,16 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/CPTNumericDataTests.m b/framework/Source/CPTNumericDataTests.m index 7f0ff74bf..26e0ca4c6 100644 --- a/framework/Source/CPTNumericDataTests.m +++ b/framework/Source/CPTNumericDataTests.m @@ -27,7 +27,7 @@ -(void)testNumberOfDimensionsGivesShapeCount NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:shape]; XCTAssertEqual(nd.numberOfDimensions, nd.shape.count, @"numberOfDimensions == shape.count == 3"); @@ -46,7 +46,7 @@ -(void)testNilShapeCorrectElementCount NSUInteger prod = 1; for ( NSNumber *num in nd.shape ) { - prod *= num.unsignedIntValue; + prod *= num.unsignedIntegerValue; } XCTAssertEqual(prod, nElems, @"prod == nElems"); @@ -63,7 +63,7 @@ -(void)testIllegalShapeRaisesException NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(NSUInteger)]; XCTAssertThrowsSpecificNamed(testData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTUnsignedIntegerDataType, sizeof(NSUInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTUnsignedIntegerDataType, sizeof(NSUInteger), NSHostByteOrder()) shape:shape], NSException, CPTNumericDataException, @@ -94,7 +94,7 @@ -(void)testBytesEqualDataBytes } CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()) shape:nil]; NSData *expected = data; @@ -113,10 +113,10 @@ -(void)testArchivingRoundTrip } CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - CPTNumericData *nd2 = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:nd]]; + CPTNumericData *nd2 = [self archiveRoundTrip:nd]; XCTAssertTrue([nd.data isEqualToData:nd2.data], @"equal data"); @@ -140,10 +140,10 @@ -(void)testKeyedArchivingRoundTrip } CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - CPTNumericData *nd2 = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:nd]]; + CPTNumericData *nd2 = [self archiveRoundTrip:nd]; XCTAssertTrue([nd.data isEqualToData:nd2.data], @"equal data"); @@ -167,7 +167,7 @@ -(void)testNumberOfSamplesCorrectForDataType } CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd numberOfSamples], nElems, @"numberOfSamples == nElems"); @@ -180,7 +180,7 @@ -(void)testNumberOfSamplesCorrectForDataType } nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(char), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(char), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd numberOfSamples], nElems, @"numberOfSamples == nElems"); @@ -197,7 +197,7 @@ -(void)testDataTypeAccessorsCorrectForDataType } CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd dataTypeFormat], CPTFloatingPointDataType, @"dataTypeFormat"); @@ -216,7 +216,7 @@ -(void)testConvertTypeConvertsType } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; CPTNumericData *dd = [fd dataByConvertingToType:CPTFloatingPointDataType @@ -225,7 +225,7 @@ -(void)testConvertTypeConvertsType const double *doubleSamples = (const double *)dd.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertTrue( (double)samples[i] == doubleSamples[i], @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i] ); + XCTAssertTrue((double)samples[i] == doubleSamples[i], @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i]); } } @@ -240,12 +240,12 @@ -(void)testSamplePointerCorrect } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - XCTAssertEqual( ( (const float *)[fd.data bytes] ) + 4, (const float *)[fd samplePointer:4], @"%p,%p", samples + 4, (const float *)[fd samplePointer:4] ); - XCTAssertEqual( ( (const float *)[fd.data bytes] ), (const float *)[fd samplePointer:0], @"" ); - XCTAssertEqual( ( (const float *)[fd.data bytes] ) + nElems - 1, (const float *)[fd samplePointer:nElems - 1], @"" ); + XCTAssertEqual(((const float *)[fd.data bytes]) + 4, (const float *)[fd samplePointer:4], @"%p,%p", samples + 4, (const float *)[fd samplePointer:4]); + XCTAssertEqual(((const float *)[fd.data bytes]), (const float *)[fd samplePointer:0], @""); + XCTAssertEqual(((const float *)[fd.data bytes]) + nElems - 1, (const float *)[fd samplePointer:nElems - 1], @""); XCTAssertNil([fd samplePointer:nElems], @"too many samples"); } @@ -260,7 +260,7 @@ -(void)testSampleValueCorrect } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqualWithAccuracy([[fd sampleValue:0] doubleValue], sin(0), 0.01, @"sample value"); @@ -280,16 +280,16 @@ -(void)testSampleIndexRowsFirstOrder } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(NSUInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(NSUInteger), NSHostByteOrder()) shape:@[@(rows), @(cols)] dataOrder:CPTDataOrderRowsFirst]; - XCTAssertEqual( ([fd sampleIndex:rows, 0]), (NSUInteger)NSNotFound, @"row index out of range" ); - XCTAssertEqual( ([fd sampleIndex:0, cols]), (NSUInteger)NSNotFound, @"column index out of range" ); + XCTAssertEqual(([fd sampleIndex:rows, 0]), (NSUInteger)NSNotFound, @"row index out of range"); + XCTAssertEqual(([fd sampleIndex:0, cols]), (NSUInteger)NSNotFound, @"column index out of range"); for ( NSUInteger i = 0; i < rows; i++ ) { for ( NSUInteger j = 0; j < cols; j++ ) { - XCTAssertEqual( ([fd sampleIndex:i, j]), i * cols + j, @"(%lu, %lu)", (unsigned long)i, (unsigned long)j ); + XCTAssertEqual(([fd sampleIndex:i, j]), i * cols + j, @"(%lu, %lu)", (unsigned long)i, (unsigned long)j); } } } @@ -307,16 +307,16 @@ -(void)testSampleIndexColumnsFirstOrder } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(NSUInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(NSUInteger), NSHostByteOrder()) shape:@[@(rows), @(cols)] dataOrder:CPTDataOrderColumnsFirst]; - XCTAssertEqual( ([fd sampleIndex:rows, 0]), (NSUInteger)NSNotFound, @"row index out of range" ); - XCTAssertEqual( ([fd sampleIndex:0, cols]), (NSUInteger)NSNotFound, @"column index out of range" ); + XCTAssertEqual(([fd sampleIndex:rows, 0]), (NSUInteger)NSNotFound, @"row index out of range"); + XCTAssertEqual(([fd sampleIndex:0, cols]), (NSUInteger)NSNotFound, @"column index out of range"); for ( NSUInteger i = 0; i < rows; i++ ) { for ( NSUInteger j = 0; j < cols; j++ ) { - XCTAssertEqual( ([fd sampleIndex:i, j]), i + j * rows, @"(%lu, %lu)", (unsigned long)i, (unsigned long)j ); + XCTAssertEqual(([fd sampleIndex:i, j]), i + j * rows, @"(%lu, %lu)", (unsigned long)i, (unsigned long)j); } } } diff --git a/framework/Source/CPTNumericDataType.h b/framework/Source/CPTNumericDataType.h index 51d9017bc..0898f7b60 100644 --- a/framework/Source/CPTNumericDataType.h +++ b/framework/Source/CPTNumericDataType.h @@ -16,7 +16,7 @@ typedef NS_ENUM (NSInteger, CPTDataTypeFormat) { * @brief Enumeration of memory arrangements for multi-dimensional data arrays. * @see See Wikipedia for more information. **/ -typedef NS_ENUM (NSInteger, CPTDataOrder) { +typedef NS_CLOSED_ENUM(NSInteger, CPTDataOrder) { CPTDataOrderRowsFirst, ///< Numeric data is arranged in row-major order. CPTDataOrderColumnsFirst ///< Numeric data is arranged in column-major order. }; @@ -26,8 +26,8 @@ typedef NS_ENUM (NSInteger, CPTDataOrder) { **/ typedef struct _CPTNumericDataType { CPTDataTypeFormat dataTypeFormat; ///< Data type format - size_t sampleBytes; ///< Number of bytes in each sample - CFByteOrder byteOrder; ///< Byte order + size_t sampleBytes; ///< Number of bytes in each sample + CFByteOrder byteOrder; ///< Byte order } CPTNumericDataType; diff --git a/framework/Source/CPTNumericDataType.m b/framework/Source/CPTNumericDataType.m index 6ba0daa5a..af098066e 100644 --- a/framework/Source/CPTNumericDataType.m +++ b/framework/Source/CPTNumericDataType.m @@ -161,14 +161,14 @@ case sizeof(double): case sizeof(float complex): case sizeof(double complex): // only the native byte order is supported - valid = ( format.byteOrder == CFByteOrderGetCurrent() ); + valid = (format.byteOrder == CFByteOrderGetCurrent()); break; } break; case CPTDecimalDataType: // only the native byte order is supported - valid = ( format.sampleBytes == sizeof(NSDecimal) ) && ( format.byteOrder == CFByteOrderGetCurrent() ); + valid = (format.sampleBytes == sizeof(NSDecimal)) && (format.byteOrder == CFByteOrderGetCurrent()); break; } diff --git a/framework/Source/CPTNumericDataTypeConversionPerformanceTests.m b/framework/Source/CPTNumericDataTypeConversionPerformanceTests.m index e30e9214a..431999fcf 100644 --- a/framework/Source/CPTNumericDataTypeConversionPerformanceTests.m +++ b/framework/Source/CPTNumericDataTypeConversionPerformanceTests.m @@ -17,7 +17,7 @@ -(void)testFloatToDoubleConversion } CPTNumericData *floatNumericData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), CFByteOrderGetCurrent()) shape:nil]; __block CPTNumericData *doubleNumericData = nil; @@ -37,7 +37,7 @@ -(void)testDoubleToFloatConversion } CPTNumericData *doubleNumericData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) shape:nil]; __block CPTNumericData *floatNumericData = nil; @@ -57,7 +57,7 @@ -(void)testIntegerToDoubleConversion } CPTNumericData *integerNumericData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(NSInteger), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(NSInteger), CFByteOrderGetCurrent()) shape:nil]; __block CPTNumericData *doubleNumericData = nil; @@ -77,7 +77,7 @@ -(void)testDoubleToIntegerConversion } CPTNumericData *doubleNumericData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) shape:nil]; __block CPTNumericData *integerNumericData = nil; diff --git a/framework/Source/CPTNumericDataTypeConversionTests.m b/framework/Source/CPTNumericDataTypeConversionTests.m index ab0e882b0..8fc215339 100644 --- a/framework/Source/CPTNumericDataTypeConversionTests.m +++ b/framework/Source/CPTNumericDataTypeConversionTests.m @@ -18,7 +18,7 @@ -(void)testFloatToDoubleConversion } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; CPTNumericData *dd = [fd dataByConvertingToType:CPTFloatingPointDataType @@ -27,7 +27,7 @@ -(void)testFloatToDoubleConversion const double *doubleSamples = (const double *)dd.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (double)samples[i], doubleSamples[i], precision, @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i] ); + XCTAssertEqualWithAccuracy((double)samples[i], doubleSamples[i], precision, @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i]); } } @@ -41,7 +41,7 @@ -(void)testDoubleToFloatConversion } CPTNumericData *dd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()) shape:nil]; CPTNumericData *fd = [dd dataByConvertingToType:CPTFloatingPointDataType @@ -50,7 +50,7 @@ -(void)testDoubleToFloatConversion const float *floatSamples = (const float *)fd.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (double)floatSamples[i], samples[i], precision, @"(float)%g != (double)%g", (double)floatSamples[i], samples[i] ); + XCTAssertEqualWithAccuracy((double)floatSamples[i], samples[i], precision, @"(float)%g != (double)%g", (double)floatSamples[i], samples[i]); } } @@ -64,7 +64,7 @@ -(void)testFloatToIntegerConversion } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; CPTNumericData *intData = [fd dataByConvertingToType:CPTIntegerDataType @@ -73,7 +73,7 @@ -(void)testFloatToIntegerConversion const NSInteger *intSamples = (const NSInteger *)intData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (NSInteger)samples[i], intSamples[i], precision, @"(float)%g != (NSInteger)%ld", (double)samples[i], (long)intSamples[i] ); + XCTAssertEqualWithAccuracy((NSInteger)samples[i], intSamples[i], precision, @"(float)%g != (NSInteger)%ld", (double)samples[i], (long)intSamples[i]); } } @@ -87,7 +87,7 @@ -(void)testIntegerToFloatConversion } CPTNumericData *intData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()) shape:nil]; CPTNumericData *fd = [intData dataByConvertingToType:CPTFloatingPointDataType @@ -136,11 +136,11 @@ -(void)testDecimalToDoubleConversion NSDecimal *samples = (NSDecimal *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - samples[i] = CPTDecimalFromDouble( sin(i) ); + samples[i] = CPTDecimalFromDouble(sin(i)); } CPTNumericData *decimalData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder() ) + dataType:CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder()) shape:nil]; CPTNumericData *doubleData = [decimalData dataByConvertingToType:CPTFloatingPointDataType @@ -163,7 +163,7 @@ -(void)testDoubleToDecimalConversion } CPTNumericData *doubleData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()) shape:nil]; CPTNumericData *decimalData = [doubleData dataByConvertingToType:CPTDecimalDataType @@ -172,7 +172,7 @@ -(void)testDoubleToDecimalConversion const NSDecimal *decimalSamples = (const NSDecimal *)decimalData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertTrue(CPTDecimalEquals( decimalSamples[i], CPTDecimalFromDouble(samples[i]) ), @"(NSDecimal)%@ != (double)%g", CPTDecimalStringValue(decimalSamples[i]), samples[i]); + XCTAssertTrue(CPTDecimalEquals(decimalSamples[i], CPTDecimalFromDouble(samples[i])), @"(NSDecimal)%@ != (double)%g", CPTDecimalStringValue(decimalSamples[i]), samples[i]); } } @@ -196,7 +196,7 @@ -(void)testTypeConversionSwapsByteOrderDouble uint64_t end = *(const uint64_t *)swappedData.bytes; union swap { - double v; + double v; CFSwappedFloat64 sv; } result; @@ -220,13 +220,13 @@ -(void)testRoundTripToDoubleArray for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sin(i); } - CPTNumericDataType theDataType = CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ); + CPTNumericDataType theDataType = CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()); CPTNumericData *doubleData = [[CPTNumericData alloc] initWithData:data dataType:theDataType shape:nil]; - CPTNumberArray doubleArray = [doubleData sampleArray]; + CPTNumberArray *doubleArray = [doubleData sampleArray]; XCTAssertEqual(doubleArray.count, numberOfSamples, @"doubleArray size"); CPTNumericData *roundTripData = [[CPTNumericData alloc] initWithArray:doubleArray @@ -248,13 +248,13 @@ -(void)testRoundTripToIntegerArray for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = (NSInteger)(sin(i) * 1000.0); } - CPTNumericDataType theDataType = CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ); + CPTNumericDataType theDataType = CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()); CPTNumericData *intData = [[CPTNumericData alloc] initWithData:data dataType:theDataType shape:nil]; - CPTNumberArray integerArray = [intData sampleArray]; + CPTNumberArray *integerArray = [intData sampleArray]; XCTAssertEqual(integerArray.count, numberOfSamples, @"integerArray size"); CPTNumericData *roundTripData = [[CPTNumericData alloc] initWithArray:integerArray @@ -274,15 +274,15 @@ -(void)testRoundTripToDecimalArray NSDecimal *samples = (NSDecimal *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - samples[i] = CPTDecimalFromDouble( sin(i) ); + samples[i] = CPTDecimalFromDouble(sin(i)); } - CPTNumericDataType theDataType = CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder() ); + CPTNumericDataType theDataType = CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder()); CPTNumericData *decimalData = [[CPTNumericData alloc] initWithData:data dataType:theDataType shape:nil]; - CPTNumberArray decimalArray = [decimalData sampleArray]; + CPTNumberArray *decimalArray = [decimalData sampleArray]; XCTAssertEqual(decimalArray.count, numberOfSamples, @"doubleArray size"); CPTNumericData *roundTripData = [[CPTNumericData alloc] initWithArray:decimalArray diff --git a/framework/Source/CPTPathExtensions.m b/framework/Source/CPTPathExtensions.m index 245c942ac..fbd20d904 100644 --- a/framework/Source/CPTPathExtensions.m +++ b/framework/Source/CPTPathExtensions.m @@ -10,10 +10,10 @@ **/ __nonnull CGPathRef CPTCreateRoundedRectPath(CGRect rect, CGFloat cornerRadius) { - if ( cornerRadius > CPTFloat(0.0) ) { - cornerRadius = MIN( MIN( cornerRadius, rect.size.width * CPTFloat(0.5) ), rect.size.height * CPTFloat(0.5) ); + if ( cornerRadius > CPTFloat(0.0)) { + cornerRadius = MIN(MIN(cornerRadius, rect.size.width * CPTFloat(0.5)), rect.size.height * CPTFloat(0.5)); - // CGPathCreateWithRoundedRect() is available in Mac OS X 10.9 and iOS 7 but not marked in the header file + // CGPathCreateWithRoundedRect() is available in macOS 10.9 and iOS 7 but not marked in the header file #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunreachable-code" #pragma clang diagnostic ignored "-Wpointer-bool-conversion" diff --git a/framework/Source/CPTPieChart.h b/framework/Source/CPTPieChart.h index 427f76386..3d568bb59 100644 --- a/framework/Source/CPTPieChart.h +++ b/framework/Source/CPTPieChart.h @@ -9,11 +9,16 @@ @class CPTTextLayer; @class CPTLineStyle; +/** + * @brief Pie chart bindings. + **/ +typedef NSString *CPTPieChartBinding cpt_swift_struct; + /// @ingroup plotBindingsPieChart /// @{ -extern NSString *__nonnull const CPTPieChartBindingPieSliceWidthValues; -extern NSString *__nonnull const CPTPieChartBindingPieSliceFills; -extern NSString *__nonnull const CPTPieChartBindingPieSliceRadialOffsets; +extern CPTPieChartBinding __nonnull const CPTPieChartBindingPieSliceWidthValues; +extern CPTPieChartBinding __nonnull const CPTPieChartBindingPieSliceFills; +extern CPTPieChartBinding __nonnull const CPTPieChartBindingPieSliceRadialOffsets; /// @} /** @@ -28,7 +33,7 @@ typedef NS_ENUM (NSInteger, CPTPieChartField) { /** * @brief Enumeration of pie slice drawing directions. **/ -typedef NS_ENUM (NSInteger, CPTPieDirection) { +typedef NS_CLOSED_ENUM(NSInteger, CPTPieDirection) { CPTPieDirectionClockwise, ///< Pie slices are drawn in a clockwise direction. CPTPieDirectionCounterClockwise ///< Pie slices are drawn in a counter-clockwise direction. }; @@ -49,7 +54,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @param indexRange The range of the data indexes of interest. * @return An array of pie slice fills. **/ --(nullable CPTFillArray)sliceFillsForPieChart:(nonnull CPTPieChart *)pieChart recordIndexRange:(NSRange)indexRange; +-(nullable CPTFillArray *)sliceFillsForPieChart:(nonnull CPTPieChart *)pieChart recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a fill for the given pie chart slice. * This method will not be called if @@ -72,7 +77,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @param indexRange The range of the data indexes of interest. * @return An array of radial offsets. **/ --(nullable CPTNumberArray)radialOffsetsForPieChart:(nonnull CPTPieChart *)pieChart recordIndexRange:(NSRange)indexRange; +-(nullable CPTNumberArray *)radialOffsetsForPieChart:(nonnull CPTPieChart *)pieChart recordIndexRange:(NSRange)indexRange; /** @brief @optional Offsets the slice radially from the center point. Can be used to @quote{explode} the chart. * This method will not be called if diff --git a/framework/Source/CPTPieChart.m b/framework/Source/CPTPieChart.m index 2c8cfd4c9..83bbda7c8 100644 --- a/framework/Source/CPTPieChart.m +++ b/framework/Source/CPTPieChart.m @@ -25,16 +25,16 @@ * @endif **/ -NSString *const CPTPieChartBindingPieSliceWidthValues = @"sliceWidths"; ///< Pie slice widths. -NSString *const CPTPieChartBindingPieSliceFills = @"sliceFills"; ///< Pie slice interior fills. -NSString *const CPTPieChartBindingPieSliceRadialOffsets = @"sliceRadialOffsets"; ///< Pie slice radial offsets. +CPTPieChartBinding const CPTPieChartBindingPieSliceWidthValues = @"sliceWidths"; ///< Pie slice widths. +CPTPieChartBinding const CPTPieChartBindingPieSliceFills = @"sliceFills"; ///< Pie slice interior fills. +CPTPieChartBinding const CPTPieChartBindingPieSliceRadialOffsets = @"sliceRadialOffsets"; ///< Pie slice radial offsets. /// @cond @interface CPTPieChart() -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray sliceWidths; -@property (nonatomic, readwrite, copy, nullable) CPTFillArray sliceFills; -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray sliceRadialOffsets; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *sliceWidths; +@property (nonatomic, readwrite, copy, nullable) CPTFillArray *sliceFills; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *sliceRadialOffsets; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownIndex; -(void)updateNormalizedData; @@ -42,7 +42,7 @@ -(CGFloat)radiansForPieSliceValue:(CGFloat)pieSliceValue; -(CGFloat)normalizedPosition:(CGFloat)rawPosition; -(BOOL)angle:(CGFloat)touchedAngle betweenStartAngle:(CGFloat)startingAngle endAngle:(CGFloat)endingAngle; --(void)addSliceToPath:(nonnull CGMutablePathRef)slicePath centerPoint:(CGPoint)center startingAngle:(CGFloat)startingAngle finishingAngle:(CGFloat)finishingAngle; +-(void)addSliceToPath:(nonnull CGMutablePathRef)slicePath centerPoint:(CGPoint)center startingAngle:(CGFloat)startingAngle finishingAngle:(CGFloat)finishingAngle width:(CGFloat)currentWidth; -(nullable CPTFill *)sliceFillForIndex:(NSUInteger)idx; @end @@ -160,9 +160,9 @@ @implementation CPTPieChart +(nonnull CPTColor *)defaultPieSliceColorForIndex:(NSUInteger)pieSliceIndex { - return [CPTColor colorWithComponentRed:( colorLookupTable[pieSliceIndex % 10][0] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1) ) - green:( colorLookupTable[pieSliceIndex % 10][1] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1) ) - blue:( colorLookupTable[pieSliceIndex % 10][2] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1) ) + return [CPTColor colorWithComponentRed:(colorLookupTable[pieSliceIndex % 10][0] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1)) + green:(colorLookupTable[pieSliceIndex % 10][1] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1)) + blue:(colorLookupTable[pieSliceIndex % 10][2] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1)) alpha:CPTFloat(1.0)]; } @@ -171,7 +171,7 @@ +(nonnull CPTColor *)defaultPieSliceColorForIndex:(NSUInteger)pieSliceIndex /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -181,6 +181,7 @@ +(void)initialize [self exposeBinding:CPTPieChartBindingPieSliceRadialOffsets]; } } + #endif /// @endcond @@ -208,8 +209,8 @@ +(void)initialize **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { - pieRadius = CPTFloat(0.8) * ( MIN(newFrame.size.width, newFrame.size.height) / CPTFloat(2.0) ); + if ((self = [super initWithFrame:newFrame])) { + pieRadius = CPTFloat(0.8) * (MIN(newFrame.size.width, newFrame.size.height) / CPTFloat(2.0)); pieInnerRadius = CPTFloat(0.0); startAngle = CPTFloat(M_PI_2); // pi/2 endAngle = CPTNAN; @@ -232,7 +233,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTPieChart *theLayer = (CPTPieChart *)layer; pieRadius = theLayer->pieRadius; @@ -276,15 +277,17 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - pieRadius = [coder decodeCGFloatForKey:@"CPTPieChart.pieRadius"]; - pieInnerRadius = [coder decodeCGFloatForKey:@"CPTPieChart.pieInnerRadius"]; - startAngle = [coder decodeCGFloatForKey:@"CPTPieChart.startAngle"]; - endAngle = [coder decodeCGFloatForKey:@"CPTPieChart.endAngle"]; - sliceDirection = (CPTPieDirection)[coder decodeIntegerForKey:@"CPTPieChart.sliceDirection"]; - centerAnchor = [coder decodeCPTPointForKey:@"CPTPieChart.centerAnchor"]; - borderLineStyle = [[coder decodeObjectForKey:@"CPTPieChart.borderLineStyle"] copy]; - overlayFill = [[coder decodeObjectForKey:@"CPTPieChart.overlayFill"] copy]; + if ((self = [super initWithCoder:coder])) { + pieRadius = [coder decodeCGFloatForKey:@"CPTPieChart.pieRadius"]; + pieInnerRadius = [coder decodeCGFloatForKey:@"CPTPieChart.pieInnerRadius"]; + startAngle = [coder decodeCGFloatForKey:@"CPTPieChart.startAngle"]; + endAngle = [coder decodeCGFloatForKey:@"CPTPieChart.endAngle"]; + sliceDirection = (CPTPieDirection)[coder decodeIntegerForKey:@"CPTPieChart.sliceDirection"]; + centerAnchor = [coder decodeCPTPointForKey:@"CPTPieChart.centerAnchor"]; + borderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTPieChart.borderLineStyle"] copy]; + overlayFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTPieChart.overlayFill"] copy]; labelRotationRelativeToRadius = [coder decodeBoolForKey:@"CPTPieChart.labelRotationRelativeToRadius"]; pointingDeviceDownIndex = NSNotFound; } @@ -293,6 +296,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Data Loading @@ -370,12 +385,12 @@ -(void)updateNormalizedData const double *dataEnd = dataBytes + sampleCount; while ( dataBytes < dataEnd ) { double currentWidth = *dataBytes++; - if ( !isnan(currentWidth) ) { + if ( !isnan(currentWidth)) { valueSum += currentWidth; } } - CPTNumericDataType dataType = CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ); + CPTNumericDataType dataType = CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()); CPTMutableNumericData *normalizedSliceValues = [[CPTMutableNumericData alloc] initWithData:[NSData data] dataType:dataType shape:nil]; normalizedSliceValues.shape = @[@(sampleCount)]; @@ -389,7 +404,7 @@ -(void)updateNormalizedData double *cumulativeBytes = cumulativeSliceValues.mutableBytes; while ( dataBytes < dataEnd ) { double currentWidth = *dataBytes++; - if ( isnan(currentWidth) ) { + if ( isnan(currentWidth)) { *normalizedBytes++ = (double)NAN; } else { @@ -407,12 +422,12 @@ -(void)updateNormalizedData const NSDecimal *dataEnd = dataBytes + sampleCount; while ( dataBytes < dataEnd ) { NSDecimal currentWidth = *dataBytes++; - if ( !NSDecimalIsNotANumber(¤tWidth) ) { + if ( !NSDecimalIsNotANumber(¤tWidth)) { valueSum = CPTDecimalAdd(valueSum, currentWidth); } } - CPTNumericDataType dataType = CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent() ); + CPTNumericDataType dataType = CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent()); CPTMutableNumericData *normalizedSliceValues = [[CPTMutableNumericData alloc] initWithData:[NSData data] dataType:dataType shape:nil]; normalizedSliceValues.shape = @[@(sampleCount)]; @@ -427,7 +442,7 @@ -(void)updateNormalizedData NSDecimal *cumulativeBytes = cumulativeSliceValues.mutableBytes; while ( dataBytes < dataEnd ) { NSDecimal currentWidth = *dataBytes++; - if ( NSDecimalIsNotANumber(¤tWidth) ) { + if ( NSDecimalIsNotANumber(¤tWidth)) { *normalizedBytes++ = decimalNAN; } else { @@ -479,9 +494,9 @@ -(void)reloadSliceFillsInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(sliceFillForPieChart:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - CPTMutableFillArray array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableFillArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTFill *dataSourceFill = [theDataSource sliceFillForPieChart:self recordIndex:idx]; @@ -525,8 +540,8 @@ -(void)reloadRadialOffsetsInIndexRange:(NSRange)indexRange atRecordIndex:indexRange.location]; } else if ( [theDataSource respondsToSelector:@selector(radialOffsetForPieChart:recordIndex:)] ) { - CPTMutableNumberArray array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + CPTMutableNumberArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CGFloat offset = [theDataSource radialOffsetForPieChart:self recordIndex:idx]; @@ -579,10 +594,10 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CPTLineStyle *borderStyle = self.borderLineStyle; CPTFill *overlay = self.overlayFill; - BOOL hasNonZeroOffsets = NO; - CPTNumberArray offsetArray = [self cachedArrayForKey:CPTPieChartBindingPieSliceRadialOffsets]; + BOOL hasNonZeroOffsets = NO; + CPTNumberArray *offsetArray = [self cachedArrayForKey:CPTPieChartBindingPieSliceRadialOffsets]; for ( NSNumber *offset in offsetArray ) { - if ( [offset cgFloatValue] != CPTFloat(0.0) ) { + if ( [offset cgFloatValue] != CPTFloat(0.0)) { hasNonZeroOffsets = YES; break; } @@ -592,7 +607,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context if ( overlay && hasNonZeroOffsets ) { CGFloat radius = self.pieRadius + borderStyle.lineWidth * CPTFloat(0.5); - bounds = CPTRectMake( centerPoint.x - radius, centerPoint.y - radius, radius * CPTFloat(2.0), radius * CPTFloat(2.0) ); + bounds = CPTRectMake(centerPoint.x - radius, centerPoint.y - radius, radius * CPTFloat(2.0), radius * CPTFloat(2.0)); } else { bounds = CGRectZero; @@ -604,7 +619,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context while ( currentIndex < sampleCount ) { CGFloat currentWidth = (CGFloat)[self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:currentIndex]; - if ( !isnan(currentWidth) ) { + if ( !isnan(currentWidth)) { CGFloat radialOffset = [(NSNumber *) offsetArray[currentIndex] cgFloatValue]; // draw slice @@ -616,7 +631,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CGFloat xOffset = CPTFloat(0.0); CGFloat yOffset = CPTFloat(0.0); CGPoint center = centerPoint; - if ( radialOffset != CPTFloat(0.0) ) { + if ( radialOffset != CPTFloat(0.0)) { CGFloat medianAngle = CPTFloat(0.5) * (startingAngle + finishingAngle); xOffset = cos(medianAngle) * radialOffset; yOffset = sin(medianAngle) * radialOffset; @@ -629,8 +644,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context } CGMutablePathRef slicePath = CGPathCreateMutable(); - [self addSliceToPath:slicePath centerPoint:center startingAngle:startingAngle finishingAngle:finishingAngle]; - CGPathCloseSubpath(slicePath); + [self addSliceToPath:slicePath centerPoint:center startingAngle:startingAngle finishingAngle:finishingAngle width:currentWidth]; CPTFill *currentFill = [self sliceFillForIndex:currentIndex]; if ( [currentFill isKindOfClass:fillClass] ) { @@ -675,7 +689,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CGMutablePathRef fillPath = CGPathCreateMutable(); CGFloat innerRadius = self.pieInnerRadius; - if ( innerRadius > CPTFloat(0.0) ) { + if ( innerRadius > CPTFloat(0.0)) { CGPathAddArc(fillPath, NULL, centerPoint.x, centerPoint.y, self.pieRadius, CPTFloat(0.0), CPTFloat(2.0 * M_PI), false); CGPathAddArc(fillPath, NULL, centerPoint.x, centerPoint.y, innerRadius, CPTFloat(2.0 * M_PI), CPTFloat(0.0), true); } @@ -710,29 +724,42 @@ -(CGFloat)radiansForPieSliceValue:(CGFloat)pieSliceValue angle += pieSliceValue * pieRange; break; } - return angle; + return isnan(endingAngle) ? angle : fmod(angle, CPTFloat(2.0 * M_PI)); } --(void)addSliceToPath:(nonnull CGMutablePathRef)slicePath centerPoint:(CGPoint)center startingAngle:(CGFloat)startingAngle finishingAngle:(CGFloat)finishingAngle +-(void)addSliceToPath:(nonnull CGMutablePathRef)slicePath centerPoint:(CGPoint)center startingAngle:(CGFloat)startingAngle finishingAngle:(CGFloat)finishingAngle width:(CGFloat)currentWidth { bool direction = (self.sliceDirection == CPTPieDirectionClockwise) ? true : false; + CGFloat outerRadius = self.pieRadius; CGFloat innerRadius = self.pieInnerRadius; - if ( innerRadius > CPTFloat(0.0) ) { - CGPathAddArc(slicePath, NULL, center.x, center.y, self.pieRadius, startingAngle, finishingAngle, direction); - CGPathAddArc(slicePath, NULL, center.x, center.y, innerRadius, finishingAngle, startingAngle, !direction); + if ( innerRadius > CPTFloat(0.0)) { + if ( currentWidth >= CPTFloat(1.0)) { + CGPathAddArc(slicePath, NULL, center.x, center.y, outerRadius, startingAngle, startingAngle + CPTFloat(2.0 * M_PI), direction); + CGPathAddArc(slicePath, NULL, center.x, center.y, innerRadius, startingAngle + CPTFloat(2.0 * M_PI), startingAngle, !direction); + } + else { + CGPathAddArc(slicePath, NULL, center.x, center.y, outerRadius, startingAngle, finishingAngle, direction); + CGPathAddArc(slicePath, NULL, center.x, center.y, innerRadius, finishingAngle, startingAngle, !direction); + } } else { - CGPathMoveToPoint(slicePath, NULL, center.x, center.y); - CGPathAddArc(slicePath, NULL, center.x, center.y, self.pieRadius, startingAngle, finishingAngle, direction); + if ( currentWidth >= CPTFloat(1.0)) { + CGPathAddEllipseInRect(slicePath, NULL, CGRectMake(center.x - outerRadius, center.y - outerRadius, outerRadius * CPTFloat(2.0), outerRadius * CPTFloat(2.0))); + } + else { + CGPathMoveToPoint(slicePath, NULL, center.x, center.y); + CGPathAddArc(slicePath, NULL, center.x, center.y, outerRadius, startingAngle, finishingAngle, direction); + } } + CGPathCloseSubpath(slicePath); } -(nullable CPTFill *)sliceFillForIndex:(NSUInteger)idx { CPTFill *currentFill = [self cachedValueForKey:CPTPieChartBindingPieSliceFills recordIndex:idx]; - if ( (currentFill == nil) || (currentFill == [CPTPlot nilData]) ) { + if ((currentFill == nil) || (currentFill == [CPTPlot nilData])) { currentFill = [CPTFill fillWithColor:[CPTPieChart defaultPieSliceColorForIndex:idx]]; } @@ -786,7 +813,7 @@ -(NSUInteger)pieSliceIndexAtAngle:(CGFloat)angle // of that pie slice. for ( NSUInteger currentIndex = 0; currentIndex < self.cachedDataCount; currentIndex++ ) { CGFloat width = CPTFloat([self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:currentIndex]); - if ( isnan(width) ) { + if ( isnan(width)) { continue; } CGFloat endingAngle = startingAngle; @@ -831,7 +858,7 @@ -(CGFloat)medianAngleForPieSliceIndex:(NSUInteger)idx CGFloat currentWidth = CPTFloat([self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:currentIndex]); // If the slice index is a match... - if ( !isnan(currentWidth) && (idx == currentIndex) ) { + if ( !isnan(currentWidth) && (idx == currentIndex)) { // Compute and return the angle that is halfway between the slice's starting and ending angles CGFloat startingAngle = [self radiansForPieSliceValue:startingWidth]; CGFloat finishingAngle = [self radiansForPieSliceValue:startingWidth + currentWidth]; @@ -883,7 +910,7 @@ -(NSUInteger)numberOfFields return 1; } --(nonnull CPTNumberArray)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[@(CPTPieChartFieldSliceWidth)]; } @@ -913,7 +940,7 @@ -(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex: label.anchorPlotPoint = @[xValue, yValue]; CGFloat currentWidth = (CGFloat)[self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:idx]; - if ( self.hidden || isnan(currentWidth) ) { + if ( self.hidden || isnan(currentWidth)) { contentLayer.hidden = YES; } else { @@ -926,11 +953,11 @@ -(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex: } CGFloat labelAngle = [self radiansForPieSliceValue:startingWidth + currentWidth / CPTFloat(2.0)]; - label.displacement = CPTPointMake( labelRadius * cos(labelAngle), labelRadius * sin(labelAngle) ); + label.displacement = CPTPointMake(labelRadius * cos(labelAngle), labelRadius * sin(labelAngle)); if ( self.labelRotationRelativeToRadius ) { CGFloat rotation = [self normalizedPosition:self.labelRotation + labelAngle]; - if ( ( rotation > CPTFloat(0.25) ) && ( rotation < CPTFloat(0.75) ) ) { + if ((rotation > CPTFloat(0.25)) && (rotation < CPTFloat(0.75))) { rotation -= CPTFloat(0.5); } @@ -1017,8 +1044,8 @@ -(CGFloat)normalizedPosition:(CGFloat)rawPosition CGFloat result = rawPosition; result /= (CGFloat)(2.0 * M_PI); - result = fmod( result, CPTFloat(1.0) ); - if ( result < CPTFloat(0.0) ) { + result = fmod(result, CPTFloat(1.0)); + if ( result < CPTFloat(0.0)) { result += CPTFloat(1.0); } @@ -1029,19 +1056,19 @@ -(BOOL)angle:(CGFloat)touchedAngle betweenStartAngle:(CGFloat)startingAngle endA { switch ( self.sliceDirection ) { case CPTPieDirectionClockwise: - if ( (touchedAngle <= startingAngle) && (touchedAngle >= endingAngle) ) { + if ((touchedAngle <= startingAngle) && (touchedAngle >= endingAngle)) { return YES; } - else if ( ( endingAngle < CPTFloat(0.0) ) && (touchedAngle - CPTFloat(1.0) >= endingAngle) ) { + else if ((endingAngle < CPTFloat(0.0)) && (touchedAngle - CPTFloat(1.0) >= endingAngle)) { return YES; } break; case CPTPieDirectionCounterClockwise: - if ( (touchedAngle >= startingAngle) && (touchedAngle <= endingAngle) ) { + if ((touchedAngle >= startingAngle) && (touchedAngle <= endingAngle)) { return YES; } - else if ( ( endingAngle > CPTFloat(1.0) ) && (touchedAngle + CPTFloat(1.0) <= endingAngle) ) { + else if ((endingAngle > CPTFloat(1.0)) && (touchedAngle + CPTFloat(1.0) <= endingAngle)) { return YES; } break; @@ -1081,7 +1108,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(pieChart:sliceTouchDownAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(pieChart:sliceTouchDownAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(pieChart:sliceWasSelectedAtRecordIndex:)] || @@ -1150,7 +1177,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(pieChart:sliceTouchUpAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(pieChart:sliceTouchUpAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(pieChart:sliceWasSelectedAtRecordIndex:)] || @@ -1233,17 +1260,17 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point switch ( self.sliceDirection ) { case CPTPieDirectionClockwise: - if ( isnan(theEndAngle) || ( CPTFloat(2.0 * M_PI) == ABS(theEndAngle - theStartAngle) ) ) { + if ( isnan(theEndAngle) || (CPTFloat(2.0 * M_PI) == ABS(theEndAngle - theStartAngle))) { widthFactor = CPTFloat(1.0); } else { - widthFactor = CPTFloat(2.0 * M_PI) / ( CPTFloat(2.0 * M_PI) - ABS(theEndAngle - theStartAngle) ); + widthFactor = CPTFloat(2.0 * M_PI) / (CPTFloat(2.0 * M_PI) - ABS(theEndAngle - theStartAngle)); } for ( NSUInteger currentIndex = 0; currentIndex < sampleCount; currentIndex++ ) { // calculate angles for this slice CGFloat width = (CGFloat)[self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:currentIndex]; - if ( isnan(width) ) { + if ( isnan(width)) { continue; } @@ -1255,7 +1282,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point CGFloat offsetTouchedAngle = touchedAngle; CGFloat offsetDistanceSquared = distanceSquared; CGFloat radialOffset = [(NSNumber *)[self cachedValueForKey:CPTPieChartBindingPieSliceRadialOffsets recordIndex:currentIndex] cgFloatValue]; - if ( radialOffset != CPTFloat(0.0) ) { + if ( radialOffset != CPTFloat(0.0)) { CGPoint offsetCenter; CGFloat medianAngle = CPTFloat(M_PI) * (startingAngle + endingAngle); offsetCenter = CPTPointMake(centerPoint.x + cos(medianAngle) * radialOffset, @@ -1280,7 +1307,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point } // check distance - if ( angleInSlice && (offsetDistanceSquared >= chartInnerRadiusSquared) && (offsetDistanceSquared <= chartRadiusSquared) ) { + if ( angleInSlice && (offsetDistanceSquared >= chartInnerRadiusSquared) && (offsetDistanceSquared <= chartRadiusSquared)) { return currentIndex; } @@ -1290,7 +1317,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point break; case CPTPieDirectionCounterClockwise: - if ( isnan(theEndAngle) || (theStartAngle == theEndAngle) ) { + if ( isnan(theEndAngle) || (theStartAngle == theEndAngle)) { widthFactor = CPTFloat(1.0); } else { @@ -1300,7 +1327,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point for ( NSUInteger currentIndex = 0; currentIndex < sampleCount; currentIndex++ ) { // calculate angles for this slice CGFloat width = (CGFloat)[self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:currentIndex]; - if ( isnan(width) ) { + if ( isnan(width)) { continue; } width /= widthFactor; @@ -1311,7 +1338,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point CGFloat offsetTouchedAngle = touchedAngle; CGFloat offsetDistanceSquared = distanceSquared; CGFloat radialOffset = [(NSNumber *)[self cachedValueForKey:CPTPieChartBindingPieSliceRadialOffsets recordIndex:currentIndex] cgFloatValue]; - if ( radialOffset != CPTFloat(0.0) ) { + if ( radialOffset != CPTFloat(0.0)) { CGPoint offsetCenter; CGFloat medianAngle = CPTFloat(M_PI) * (startingAngle + endingAngle); offsetCenter = CPTPointMake(centerPoint.x + cos(medianAngle) * radialOffset, @@ -1336,7 +1363,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point } // check distance - if ( angleInSlice && (offsetDistanceSquared >= chartInnerRadiusSquared) && (offsetDistanceSquared <= chartRadiusSquared) ) { + if ( angleInSlice && (offsetDistanceSquared >= chartInnerRadiusSquared) && (offsetDistanceSquared <= chartRadiusSquared)) { return currentIndex; } @@ -1356,34 +1383,34 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point /// @cond --(nullable CPTNumberArray)sliceWidths +-(nullable CPTNumberArray *)sliceWidths { return [[self cachedNumbersForField:CPTPieChartFieldSliceWidth] sampleArray]; } --(void)setSliceWidths:(nullable CPTNumberArray)newSliceWidths +-(void)setSliceWidths:(nullable CPTNumberArray *)newSliceWidths { [self cacheNumbers:newSliceWidths forField:CPTPieChartFieldSliceWidth]; [self updateNormalizedData]; } --(nullable CPTFillArray)sliceFills +-(nullable CPTFillArray *)sliceFills { return [self cachedArrayForKey:CPTPieChartBindingPieSliceFills]; } --(void)setSliceFills:(nullable CPTFillArray)newSliceFills +-(void)setSliceFills:(nullable CPTFillArray *)newSliceFills { [self cacheArray:newSliceFills forKey:CPTPieChartBindingPieSliceFills]; [self setNeedsDisplay]; } --(nullable CPTNumberArray)sliceRadialOffsets +-(nullable CPTNumberArray *)sliceRadialOffsets { return [self cachedArrayForKey:CPTPieChartBindingPieSliceRadialOffsets]; } --(void)setSliceRadialOffsets:(nullable CPTNumberArray)newSliceRadialOffsets +-(void)setSliceRadialOffsets:(nullable CPTNumberArray *)newSliceRadialOffsets { [self cacheArray:newSliceRadialOffsets forKey:CPTPieChartBindingPieSliceRadialOffsets]; [self setNeedsDisplay]; @@ -1445,7 +1472,7 @@ -(void)setBorderLineStyle:(nullable CPTLineStyle *)newStyle -(void)setCenterAnchor:(CGPoint)newCenterAnchor { - if ( !CGPointEqualToPoint(centerAnchor, newCenterAnchor) ) { + if ( !CGPointEqualToPoint(centerAnchor, newCenterAnchor)) { centerAnchor = newCenterAnchor; [self setNeedsDisplay]; [self repositionAllLabelAnnotations]; diff --git a/framework/Source/CPTPlot.h b/framework/Source/CPTPlot.h index 066e07885..d9dd3d976 100644 --- a/framework/Source/CPTPlot.h +++ b/framework/Source/CPTPlot.h @@ -14,9 +14,14 @@ @class CPTPlotRange; @class CPTTextStyle; +/** + * @brief Plot bindings. + **/ +typedef NSString *CPTPlotBinding cpt_swift_struct; + /// @ingroup plotBindingsAllPlots /// @{ -extern NSString *__nonnull const CPTPlotBindingDataLabels; +extern CPTPlotBinding __nonnull const CPTPlotBindingDataLabels; /// @} /** @@ -31,12 +36,12 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { /** * @brief An array of plots. **/ -typedef NSArray<__kindof CPTPlot *> *CPTPlotArray; +typedef NSArray<__kindof CPTPlot *> CPTPlotArray; /** * @brief A mutable array of plots. **/ -typedef NSMutableArray<__kindof CPTPlot *> *CPTMutablePlotArray; +typedef NSMutableArray<__kindof CPTPlot *> CPTMutablePlotArray; #pragma mark - @@ -139,7 +144,7 @@ typedef NSMutableArray<__kindof CPTPlot *> *CPTMutablePlotArray; * @param indexRange The range of the data indexes of interest. * @return An array of data labels. **/ --(nullable NSArray *)dataLabelsForPlot:(nonnull CPTPlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLayerArray *)dataLabelsForPlot:(nonnull CPTPlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a data label for the given plot. * This method will not be called if @@ -162,7 +167,7 @@ typedef NSMutableArray<__kindof CPTPlot *> *CPTMutablePlotArray; /** * @brief Plot delegate. **/ -@protocol CPTPlotDelegate +@protocol CPTPlotDelegate @optional @@ -253,7 +258,7 @@ typedef NSMutableArray<__kindof CPTPlot *> *CPTMutablePlotArray; /// @name Data Source /// @{ -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak id dataSource; +@property (nonatomic, readwrite, cpt_weak_property, nullable) id dataSource; /// @} /// @name Identification @@ -327,8 +332,10 @@ typedef NSMutableArray<__kindof CPTPlot *> *CPTMutablePlotArray; -(void)reloadDataInIndexRange:(NSRange)indexRange; -(void)insertDataAtIndex:(NSUInteger)idx numberOfRecords:(NSUInteger)numberOfRecords; -(void)deleteDataInIndexRange:(NSRange)indexRange; --(void)reloadPlotData; --(void)reloadPlotDataInIndexRange:(NSRange)indexRange; +-(void) reloadPlotData NS_SWIFT_NAME(CPTPlot.reloadPlotData()); + +-(void)reloadPlotDataInIndexRange:(NSRange) indexRange NS_SWIFT_NAME(CPTPlot.reloadPlotData(inIndexRange:)); + /// @} /// @name Plot Data @@ -357,6 +364,8 @@ typedef NSMutableArray<__kindof CPTPlot *> *CPTMutablePlotArray; /// @{ -(nullable CPTPlotRange *)plotRangeForField:(NSUInteger)fieldEnum; -(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord; +-(nullable CPTPlotRange *)plotRangeEnclosingField:(NSUInteger)fieldEnum; +-(nullable CPTPlotRange *)plotRangeEnclosingCoordinate:(CPTCoordinate)coord; /// @} /// @name Legends @@ -379,8 +388,8 @@ typedef NSMutableArray<__kindof CPTPlot *> *CPTMutablePlotArray; /// @name Fields /// @{ -(NSUInteger)numberOfFields; --(nonnull CPTNumberArray)fieldIdentifiers; --(nonnull CPTNumberArray)fieldIdentifiersForCoordinate:(CPTCoordinate)coord; +-(nonnull CPTNumberArray *)fieldIdentifiers; +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord; -(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger)field; /// @} diff --git a/framework/Source/CPTPlot.m b/framework/Source/CPTPlot.m index 66c7fc5ca..5cd2637a0 100644 --- a/framework/Source/CPTPlot.m +++ b/framework/Source/CPTPlot.m @@ -16,13 +16,12 @@ #import "CPTTextLayer.h" #import "CPTUtilities.h" #import "NSCoderExtensions.h" -#import #import /** @defgroup plotAnimation Plots * @brief Plot properties that can be animated using Core Animation. * @if MacOnly - * @since Custom layer property animation is supported on MacOS 10.6 and later. + * @since Custom layer property animation is supported on macOS 10.6 and later. * @endif * @ingroup animation **/ @@ -45,7 +44,7 @@ * @endif **/ -NSString *const CPTPlotBindingDataLabels = @"dataLabels"; ///< Plot data labels. +CPTPlotBinding const CPTPlotBindingDataLabels = @"dataLabels"; ///< Plot data labels. /// @cond @interface CPTPlot() @@ -55,8 +54,8 @@ @interface CPTPlot() @property (nonatomic, readwrite, assign) BOOL needsRelabel; @property (nonatomic, readwrite, assign) NSRange labelIndexRange; -@property (nonatomic, readwrite, strong, nullable) CPTMutableAnnotationArray labelAnnotations; -@property (nonatomic, readwrite, copy, nullable) NSArray *dataLabels; +@property (nonatomic, readwrite, strong, nullable) CPTMutableAnnotationArray *labelAnnotations; +@property (nonatomic, readwrite, copy, nullable) CPTLayerArray *dataLabels; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownLabelIndex; @property (nonatomic, readwrite, assign) NSUInteger cachedDataCount; @@ -79,7 +78,7 @@ -(void)updateContentAnchorForLabel:(nonnull CPTPlotSpaceAnnotation *)label; * Each data series on the graph is represented by a plot. Data is provided by * a datasource that conforms to the CPTPlotDataSource protocol. * @if MacOnly - * Plots also support data binding on MacOS. + * Plots also support data binding on macOS. * @endif * * A Core Plot plot will request its data from the datasource when it is first displayed. @@ -104,7 +103,7 @@ @implementation CPTPlot @dynamic dataLabels; -/** @property nullable cpt_weak id dataSource +/** @property nullable id dataSource * @brief The data source for the plot. **/ @synthesize dataSource; @@ -248,7 +247,7 @@ @implementation CPTPlot /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -256,6 +255,7 @@ +(void)initialize [self exposeBinding:CPTPlotBindingDataLabels]; } } + #endif /// @endcond @@ -292,7 +292,7 @@ +(void)initialize **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { cachedData = [[NSMutableDictionary alloc] initWithCapacity:5]; cachedDataCount = 0; cachePrecision = CPTPlotCachePrecisionAuto; @@ -330,7 +330,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTPlot *theLayer = (CPTPlot *)layer; cachedData = theLayer->cachedData; @@ -404,30 +404,40 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - dataSource = [coder decodeObjectForKey:@"CPTPlot.dataSource"]; - title = [[coder decodeObjectForKey:@"CPTPlot.title"] copy]; - attributedTitle = [[coder decodeObjectForKey:@"CPTPlot.attributedTitle"] copy]; - plotSpace = [coder decodeObjectForKey:@"CPTPlot.plotSpace"]; - cachePrecision = (CPTPlotCachePrecision)[coder decodeIntegerForKey:@"CPTPlot.cachePrecision"]; - needsRelabel = [coder decodeBoolForKey:@"CPTPlot.needsRelabel"]; - adjustLabelAnchors = [coder decodeBoolForKey:@"CPTPlot.adjustLabelAnchors"]; - showLabels = [coder decodeBoolForKey:@"CPTPlot.showLabels"]; - labelOffset = [coder decodeCGFloatForKey:@"CPTPlot.labelOffset"]; - labelRotation = [coder decodeCGFloatForKey:@"CPTPlot.labelRotation"]; - labelField = (NSUInteger)[coder decodeIntegerForKey:@"CPTPlot.labelField"]; - labelTextStyle = [[coder decodeObjectForKey:@"CPTPlot.labelTextStyle"] copy]; - labelFormatter = [coder decodeObjectForKey:@"CPTPlot.labelFormatter"]; - labelShadow = [coder decodeObjectForKey:@"CPTPlot.labelShadow"]; - labelIndexRange = [[coder decodeObjectForKey:@"CPTPlot.labelIndexRange"] rangeValue]; - labelAnnotations = [[coder decodeObjectForKey:@"CPTPlot.labelAnnotations"] mutableCopy]; + if ((self = [super initWithCoder:coder])) { + dataSource = [coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTPlot.dataSource"]; + title = [[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTPlot.title"] copy]; + attributedTitle = [[coder decodeObjectOfClass:[NSAttributedString class] + forKey:@"CPTPlot.attributedTitle"] copy]; + plotSpace = [coder decodeObjectOfClass:[CPTPlotSpace class] + forKey:@"CPTPlot.plotSpace"]; + cachePrecision = (CPTPlotCachePrecision)[coder decodeIntegerForKey:@"CPTPlot.cachePrecision"]; + needsRelabel = [coder decodeBoolForKey:@"CPTPlot.needsRelabel"]; + adjustLabelAnchors = [coder decodeBoolForKey:@"CPTPlot.adjustLabelAnchors"]; + showLabels = [coder decodeBoolForKey:@"CPTPlot.showLabels"]; + labelOffset = [coder decodeCGFloatForKey:@"CPTPlot.labelOffset"]; + labelRotation = [coder decodeCGFloatForKey:@"CPTPlot.labelRotation"]; + labelField = (NSUInteger)[coder decodeIntegerForKey:@"CPTPlot.labelField"]; + labelTextStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTPlot.labelTextStyle"] copy]; + labelFormatter = [coder decodeObjectOfClass:[NSFormatter class] + forKey:@"CPTPlot.labelFormatter"]; + labelShadow = [coder decodeObjectOfClass:[CPTShadow class] + forKey:@"CPTPlot.labelShadow"]; + labelIndexRange = [[coder decodeObjectOfClass:[NSValue class] + forKey:@"CPTPlot.labelIndexRange"] rangeValue]; + labelAnnotations = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTAnnotation class]]] + forKey:@"CPTPlot.labelAnnotations"] mutableCopy]; alignsPointsToPixels = [coder decodeBoolForKey:@"CPTPlot.alignsPointsToPixels"]; drawLegendSwatchDecoration = [coder decodeBoolForKey:@"CPTPlot.drawLegendSwatchDecoration"]; // support old archives if ( [coder containsValueForKey:@"CPTPlot.identifier"] ) { - self.identifier = [coder decodeObjectForKey:@"CPTPlot.identifier"]; + self.identifier = [coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTPlot.identifier"]; } // init other properties @@ -443,15 +453,27 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Bindings -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else /// @cond --(nullable Class)valueClassForBinding:(nonnull NSString *)binding +-(nullable Class)valueClassForBinding:(nonnull NSString *__unused)binding { return [NSArray class]; } @@ -582,7 +604,7 @@ -(void)insertDataAtIndex:(NSUInteger)idx numberOfRecords:(NSUInteger)numberOfRec NSParameterAssert(idx <= self.cachedDataCount); Class numericClass = [CPTNumericData class]; - for ( id data in (self.cachedData).allValues ) { + for ( id data in self.cachedData.allValues ) { if ( [data isKindOfClass:numericClass] ) { CPTMutableNumericData *numericData = (CPTMutableNumericData *)data; size_t sampleSize = numericData.sampleBytes; @@ -606,6 +628,15 @@ -(void)insertDataAtIndex:(NSUInteger)idx numberOfRecords:(NSUInteger)numberOfRec } } + CPTMutableAnnotationArray *labelArray = self.labelAnnotations; + if ( labelArray ) { + id nullObject = [NSNull null]; + NSUInteger lastIndex = idx + numberOfRecords - 1; + for ( NSUInteger i = idx; i <= lastIndex; i++ ) { + [labelArray insertObject:nullObject atIndex:i]; + } + } + self.cachedDataCount += numberOfRecords; [self reloadDataInIndexRange:NSMakeRange(idx, numberOfRecords)]; } @@ -618,7 +649,7 @@ -(void)deleteDataInIndexRange:(NSRange)indexRange NSParameterAssert(NSMaxRange(indexRange) <= self.cachedDataCount); Class numericClass = [CPTNumericData class]; - for ( id data in (self.cachedData).allValues ) { + for ( id data in self.cachedData.allValues ) { if ( [data isKindOfClass:numericClass] ) { CPTMutableNumericData *numericData = (CPTMutableNumericData *)data; size_t sampleSize = numericData.sampleBytes; @@ -637,8 +668,20 @@ -(void)deleteDataInIndexRange:(NSRange)indexRange } } + CPTMutableAnnotationArray *labelArray = self.labelAnnotations; + + NSUInteger maxIndex = NSMaxRange(indexRange); + Class annotationClass = [CPTAnnotation class]; + + for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { + CPTAnnotation *annotation = labelArray[i]; + if ( [annotation isKindOfClass:annotationClass] ) { + [self removeAnnotation:annotation]; + } + } + [labelArray removeObjectsInRange:indexRange]; + self.cachedDataCount -= indexRange.length; - [self relabelIndexRange:NSMakeRange(indexRange.location, self.cachedDataCount - indexRange.location)]; [self setNeedsDisplay]; } @@ -659,7 +702,7 @@ -(void)reloadPlotData /** @brief Reload plot data in the given index range from the data source immediately. * @param indexRange The index range to load. **/ --(void)reloadPlotDataInIndexRange:(NSRange)indexRange +-(void)reloadPlotDataInIndexRange:(NSRange __unused)indexRange { // do nothing--implementation provided by subclasses } @@ -687,9 +730,9 @@ -(void)reloadDataLabelsInIndexRange:(NSRange)indexRange atRecordIndex:indexRange.location]; } else if ( [theDataSource respondsToSelector:@selector(dataLabelForPlot:recordIndex:)] ) { - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLayerArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLayer *labelLayer = [theDataSource dataLabelForPlot:self recordIndex:idx]; @@ -812,8 +855,8 @@ -(BOOL)loadNumbersForAllFieldsFromDataSourceInRecordIndexRange:(NSRange)indexRan const NSUInteger sampleCount = data.numberOfSamples; CPTNumericDataType dataType = data.dataType; - if ( (sampleCount > 0) && (data.numberOfDimensions == 2) ) { - CPTNumberArray theShape = data.shape; + if ((sampleCount > 0) && (data.numberOfDimensions == 2)) { + CPTNumberArray *theShape = data.shape; const NSUInteger rowCount = theShape[0].unsignedIntegerValue; const NSUInteger fieldCount = theShape[1].unsignedIntegerValue; @@ -822,14 +865,14 @@ -(BOOL)loadNumbersForAllFieldsFromDataSourceInRecordIndexRange:(NSRange)indexRan switch ( self.cachePrecision ) { case CPTPlotCachePrecisionAuto: if ( self.doublePrecisionCache ) { - if ( !CPTDataTypeEqualToDataType(dataType, self.doubleDataType) ) { + if ( !CPTDataTypeEqualToDataType(dataType, self.doubleDataType)) { CPTMutableNumericData *mutableData = [data mutableCopy]; mutableData.dataType = self.doubleDataType; data = mutableData; } } else { - if ( !CPTDataTypeEqualToDataType(dataType, self.decimalDataType) ) { + if ( !CPTDataTypeEqualToDataType(dataType, self.decimalDataType)) { CPTMutableNumericData *mutableData = [data mutableCopy]; mutableData.dataType = self.decimalDataType; data = mutableData; @@ -838,7 +881,7 @@ -(BOOL)loadNumbersForAllFieldsFromDataSourceInRecordIndexRange:(NSRange)indexRan break; case CPTPlotCachePrecisionDecimal: - if ( !CPTDataTypeEqualToDataType(dataType, self.decimalDataType) ) { + if ( !CPTDataTypeEqualToDataType(dataType, self.decimalDataType)) { CPTMutableNumericData *mutableData = [data mutableCopy]; mutableData.dataType = self.decimalDataType; data = mutableData; @@ -846,7 +889,7 @@ -(BOOL)loadNumbersForAllFieldsFromDataSourceInRecordIndexRange:(NSRange)indexRan break; case CPTPlotCachePrecisionDouble: - if ( !CPTDataTypeEqualToDataType(dataType, self.doubleDataType) ) { + if ( !CPTDataTypeEqualToDataType(dataType, self.doubleDataType)) { CPTMutableNumericData *mutableData = [data mutableCopy]; mutableData.dataType = self.doubleDataType; data = mutableData; @@ -865,7 +908,7 @@ -(BOOL)loadNumbersForAllFieldsFromDataSourceInRecordIndexRange:(NSRange)indexRan for ( NSUInteger fieldNum = 0; fieldNum < fieldCount; fieldNum++ ) { NSMutableData *tempData = [[NSMutableData alloc] initWithLength:bufferLength]; - if ( CPTDataTypeEqualToDataType(dataType, self.doubleDataType) ) { + if ( CPTDataTypeEqualToDataType(dataType, self.doubleDataType)) { const double *sourceData = [data samplePointerAtIndex:0, fieldNum]; double *destData = tempData.mutableBytes; @@ -974,13 +1017,13 @@ -(void)cacheNumbers:(nullable id)numbers forField:(NSUInteger)fieldEnum case CPTScaleTypeCategory: { - CPTStringArray samples = (CPTStringArray)numbers; + CPTStringArray *samples = (CPTStringArray *)numbers; if ( [samples isKindOfClass:[NSArray class]] ) { [thePlotSpace setCategories:samples forCoordinate:coordinate]; NSUInteger sampleCount = samples.count; if ( sampleCount > 0 ) { - CPTMutableNumberArray indices = [[NSMutableArray alloc] initWithCapacity:sampleCount]; + CPTMutableNumberArray *indices = [[NSMutableArray alloc] initWithCapacity:sampleCount]; for ( NSString *category in samples ) { [indices addObject:@([thePlotSpace indexOfCategory:category forCoordinate:coordinate])]; @@ -1072,11 +1115,11 @@ -(void)cacheNumbers:(nullable id)numbers forField:(NSUInteger)fieldEnum atRecord case CPTScaleTypeCategory: { - CPTStringArray samples = (CPTStringArray)numbers; + CPTStringArray *samples = (CPTStringArray *)numbers; if ( [samples isKindOfClass:[NSArray class]] ) { sampleCount = samples.count; if ( sampleCount > 0 ) { - CPTMutableNumberArray indices = [[NSMutableArray alloc] initWithCapacity:sampleCount]; + CPTMutableNumberArray *indices = [[NSMutableArray alloc] initWithCapacity:sampleCount]; for ( NSString *category in samples ) { [thePlotSpace addCategory:category forCoordinate:coordinate]; @@ -1098,7 +1141,7 @@ -(void)cacheNumbers:(nullable id)numbers forField:(NSUInteger)fieldEnum atRecord break; } - if ( mutableNumbers && (sampleCount > 0) ) { + if ( mutableNumbers && (sampleCount > 0)) { // Ensure the data cache exists and is the right size CPTMutableNumericData *cachedNumbers = (self.cachedData)[cacheKey]; if ( !cachedNumbers ) { @@ -1137,7 +1180,7 @@ -(nonnull CPTMutableNumericData *)numericDataForNumbers:(nonnull id)numbers mutableNumbers = [numbers mutableCopy]; // ensure the numeric data is in a supported format; default to double if not already NSDecimal if ( !CPTDataTypeEqualToDataType(mutableNumbers.dataType, self.decimalDataType) && - !CPTDataTypeEqualToDataType(mutableNumbers.dataType, self.doubleDataType) ) { + !CPTDataTypeEqualToDataType(mutableNumbers.dataType, self.doubleDataType)) { mutableNumbers.dataType = self.doubleDataType; } } @@ -1146,10 +1189,10 @@ -(nonnull CPTMutableNumericData *)numericDataForNumbers:(nonnull id)numbers mutableNumbers = [[CPTMutableNumericData alloc] initWithData:numbers dataType:loadedDataType shape:nil]; } else if ( [numbers isKindOfClass:[NSArray class]] ) { - if ( ( (CPTNumberArray)numbers ).count == 0 ) { + if (((CPTNumberArray *)numbers).count == 0 ) { loadedDataType = self.doubleDataType; } - else if ( [( (NSArray < NSNumber * > *)numbers )[0] isKindOfClass:[NSDecimalNumber class]] ) { + else if ( [((NSArray *)numbers)[0] isKindOfClass:[NSDecimalNumber class]] ) { loadedDataType = self.decimalDataType; } else { @@ -1178,7 +1221,7 @@ -(BOOL)doublePrecisionCache Class numberClass = [NSNumber class]; for ( id key in dataCache.allKeys ) { if ( [key isKindOfClass:numberClass] ) { - result = CPTDataTypeEqualToDataType( ( (CPTMutableNumericData *)dataCache[key] ).dataType, self.doubleDataType ); + result = CPTDataTypeEqualToDataType(((CPTMutableNumericData *)dataCache[key]).dataType, self.doubleDataType); break; } } @@ -1315,7 +1358,7 @@ -(CPTNumericDataType)doubleDataType static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - dataType = CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ); + dataType = CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()); }); return dataType; @@ -1327,7 +1370,7 @@ -(CPTNumericDataType)decimalDataType static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - dataType = CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent() ); + dataType = CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent()); }); return dataType; @@ -1424,31 +1467,21 @@ -(nullable CPTPlotRange *)plotRangeForField:(NSUInteger)fieldEnum NSUInteger numberOfSamples = numbers.numberOfSamples; if ( numberOfSamples > 0 ) { if ( self.doublePrecisionCache ) { - const double *doubles = (const double *)numbers.bytes; - double min = (double)INFINITY; double max = -(double)INFINITY; - vDSP_minvD(doubles, 1, &min, (vDSP_Length)numberOfSamples); - vDSP_maxvD(doubles, 1, &max, (vDSP_Length)numberOfSamples); - - if ( isnan(min) || isnan(max) ) { - // vDSP functions may return NAN if any data in the array is NAN - min = (double)INFINITY; - max = -(double)INFINITY; + const double *doubles = (const double *)numbers.bytes; + const double *lastSample = doubles + numberOfSamples; - const double *lastSample = doubles + numberOfSamples; + while ( doubles < lastSample ) { + double value = *doubles++; - while ( doubles < lastSample ) { - double value = *doubles++; - - if ( !isnan(value) ) { - if ( value < min ) { - min = value; - } - if ( value > max ) { - max = value; - } + if ( !isnan(value)) { + if ( value < min ) { + min = value; + } + if ( value > max ) { + max = value; } } } @@ -1463,20 +1496,21 @@ -(nullable CPTPlotRange *)plotRangeForField:(NSUInteger)fieldEnum const NSDecimal *decimals = (const NSDecimal *)numbers.bytes; const NSDecimal *lastSample = decimals + numberOfSamples; + while ( decimals < lastSample ) { NSDecimal value = *decimals++; - if ( !NSDecimalIsNotANumber(&value) ) { - if ( CPTDecimalLessThan(value, min) ) { + if ( !NSDecimalIsNotANumber(&value)) { + if ( CPTDecimalLessThan(value, min)) { min = value; } - if ( CPTDecimalGreaterThan(value, max) ) { + if ( CPTDecimalGreaterThan(value, max)) { max = value; } } } - if ( CPTDecimalGreaterThanOrEqualTo(max, min) ) { + if ( CPTDecimalGreaterThanOrEqualTo(max, min)) { range = [CPTPlotRange plotRangeWithLocationDecimal:min lengthDecimal:CPTDecimalSubtract(max, min)]; } } @@ -1490,7 +1524,7 @@ -(nullable CPTPlotRange *)plotRangeForField:(NSUInteger)fieldEnum **/ -(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord { - CPTNumberArray fields = [self fieldIdentifiersForCoordinate:coord]; + CPTNumberArray *fields = [self fieldIdentifiersForCoordinate:coord]; if ( fields.count == 0 ) { return nil; @@ -1498,12 +1532,47 @@ -(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord CPTMutablePlotRange *unionRange = nil; for ( NSNumber *field in fields ) { - CPTPlotRange *currentRange = [self plotRangeForField:field.unsignedIntValue]; + CPTPlotRange *currentRange = [self plotRangeForField:field.unsignedIntegerValue]; if ( !unionRange ) { unionRange = [currentRange mutableCopy]; } else { - [unionRange unionPlotRange:[self plotRangeForField:field.unsignedIntValue]]; + [unionRange unionPlotRange:[self plotRangeForField:field.unsignedIntegerValue]]; + } + } + + return unionRange; +} + +/** @brief Determines the smallest plot range that fully encloses the entire plot for a particular field. + * @param fieldEnum The field enumerator identifying the field. + * @return The plot range enclosing the data. + **/ +-(nullable CPTPlotRange *)plotRangeEnclosingField:(NSUInteger)fieldEnum +{ + return [self plotRangeForField:fieldEnum]; +} + +/** @brief Determines the smallest plot range that fully encloses the entire plot for a particular coordinate. + * @param coord The coordinate identifier. + * @return The plot range enclosing the data. + **/ +-(nullable CPTPlotRange *)plotRangeEnclosingCoordinate:(CPTCoordinate)coord +{ + CPTNumberArray *fields = [self fieldIdentifiersForCoordinate:coord]; + + if ( fields.count == 0 ) { + return nil; + } + + CPTMutablePlotRange *unionRange = nil; + for ( NSNumber *field in fields ) { + CPTPlotRange *currentRange = [self plotRangeEnclosingField:field.unsignedIntegerValue]; + if ( !unionRange ) { + unionRange = [currentRange mutableCopy]; + } + else { + [unionRange unionPlotRange:[self plotRangeEnclosingField:field.unsignedIntegerValue]]; } } @@ -1542,8 +1611,8 @@ -(void)relabel NSFormatter *dataLabelFormatter = self.labelFormatter; BOOL plotProvidesLabels = dataLabelTextStyle && dataLabelFormatter; - BOOL hasCachedLabels = NO; - NSMutableArray *cachedLabels = (NSMutableArray *)[self cachedArrayForKey: CPTPlotBindingDataLabels]; + BOOL hasCachedLabels = NO; + CPTMutableLayerArray *cachedLabels = (CPTMutableLayerArray *)[self cachedArrayForKey:CPTPlotBindingDataLabels]; for ( CPTLayer *label in cachedLabels ) { if ( ![label isKindOfClass:nullClass] ) { hasCachedLabels = YES; @@ -1551,7 +1620,7 @@ -(void)relabel } } - if ( !self.showLabels || (!hasCachedLabels && !plotProvidesLabels) ) { + if ( !self.showLabels || (!hasCachedLabels && !plotProvidesLabels)) { for ( CPTAnnotation *annotation in self.labelAnnotations ) { if ( [annotation isKindOfClass:annotationClass] ) { [self removeAnnotation:annotation]; @@ -1561,9 +1630,9 @@ -(void)relabel return; } - CPTDictionary textAttributes = dataLabelTextStyle.attributes; - BOOL hasAttributedFormatter = ([dataLabelFormatter attributedStringForObjectValue:[NSDecimalNumber zero] - withDefaultAttributes:textAttributes] != nil); + CPTDictionary *textAttributes = dataLabelTextStyle.attributes; + BOOL hasAttributedFormatter = ([dataLabelFormatter attributedStringForObjectValue:[NSDecimalNumber zero] + withDefaultAttributes:textAttributes] != nil); NSUInteger sampleCount = self.cachedDataCount; NSRange indexRange = self.labelIndexRange; @@ -1573,11 +1642,11 @@ -(void)relabel self.labelAnnotations = [NSMutableArray arrayWithCapacity:sampleCount]; } - CPTPlotSpace *thePlotSpace = self.plotSpace; - CGFloat theRotation = self.labelRotation; - CPTMutableAnnotationArray labelArray = self.labelAnnotations; - NSUInteger oldLabelCount = labelArray.count; - id nilObject = [CPTPlot nilData]; + CPTPlotSpace *thePlotSpace = self.plotSpace; + CGFloat theRotation = self.labelRotation; + CPTMutableAnnotationArray *labelArray = self.labelAnnotations; + NSUInteger oldLabelCount = labelArray.count; + id nilObject = [CPTPlot nilData]; CPTMutableNumericData *labelFieldDataCache = [self cachedNumbersForField:self.labelField]; CPTShadow *theShadow = self.labelShadow; @@ -1586,13 +1655,13 @@ -(void)relabel NSNumber *dataValue = [labelFieldDataCache sampleValue:i]; CPTLayer *newLabelLayer; - if ( isnan([dataValue doubleValue]) ) { + if ( isnan([dataValue doubleValue])) { newLabelLayer = nil; } else { newLabelLayer = [self cachedValueForKey:CPTPlotBindingDataLabels recordIndex:i]; - if ( ( (newLabelLayer == nil) || (newLabelLayer == nilObject) ) && plotProvidesLabels ) { + if (((newLabelLayer == nil) || (newLabelLayer == nilObject)) && plotProvidesLabels ) { if ( hasAttributedFormatter ) { NSAttributedString *labelString = [dataLabelFormatter attributedStringForObjectValue:dataValue withDefaultAttributes:textAttributes]; newLabelLayer = [[CPTTextLayer alloc] initWithAttributedText:labelString]; @@ -1603,7 +1672,7 @@ -(void)relabel } } - if ( [newLabelLayer isKindOfClass:nullClass] || (newLabelLayer == nilObject) ) { + if ( [newLabelLayer isKindOfClass:nullClass] || (newLabelLayer == nilObject)) { newLabelLayer = nil; } } @@ -1671,14 +1740,14 @@ -(void)updateContentAnchorForLabel:(nonnull CPTPlotSpaceAnnotation *)label { if ( label && self.adjustLabelAnchors ) { CGPoint displacement = label.displacement; - if ( CGPointEqualToPoint(displacement, CGPointZero) ) { + if ( CGPointEqualToPoint(displacement, CGPointZero)) { displacement.y = CPTFloat(1.0); // put the label above the data point if zero displacement } CGFloat angle = CPTFloat(M_PI) + atan2(displacement.y, displacement.x) - label.rotation; CGFloat newAnchorX = cos(angle); CGFloat newAnchorY = sin(angle); - if ( ABS(newAnchorX) <= ABS(newAnchorY) ) { + if ( ABS(newAnchorX) <= ABS(newAnchorY)) { newAnchorX /= ABS(newAnchorY); newAnchorY = signbit(newAnchorY) ? CPTFloat(-1.0) : CPTFloat(1.0); } @@ -1687,7 +1756,7 @@ -(void)updateContentAnchorForLabel:(nonnull CPTPlotSpaceAnnotation *)label newAnchorX = signbit(newAnchorX) ? CPTFloat(-1.0) : CPTFloat(1.0); } - label.contentAnchorPoint = CPTPointMake( ( newAnchorX + CPTFloat(1.0) ) / CPTFloat(2.0), ( newAnchorY + CPTFloat(1.0) ) / CPTFloat(2.0) ); + label.contentAnchorPoint = CPTPointMake((newAnchorX + CPTFloat(1.0)) / CPTFloat(2.0), (newAnchorY + CPTFloat(1.0)) / CPTFloat(2.0)); } } @@ -1698,9 +1767,9 @@ -(void)updateContentAnchorForLabel:(nonnull CPTPlotSpaceAnnotation *)label **/ -(void)repositionAllLabelAnnotations { - CPTAnnotationArray annotations = self.labelAnnotations; - NSUInteger labelCount = annotations.count; - Class annotationClass = [CPTAnnotation class]; + CPTAnnotationArray *annotations = self.labelAnnotations; + NSUInteger labelCount = annotations.count; + Class annotationClass = [CPTAnnotation class]; for ( NSUInteger i = 0; i < labelCount; i++ ) { CPTPlotSpaceAnnotation *annotation = annotations[i]; @@ -1726,7 +1795,7 @@ -(NSUInteger)numberOfLegendEntries * @param idx The index of the desired title. * @return The title of the legend entry at the requested index. **/ --(nullable NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx +-(nullable NSString *)titleForLegendEntryAtIndex:(NSUInteger __unused)idx { NSString *legendTitle = self.title; @@ -1745,7 +1814,7 @@ -(nullable NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx * @param idx The index of the desired title. * @return The styled title of the legend entry at the requested index. **/ --(nullable NSAttributedString *)attributedTitleForLegendEntryAtIndex:(NSUInteger)idx +-(nullable NSAttributedString *)attributedTitleForLegendEntryAtIndex:(NSUInteger __unused)idx { NSAttributedString *legendTitle = self.attributedTitle; @@ -1772,6 +1841,7 @@ -(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx i id theDelegate = (id)self.delegate; CPTFill *theFill = nil; + if ( [theDelegate respondsToSelector:@selector(legend:fillForSwatchAtIndex:forPlot:)] ) { theFill = [theDelegate legend:legend fillForSwatchAtIndex:idx forPlot:self]; } @@ -1838,15 +1908,15 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(plot:dataLabelTouchDownAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelTouchDownAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelWasSelectedAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelWasSelectedAtRecordIndex:withEvent:)] ) { // Inform delegate if a label was hit - CPTMutableAnnotationArray labelArray = self.labelAnnotations; - NSUInteger labelCount = labelArray.count; - Class annotationClass = [CPTAnnotation class]; + CPTMutableAnnotationArray *labelArray = self.labelAnnotations; + NSUInteger labelCount = labelArray.count; + Class annotationClass = [CPTAnnotation class]; for ( NSUInteger idx = 0; idx < labelCount; idx++ ) { CPTPlotSpaceAnnotation *annotation = labelArray[idx]; @@ -1855,7 +1925,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) if ( labelLayer && !labelLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:labelLayer]; - if ( CGRectContainsPoint(labelLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(labelLayer.bounds, labelPoint)) { self.pointingDeviceDownLabelIndex = idx; BOOL handled = NO; @@ -1916,15 +1986,15 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(plot:dataLabelTouchUpAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelTouchUpAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelWasSelectedAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelWasSelectedAtRecordIndex:withEvent:)] ) { // Inform delegate if a label was hit - CPTMutableAnnotationArray labelArray = self.labelAnnotations; - NSUInteger labelCount = labelArray.count; - Class annotationClass = [CPTAnnotation class]; + CPTMutableAnnotationArray *labelArray = self.labelAnnotations; + NSUInteger labelCount = labelArray.count; + Class annotationClass = [CPTAnnotation class]; for ( NSUInteger idx = 0; idx < labelCount; idx++ ) { CPTPlotSpaceAnnotation *annotation = labelArray[idx]; @@ -1933,7 +2003,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in if ( labelLayer && !labelLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:labelLayer]; - if ( CGRectContainsPoint(labelLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(labelLayer.bounds, labelPoint)) { BOOL handled = NO; if ( [theDelegate respondsToSelector:@selector(plot:dataLabelTouchUpAtRecordIndex:)] ) { @@ -1977,12 +2047,12 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in /// @cond --(nullable NSArray *)dataLabels +-(nullable CPTLayerArray *)dataLabels { return [self cachedArrayForKey:CPTPlotBindingDataLabels]; } --(void)setDataLabels:(nullable NSArray *)newDataLabels +-(void)setDataLabels:(nullable CPTLayerArray *)newDataLabels { [self cacheArray:newDataLabels forKey:CPTPlotBindingDataLabels]; [self setNeedsRelabel]; @@ -2184,7 +2254,7 @@ -(NSUInteger)numberOfFields /** @brief Identifiers (enum values) identifying the fields. * @return Array of NSNumber objects for the various field identifiers. **/ --(nonnull CPTNumberArray)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[]; } @@ -2193,7 +2263,7 @@ -(nonnull CPTNumberArray)fieldIdentifiers * @param coord The coordinate for which the corresponding field identifiers are desired. * @return Array of NSNumber objects for the field identifiers. **/ --(nonnull CPTNumberArray)fieldIdentifiersForCoordinate:(CPTCoordinate)coord +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate __unused)coord { return @[]; } @@ -2202,7 +2272,7 @@ -(nonnull CPTNumberArray)fieldIdentifiersForCoordinate:(CPTCoordinate)coord * @param field The field identifier for which the corresponding coordinate is desired. * @return The coordinate that corresponds to a particular field identifier or #CPTCoordinateNone if there is no matching coordinate. */ --(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger)field +-(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger __unused)field { return CPTCoordinateNone; } @@ -2214,7 +2284,7 @@ -(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger)field * @param label The annotation for the data label. * @param idx The data index for the label. **/ --(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx +-(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *__unused)label forIndex:(NSUInteger __unused)idx { // do nothing--implementation provided by subclasses } @@ -2227,7 +2297,7 @@ -(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex: * @param point The coordinates of the interaction. * @return The index of the data point that is under the given point or @ref NSNotFound if none was found. */ --(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point +-(NSUInteger)dataIndexFromInteractionPoint:(CGPoint __unused)point { return NSNotFound; } diff --git a/framework/Source/CPTPlotArea.h b/framework/Source/CPTPlotArea.h index e98181fa7..1d29c5f78 100644 --- a/framework/Source/CPTPlotArea.h +++ b/framework/Source/CPTPlotArea.h @@ -14,7 +14,7 @@ /** * @brief Plot area delegate. **/ -@protocol CPTPlotAreaDelegate +@protocol CPTPlotAreaDelegate @optional @@ -85,7 +85,7 @@ /// @name Layer Ordering /// @{ -@property (nonatomic, readwrite, strong, nullable) CPTNumberArray topDownLayerOrder; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *topDownLayerOrder; /// @} /// @name Decorations diff --git a/framework/Source/CPTPlotArea.m b/framework/Source/CPTPlotArea.m index eb1d5989c..34f04616d 100644 --- a/framework/Source/CPTPlotArea.m +++ b/framework/Source/CPTPlotArea.m @@ -74,7 +74,7 @@ @implementation CPTPlotArea **/ @synthesize axisTitleGroup; -/** @property nullable CPTNumberArray topDownLayerOrder +/** @property nullable CPTNumberArray *topDownLayerOrder * @brief An array of graph layers to be drawn in an order other than the default. * * The array should reference the layers using the constants defined in #CPTGraphLayerType. @@ -152,7 +152,7 @@ @implementation CPTPlotArea **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { minorGridLineGroup = nil; majorGridLineGroup = nil; axisSet = nil; @@ -162,7 +162,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame fill = nil; touchedPoint = CPTPointMake(NAN, NAN); topDownLayerOrder = nil; - bottomUpLayerOrder = malloc( kCPTNumberOfLayers * sizeof(CPTGraphLayerType) ); + bottomUpLayerOrder = calloc(kCPTNumberOfLayers, sizeof(CPTGraphLayerType)); [self updateLayerOrder]; CPTPlotGroup *newPlotGroup = [[CPTPlotGroup alloc] initWithFrame:newFrame]; @@ -183,7 +183,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTPlotArea *theLayer = (CPTPlotArea *)layer; minorGridLineGroup = theLayer->minorGridLineGroup; @@ -195,8 +195,8 @@ -(nonnull instancetype)initWithLayer:(nonnull id)layer fill = theLayer->fill; touchedPoint = theLayer->touchedPoint; topDownLayerOrder = theLayer->topDownLayerOrder; - bottomUpLayerOrder = malloc( kCPTNumberOfLayers * sizeof(CPTGraphLayerType) ); - memcpy( bottomUpLayerOrder, theLayer->bottomUpLayerOrder, kCPTNumberOfLayers * sizeof(CPTGraphLayerType) ); + bottomUpLayerOrder = calloc(kCPTNumberOfLayers, sizeof(CPTGraphLayerType)); + memcpy(bottomUpLayerOrder, theLayer->bottomUpLayerOrder, kCPTNumberOfLayers * sizeof(CPTGraphLayerType)); widthDecimal = theLayer->widthDecimal; heightDecimal = theLayer->heightDecimal; } @@ -238,17 +238,25 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - minorGridLineGroup = [coder decodeObjectForKey:@"CPTPlotArea.minorGridLineGroup"]; - majorGridLineGroup = [coder decodeObjectForKey:@"CPTPlotArea.majorGridLineGroup"]; - axisSet = [coder decodeObjectForKey:@"CPTPlotArea.axisSet"]; - plotGroup = [coder decodeObjectForKey:@"CPTPlotArea.plotGroup"]; - axisLabelGroup = [coder decodeObjectForKey:@"CPTPlotArea.axisLabelGroup"]; - axisTitleGroup = [coder decodeObjectForKey:@"CPTPlotArea.axisTitleGroup"]; - fill = [[coder decodeObjectForKey:@"CPTPlotArea.fill"] copy]; - topDownLayerOrder = [coder decodeObjectForKey:@"CPTPlotArea.topDownLayerOrder"]; - - bottomUpLayerOrder = malloc( kCPTNumberOfLayers * sizeof(CPTGraphLayerType) ); + if ((self = [super initWithCoder:coder])) { + minorGridLineGroup = [coder decodeObjectOfClass:[CPTGridLineGroup class] + forKey:@"CPTPlotArea.minorGridLineGroup"]; + majorGridLineGroup = [coder decodeObjectOfClass:[CPTGridLineGroup class] + forKey:@"CPTPlotArea.majorGridLineGroup"]; + axisSet = [coder decodeObjectOfClass:[CPTAxisSet class] + forKey:@"CPTPlotArea.axisSet"]; + plotGroup = [coder decodeObjectOfClass:[CPTPlotGroup class] + forKey:@"CPTPlotArea.plotGroup"]; + axisLabelGroup = [coder decodeObjectOfClass:[CPTAxisLabelGroup class] + forKey:@"CPTPlotArea.axisLabelGroup"]; + axisTitleGroup = [coder decodeObjectOfClass:[CPTAxisLabelGroup class] + forKey:@"CPTPlotArea.axisTitleGroup"]; + fill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTPlotArea.fill"] copy]; + topDownLayerOrder = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTPlotArea.topDownLayerOrder"]; + + bottomUpLayerOrder = calloc(kCPTNumberOfLayers, sizeof(CPTGraphLayerType)); [self updateLayerOrder]; touchedPoint = CPTPointMake(NAN, NAN); @@ -262,6 +270,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing @@ -288,7 +308,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context [self.fill fillRect:self.bounds inContext:context]; - CPTAxisArray theAxes = self.axisSet.axes; + CPTAxisArray *theAxes = self.axisSet.axes; for ( CPTAxis *axis in theAxes ) { [axis drawBackgroundBandsInContext:context]; @@ -357,7 +377,7 @@ -(void)layoutSublayers /// @cond --(nullable CPTSublayerSet)sublayersExcludedFromAutomaticLayout +-(nullable CPTSublayerSet *)sublayersExcludedFromAutomaticLayout { CPTGridLineGroup *minorGrid = self.minorGridLineGroup; CPTGridLineGroup *majorGrid = self.majorGridLineGroup; @@ -367,7 +387,7 @@ -(nullable CPTSublayerSet)sublayersExcludedFromAutomaticLayout CPTAxisLabelGroup *titles = self.axisTitleGroup; if ( minorGrid || majorGrid || theAxisSet || thePlotGroup || labels || titles ) { - CPTMutableSublayerSet excludedSublayers = [super.sublayersExcludedFromAutomaticLayout mutableCopy]; + CPTMutableSublayerSet *excludedSublayers = [super.sublayersExcludedFromAutomaticLayout mutableCopy]; if ( !excludedSublayers ) { excludedSublayers = [NSMutableSet set]; } @@ -413,12 +433,12 @@ -(void)updateLayerOrder *(buLayerOrder++) = (CPTGraphLayerType)i; } - CPTNumberArray tdLayerOrder = self.topDownLayerOrder; + CPTNumberArray *tdLayerOrder = self.topDownLayerOrder; if ( tdLayerOrder ) { buLayerOrder = self.bottomUpLayerOrder; for ( NSUInteger layerIndex = 0; layerIndex < tdLayerOrder.count; layerIndex++ ) { - CPTGraphLayerType layerType = (CPTGraphLayerType)(tdLayerOrder[layerIndex]).intValue; + CPTGraphLayerType layerType = (CPTGraphLayerType)tdLayerOrder[layerIndex].intValue; NSUInteger i = kCPTNumberOfLayers - layerIndex - 1; while ( buLayerOrder[i] != layerType ) { if ( i == 0 ) { @@ -682,7 +702,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(plotAreaTouchDown:)] || [theDelegate respondsToSelector:@selector(plotAreaTouchDown:withEvent:)] || [theDelegate respondsToSelector:@selector(plotAreaWasSelected:)] || @@ -690,7 +710,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) // Inform delegate if a point was hit CGPoint plotAreaPoint = [theGraph convertPoint:interactionPoint toLayer:self]; - if ( CGRectContainsPoint(self.bounds, plotAreaPoint) ) { + if ( CGRectContainsPoint(self.bounds, plotAreaPoint)) { self.touchedPoint = plotAreaPoint; if ( [theDelegate respondsToSelector:@selector(plotAreaTouchDown:)] ) { @@ -736,7 +756,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in CGPoint lastPoint = self.touchedPoint; self.touchedPoint = CPTPointMake(NAN, NAN); - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(plotAreaTouchUp:)] || [theDelegate respondsToSelector:@selector(plotAreaTouchUp:withEvent:)] || [theDelegate respondsToSelector:@selector(plotAreaWasSelected:)] || @@ -744,9 +764,9 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in // Inform delegate if a point was hit CGPoint plotAreaPoint = [theGraph convertPoint:interactionPoint toLayer:self]; - if ( CGRectContainsPoint(self.bounds, plotAreaPoint) ) { + if ( CGRectContainsPoint(self.bounds, plotAreaPoint)) { CGVector offset = CGVectorMake(plotAreaPoint.x - lastPoint.x, plotAreaPoint.y - lastPoint.y); - if ( (offset.dx * offset.dx + offset.dy * offset.dy) <= CPTFloat(25.0) ) { + if ((offset.dx * offset.dx + offset.dy * offset.dy) <= CPTFloat(25.0)) { if ( [theDelegate respondsToSelector:@selector(plotAreaTouchUp:)] ) { [theDelegate plotAreaTouchUp:self]; } @@ -798,7 +818,7 @@ -(void)setFill:(nullable CPTFill *)newFill -(void)setMinorGridLineGroup:(nullable CPTGridLineGroup *)newGridLines { - if ( (newGridLines != minorGridLineGroup) || self.isUpdatingLayers ) { + if ((newGridLines != minorGridLineGroup) || self.isUpdatingLayers ) { [minorGridLineGroup removeFromSuperlayer]; minorGridLineGroup = newGridLines; if ( newGridLines ) { @@ -814,7 +834,7 @@ -(void)setMinorGridLineGroup:(nullable CPTGridLineGroup *)newGridLines -(void)setMajorGridLineGroup:(nullable CPTGridLineGroup *)newGridLines { - if ( (newGridLines != majorGridLineGroup) || self.isUpdatingLayers ) { + if ((newGridLines != majorGridLineGroup) || self.isUpdatingLayers ) { [majorGridLineGroup removeFromSuperlayer]; majorGridLineGroup = newGridLines; if ( newGridLines ) { @@ -830,7 +850,7 @@ -(void)setMajorGridLineGroup:(nullable CPTGridLineGroup *)newGridLines -(void)setAxisSet:(nullable CPTAxisSet *)newAxisSet { - if ( (newAxisSet != axisSet) || self.isUpdatingLayers ) { + if ((newAxisSet != axisSet) || self.isUpdatingLayers ) { [axisSet removeFromSuperlayer]; for ( CPTAxis *axis in axisSet.axes ) { axis.plotArea = nil; @@ -858,7 +878,7 @@ -(void)setAxisSet:(nullable CPTAxisSet *)newAxisSet -(void)setPlotGroup:(nullable CPTPlotGroup *)newPlotGroup { - if ( (newPlotGroup != plotGroup) || self.isUpdatingLayers ) { + if ((newPlotGroup != plotGroup) || self.isUpdatingLayers ) { [plotGroup removeFromSuperlayer]; plotGroup = newPlotGroup; if ( newPlotGroup ) { @@ -872,7 +892,7 @@ -(void)setPlotGroup:(nullable CPTPlotGroup *)newPlotGroup -(void)setAxisLabelGroup:(nullable CPTAxisLabelGroup *)newAxisLabelGroup { - if ( (newAxisLabelGroup != axisLabelGroup) || self.isUpdatingLayers ) { + if ((newAxisLabelGroup != axisLabelGroup) || self.isUpdatingLayers ) { [axisLabelGroup removeFromSuperlayer]; axisLabelGroup = newAxisLabelGroup; if ( newAxisLabelGroup ) { @@ -886,7 +906,7 @@ -(void)setAxisLabelGroup:(nullable CPTAxisLabelGroup *)newAxisLabelGroup -(void)setAxisTitleGroup:(nullable CPTAxisLabelGroup *)newAxisTitleGroup { - if ( (newAxisTitleGroup != axisTitleGroup) || self.isUpdatingLayers ) { + if ((newAxisTitleGroup != axisTitleGroup) || self.isUpdatingLayers ) { [axisTitleGroup removeFromSuperlayer]; axisTitleGroup = newAxisTitleGroup; if ( newAxisTitleGroup ) { @@ -898,7 +918,7 @@ -(void)setAxisTitleGroup:(nullable CPTAxisLabelGroup *)newAxisTitleGroup } } --(void)setTopDownLayerOrder:(nullable CPTNumberArray)newArray +-(void)setTopDownLayerOrder:(nullable CPTNumberArray *)newArray { if ( newArray != topDownLayerOrder ) { topDownLayerOrder = newArray; @@ -919,7 +939,7 @@ -(void)setGraph:(nullable CPTGraph *)newGraph -(void)setBounds:(CGRect)newBounds { - if ( !CGRectEqualToRect(self.bounds, newBounds) ) { + if ( !CGRectEqualToRect(self.bounds, newBounds)) { self.widthDecimal = CPTDecimalFromCGFloat(newBounds.size.width); self.heightDecimal = CPTDecimalFromCGFloat(newBounds.size.height); diff --git a/framework/Source/CPTPlotAreaFrame.m b/framework/Source/CPTPlotAreaFrame.m index 71fba56d9..c5723c6a0 100644 --- a/framework/Source/CPTPlotAreaFrame.m +++ b/framework/Source/CPTPlotAreaFrame.m @@ -56,7 +56,7 @@ @implementation CPTPlotAreaFrame **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { plotArea = nil; CPTPlotArea *newPlotArea = [[CPTPlotArea alloc] initWithFrame:newFrame]; @@ -74,7 +74,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTPlotAreaFrame *theLayer = (CPTPlotAreaFrame *)layer; plotArea = theLayer->plotArea; @@ -98,14 +98,27 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - plotArea = [coder decodeObjectForKey:@"CPTPlotAreaFrame.plotArea"]; + if ((self = [super initWithCoder:coder])) { + plotArea = [coder decodeObjectOfClass:[CPTPlotArea class] + forKey:@"CPTPlotAreaFrame.plotArea"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Event Handling diff --git a/framework/Source/CPTPlotGroup.m b/framework/Source/CPTPlotGroup.m index 4b6ea01f7..4a224e691 100644 --- a/framework/Source/CPTPlotGroup.m +++ b/framework/Source/CPTPlotGroup.m @@ -14,10 +14,11 @@ @implementation CPTPlotGroup -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { + if ((self = [super initWithCoder:coder])) { // support old archives if ( [coder containsValueForKey:@"CPTPlotGroup.identifier"] ) { - self.identifier = [coder decodeObjectForKey:@"CPTPlotGroup.identifier"]; + self.identifier = [coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTPlotGroup.identifier"]; } } return self; @@ -25,6 +26,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Organizing Plots @@ -70,7 +83,7 @@ -(void)display // nothing to draw } --(void)renderAsVectorInContext:(nonnull CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef __unused)context { // nothing to draw } diff --git a/framework/Source/CPTPlotRange.h b/framework/Source/CPTPlotRange.h index e23dda2b9..9a3460e96 100644 --- a/framework/Source/CPTPlotRange.h +++ b/framework/Source/CPTPlotRange.h @@ -7,23 +7,24 @@ /** * @brief Enumeration of possible results of a plot range comparison. **/ -typedef NS_ENUM (NSInteger, CPTPlotRangeComparisonResult) { +typedef NS_CLOSED_ENUM(NSInteger, CPTPlotRangeComparisonResult) { CPTPlotRangeComparisonResultNumberBelowRange, ///< Number is below the range. CPTPlotRangeComparisonResultNumberInRange, ///< Number is in the range. - CPTPlotRangeComparisonResultNumberAboveRange ///< Number is above the range. + CPTPlotRangeComparisonResultNumberAboveRange, ///< Number is above the range. + CPTPlotRangeComparisonResultNumberUndefined ///< Number is undefined (e.g., @NAN). }; /** * @brief An array of plot ranges. **/ -typedef NSArray *CPTPlotRangeArray; +typedef NSArray CPTPlotRangeArray; /** * @brief A mutable array of plot ranges. **/ -typedef NSMutableArray *CPTMutablePlotRangeArray; +typedef NSMutableArray CPTMutablePlotRangeArray; -@interface CPTPlotRange : NSObject +@interface CPTPlotRange : NSObject /// @name Range Limits /// @{ @@ -46,6 +47,9 @@ typedef NSMutableArray *CPTMutablePlotRangeArray; @property (nonatomic, readonly) double minLimitDouble; @property (nonatomic, readonly) double midPointDouble; @property (nonatomic, readonly) double maxLimitDouble; + +@property (nonatomic, readonly) BOOL isInfinite; +@property (nonatomic, readonly) CPTSign lengthSign; /// @} /// @name Factory Methods @@ -56,8 +60,8 @@ typedef NSMutableArray *CPTMutablePlotRangeArray; /// @name Initialization /// @{ --(nonnull instancetype)initWithLocation:(nonnull NSNumber *)loc length:(nonnull NSNumber *)len; --(nonnull instancetype)initWithLocationDecimal:(NSDecimal)loc lengthDecimal:(NSDecimal)len NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithLocation:(nonnull NSNumber *)loc length:(nonnull NSNumber *)len NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithLocationDecimal:(NSDecimal)loc lengthDecimal:(NSDecimal)len; -(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; /// @} diff --git a/framework/Source/CPTPlotRange.m b/framework/Source/CPTPlotRange.m index bd7f051cb..c83c432e6 100644 --- a/framework/Source/CPTPlotRange.m +++ b/framework/Source/CPTPlotRange.m @@ -12,6 +12,9 @@ @interface CPTPlotRange() @property (nonatomic, readwrite) double locationDouble; @property (nonatomic, readwrite) double lengthDouble; +@property (nonatomic, readwrite) BOOL isInfinite; +@property (nonatomic, readwrite) CPTSign lengthSign; + @property (nonatomic, readwrite) BOOL inValueUpdate; @end @@ -121,6 +124,16 @@ @implementation CPTPlotRange **/ @dynamic maxLimitDouble; +/** @property BOOL isInfinite + * @brief @YES if the length of the range is infinite. + **/ +@synthesize isInfinite; + +/** @property CPTSign lengthSign + * @brief The direction (positive or negative) if the length of the range is infinite. + **/ +@synthesize lengthSign; + @synthesize inValueUpdate; #pragma mark - @@ -156,8 +169,24 @@ -(nonnull instancetype)initWithLocation:(nonnull NSNumber *)loc length:(nonnull NSParameterAssert(loc); NSParameterAssert(len); - return [self initWithLocationDecimal:loc.decimalValue - lengthDecimal:len.decimalValue]; + if ((self = [super init])) { + locationDecimal = loc.decimalValue; + locationDouble = loc.doubleValue; + + lengthDecimal = len.decimalValue; + lengthDouble = len.doubleValue; + + if ( isnan(lengthDouble)) { + isInfinite = NO; + lengthSign = CPTSignNone; + } + else { + isInfinite = (BOOL)isinf(lengthDouble); + lengthSign = signbit(lengthDouble) ? CPTSignNegative : CPTSignPositive; + } + } + + return self; } /** @brief Initializes a newly allocated CPTPlotRange object with the provided location and length. @@ -167,11 +196,8 @@ -(nonnull instancetype)initWithLocation:(nonnull NSNumber *)loc length:(nonnull **/ -(nonnull instancetype)initWithLocationDecimal:(NSDecimal)loc lengthDecimal:(NSDecimal)len { - if ( (self = [super init]) ) { - self.locationDecimal = loc; - self.lengthDecimal = len; - } - return self; + return [self initWithLocation:[NSDecimalNumber decimalNumberWithDecimal:loc] + length:[NSDecimalNumber decimalNumberWithDecimal:len]]; } /// @name Initialization @@ -204,11 +230,15 @@ -(NSNumber *)location -(void)setLocationDecimal:(NSDecimal)newLocation { - if ( !CPTDecimalEquals(locationDecimal, newLocation) ) { + if ( !CPTDecimalEquals(locationDecimal, newLocation)) { locationDecimal = newLocation; if ( !self.inValueUpdate ) { - self.locationDouble = [NSDecimalNumber decimalNumberWithDecimal:newLocation].doubleValue; + self.inValueUpdate = YES; + + self.locationDouble = CPTDecimalDoubleValue(newLocation); + + self.inValueUpdate = NO; } } } @@ -219,7 +249,11 @@ -(void)setLocationDouble:(double)newLocation locationDouble = newLocation; if ( !self.inValueUpdate ) { - self.locationDecimal = @(newLocation).decimalValue; + self.inValueUpdate = YES; + + self.locationDecimal = CPTDecimalFromDouble(newLocation); + + self.inValueUpdate = NO; } } } @@ -231,11 +265,15 @@ -(NSNumber *)length -(void)setLengthDecimal:(NSDecimal)newLength { - if ( !CPTDecimalEquals(lengthDecimal, newLength) ) { + if ( !CPTDecimalEquals(lengthDecimal, newLength)) { lengthDecimal = newLength; if ( !self.inValueUpdate ) { - self.lengthDouble = [NSDecimalNumber decimalNumberWithDecimal:newLength].doubleValue; + self.inValueUpdate = YES; + + self.lengthDouble = CPTDecimalDoubleValue(newLength); + + self.inValueUpdate = NO; } } } @@ -245,8 +283,21 @@ -(void)setLengthDouble:(double)newLength if ( lengthDouble != newLength ) { lengthDouble = newLength; + if ( isnan(newLength)) { + self.isInfinite = NO; + self.lengthSign = CPTSignNone; + } + else { + self.isInfinite = (BOOL)isinf(newLength); + self.lengthSign = signbit(newLength) ? CPTSignNegative : CPTSignPositive; + } + if ( !self.inValueUpdate ) { - self.lengthDecimal = @(newLength).decimalValue; + self.inValueUpdate = YES; + + self.lengthDecimal = CPTDecimalFromDouble(newLength); + + self.inValueUpdate = NO; } } } @@ -276,7 +327,10 @@ -(NSDecimal)minLimitDecimal NSDecimal loc = self.locationDecimal; NSDecimal len = self.lengthDecimal; - if ( CPTDecimalLessThan( len, CPTDecimalFromInteger(0) ) ) { + if ( NSDecimalIsNotANumber(&len)) { + return loc; + } + else if ( CPTDecimalLessThan(len, CPTDecimalFromInteger(0))) { return CPTDecimalAdd(loc, len); } else { @@ -304,7 +358,7 @@ -(NSNumber *)midPoint -(NSDecimal)midPointDecimal { - return CPTDecimalAdd( self.locationDecimal, CPTDecimalDivide( self.lengthDecimal, CPTDecimalFromInteger(2) ) ); + return CPTDecimalAdd(self.locationDecimal, CPTDecimalDivide(self.lengthDecimal, CPTDecimalFromInteger(2))); } -(double)midPointDouble @@ -322,7 +376,10 @@ -(NSDecimal)maxLimitDecimal NSDecimal loc = self.locationDecimal; NSDecimal len = self.lengthDecimal; - if ( CPTDecimalGreaterThan( len, CPTDecimalFromInteger(0) ) ) { + if ( NSDecimalIsNotANumber(&len)) { + return loc; + } + else if ( CPTDecimalGreaterThan(len, CPTDecimalFromInteger(0))) { return CPTDecimalAdd(loc, len); } else { @@ -355,10 +412,15 @@ -(nonnull id)copyWithZone:(nullable NSZone *)zone CPTPlotRange *newRange = [[CPTPlotRange allocWithZone:zone] init]; if ( newRange ) { + newRange.inValueUpdate = YES; + newRange.locationDecimal = self.locationDecimal; - newRange.lengthDecimal = self.lengthDecimal; newRange.locationDouble = self.locationDouble; - newRange.lengthDouble = self.lengthDouble; + + newRange.lengthDecimal = self.lengthDecimal; + newRange.lengthDouble = self.lengthDouble; + + newRange.inValueUpdate = NO; } return newRange; } @@ -375,10 +437,15 @@ -(nonnull id)mutableCopyWithZone:(nullable NSZone *)zone CPTPlotRange *newRange = [[CPTMutablePlotRange allocWithZone:zone] init]; if ( newRange ) { + newRange.inValueUpdate = YES; + newRange.locationDecimal = self.locationDecimal; - newRange.lengthDecimal = self.lengthDecimal; newRange.locationDouble = self.locationDouble; - newRange.lengthDouble = self.lengthDouble; + + newRange.lengthDecimal = self.lengthDecimal; + newRange.lengthDouble = self.lengthDouble; + + newRange.inValueUpdate = NO; } return newRange; } @@ -394,6 +461,8 @@ -(void)encodeWithCoder:(nonnull NSCoder *)encoder { [encoder encodeDecimal:self.locationDecimal forKey:@"CPTPlotRange.location"]; [encoder encodeDecimal:self.lengthDecimal forKey:@"CPTPlotRange.length"]; + [encoder encodeBool:self.isInfinite forKey:@"CPTPlotRange.isInfinite"]; + [encoder encodeInteger:self.lengthSign forKey:@"CPTPlotRange.lengthSign"]; } /// @endcond @@ -404,14 +473,29 @@ -(void)encodeWithCoder:(nonnull NSCoder *)encoder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.locationDecimal = [decoder decodeDecimalForKey:@"CPTPlotRange.location"]; self.lengthDecimal = [decoder decodeDecimalForKey:@"CPTPlotRange.length"]; + + isInfinite = [decoder decodeBoolForKey:@"CPTPlotRange.isInfinite"]; + lengthSign = [decoder decodeIntegerForKey:@"CPTPlotRange.lengthSign"]; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Checking Containership @@ -421,7 +505,27 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder **/ -(BOOL)contains:(NSDecimal)number { - return CPTDecimalGreaterThanOrEqualTo(number, self.minLimitDecimal) && CPTDecimalLessThanOrEqualTo(number, self.maxLimitDecimal); + BOOL result = NO; + + if ( self.isInfinite ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + result = CPTDecimalGreaterThanOrEqualTo(number, self.minLimitDecimal); + break; + + case CPTSignNegative: + result = CPTDecimalLessThanOrEqualTo(number, self.maxLimitDecimal); + break; + + default: + break; + } + } + else { + result = CPTDecimalGreaterThanOrEqualTo(number, self.minLimitDecimal) && CPTDecimalLessThanOrEqualTo(number, self.maxLimitDecimal); + } + + return result; } /** @brief Determines whether a given number is inside the range. @@ -440,12 +544,10 @@ -(BOOL)containsDouble:(double)number -(BOOL)containsNumber:(nullable NSNumber *)number { if ( [number isKindOfClass:[NSDecimalNumber class]] ) { - NSDecimal numericValue = number.decimalValue; - return CPTDecimalGreaterThanOrEqualTo(numericValue, self.minLimitDecimal) && CPTDecimalLessThanOrEqualTo(numericValue, self.maxLimitDecimal); + return [self contains:number.decimalValue]; } else { - double numericValue = number.doubleValue; - return (numericValue >= self.minLimitDouble) && (numericValue <= self.maxLimitDouble); + return [self containsDouble:number.doubleValue]; } } @@ -456,7 +558,10 @@ -(BOOL)containsNumber:(nullable NSNumber *)number -(BOOL)isEqualToRange:(nullable CPTPlotRange *)otherRange { if ( otherRange ) { - return CPTDecimalEquals(self.locationDecimal, otherRange.locationDecimal) && CPTDecimalEquals(self.lengthDecimal, otherRange.lengthDecimal); + return CPTDecimalEquals(self.locationDecimal, otherRange.locationDecimal) && + CPTDecimalEquals(self.lengthDecimal, otherRange.lengthDecimal) && + (self.isInfinite == otherRange.isInfinite) && + (self.lengthSign == otherRange.lengthSign); } else { return NO; @@ -469,12 +574,31 @@ -(BOOL)isEqualToRange:(nullable CPTPlotRange *)otherRange **/ -(BOOL)containsRange:(nullable CPTPlotRange *)otherRange { + BOOL result = NO; + if ( otherRange ) { - return CPTDecimalGreaterThanOrEqualTo(otherRange.minLimitDecimal, self.minLimitDecimal) && CPTDecimalLessThanOrEqualTo(otherRange.maxLimitDecimal, self.maxLimitDecimal); - } - else { - return NO; + if ( self.isInfinite ) { + if ( !otherRange.isInfinite || (otherRange.lengthSign == self.lengthSign)) { + switch ( self.lengthSign ) { + case CPTSignPositive: + result = CPTDecimalGreaterThanOrEqualTo(otherRange.minLimitDecimal, self.minLimitDecimal); + break; + + case CPTSignNegative: + result = CPTDecimalLessThanOrEqualTo(otherRange.maxLimitDecimal, self.maxLimitDecimal); + break; + + default: + break; + } + } + } + else { + result = CPTDecimalGreaterThanOrEqualTo(otherRange.minLimitDecimal, self.minLimitDecimal) && CPTDecimalLessThanOrEqualTo(otherRange.maxLimitDecimal, self.maxLimitDecimal); + } } + + return result; } /** @brief Determines whether a given range intersects the receiver. @@ -483,19 +607,58 @@ -(BOOL)containsRange:(nullable CPTPlotRange *)otherRange **/ -(BOOL)intersectsRange:(nullable CPTPlotRange *)otherRange { - if ( !otherRange ) { - return NO; - } - - NSDecimal min1 = self.minLimitDecimal; - NSDecimal min2 = otherRange.minLimitDecimal; - NSDecimal minimum = CPTDecimalGreaterThan(min1, min2) ? min1 : min2; + BOOL result = NO; - NSDecimal max1 = self.maxLimitDecimal; - NSDecimal max2 = otherRange.maxLimitDecimal; - NSDecimal maximum = CPTDecimalLessThan(max1, max2) ? max1 : max2; + if ( otherRange ) { + if ( self.isInfinite ) { + if ( otherRange.isInfinite ) { + result = (otherRange.lengthSign == self.lengthSign); + } + if ( !result ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + result = CPTDecimalGreaterThanOrEqualTo(otherRange.maxLimitDecimal, self.minLimitDecimal); + break; + + case CPTSignNegative: + result = CPTDecimalLessThanOrEqualTo(otherRange.minLimitDecimal, self.maxLimitDecimal); + break; + + default: + break; + } + } + } + else { + if ( otherRange.isInfinite ) { + switch ( otherRange.lengthSign ) { + case CPTSignPositive: + result = CPTDecimalLessThanOrEqualTo(otherRange.minLimitDecimal, self.maxLimitDecimal); + break; + + case CPTSignNegative: + result = CPTDecimalLessThanOrEqualTo(otherRange.maxLimitDecimal, self.minLimitDecimal); + break; + + default: + break; + } + } + else { + NSDecimal min1 = self.minLimitDecimal; + NSDecimal min2 = otherRange.minLimitDecimal; + NSDecimal minimum = CPTDecimalMax(min1, min2); + + NSDecimal max1 = self.maxLimitDecimal; + NSDecimal max2 = otherRange.maxLimitDecimal; + NSDecimal maximum = CPTDecimalMin(max1, max2); + + result = CPTDecimalGreaterThanOrEqualTo(maximum, minimum); + } + } + } - return CPTDecimalGreaterThanOrEqualTo(maximum, minimum); + return result; } /** @brief Compares a number to the range, determining if it is in the range, or above or below it. @@ -523,10 +686,13 @@ -(CPTPlotRangeComparisonResult)compareToDecimal:(NSDecimal)number { CPTPlotRangeComparisonResult result; - if ( [self contains:number] ) { + if ( NSDecimalIsNotANumber(&number)) { + result = CPTPlotRangeComparisonResultNumberUndefined; + } + else if ( [self contains:number] ) { result = CPTPlotRangeComparisonResultNumberInRange; } - else if ( CPTDecimalLessThan(number, self.minLimitDecimal) ) { + else if ( CPTDecimalLessThan(number, self.minLimitDecimal)) { result = CPTPlotRangeComparisonResultNumberBelowRange; } else { @@ -543,7 +709,10 @@ -(CPTPlotRangeComparisonResult)compareToDouble:(double)number { CPTPlotRangeComparisonResult result; - if ( number < self.minLimitDouble ) { + if ( isnan(number)) { + result = CPTPlotRangeComparisonResultNumberUndefined; + } + else if ( number < self.minLimitDouble ) { result = CPTPlotRangeComparisonResultNumberBelowRange; } else if ( number > self.maxLimitDouble ) { @@ -596,7 +765,7 @@ -(nullable NSString *)description return [NSString stringWithFormat:@"<%@ {%@, %@}>", super.description, NSDecimalString(&myLocation, [NSLocale currentLocale]), - NSDecimalString(&myLength, [NSLocale currentLocale])]; + self.isInfinite ? (self.lengthSign == CPTSignPositive ? @"+INF" : @"-INF") : NSDecimalString(&myLength, [NSLocale currentLocale])]; } /// @endcond @@ -613,7 +782,7 @@ -(nullable id)debugQuickLookObject return [NSString stringWithFormat:@"Location: %@\nLength: %@", NSDecimalString(&myLocation, [NSLocale currentLocale]), - NSDecimalString(&myLength, [NSLocale currentLocale])]; + self.isInfinite ? (self.lengthSign == CPTSignPositive ? @"+INF" : @"-INF") : NSDecimalString(&myLength, [NSLocale currentLocale])]; } /// @endcond diff --git a/framework/Source/CPTPlotRangeTests.m b/framework/Source/CPTPlotRangeTests.m index 304405f39..c5cfeabd0 100644 --- a/framework/Source/CPTPlotRangeTests.m +++ b/framework/Source/CPTPlotRangeTests.m @@ -37,6 +37,17 @@ -(void)testContains XCTAssertFalse([self.plotRange contains:CPTDecimalFromDouble(3.001)], @"Test contains:3.001"); } +-(void)testContainsInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + XCTAssertFalse([self.plotRange contains:CPTDecimalFromDouble(0.999)], @"Test contains:0.999"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(1.0)], @"Test contains:1.0"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(2.0)], @"Test contains:2.0"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(3.0)], @"Test contains:3.0"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(3.001)], @"Test contains:3.001"); +} + -(void)testContainsNegative { self.plotRange.lengthDouble = -2.0; @@ -48,6 +59,17 @@ -(void)testContainsNegative XCTAssertFalse([self.plotRange contains:CPTDecimalFromDouble(1.001)], @"Test contains:1.001"); } +-(void)testContainsNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(-1.001)], @"Test contains:-1.001"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(-1.0)], @"Test contains:-1.0"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(0.0)], @"Test contains:0.0"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(1.0)], @"Test contains:1.0"); + XCTAssertFalse([self.plotRange contains:CPTDecimalFromDouble(1.001)], @"Test contains:1.001"); +} + -(void)testContainsDouble { XCTAssertFalse([self.plotRange containsDouble:0.999], @"Test contains:0.999"); @@ -57,6 +79,17 @@ -(void)testContainsDouble XCTAssertFalse([self.plotRange containsDouble:3.001], @"Test contains:3.001"); } +-(void)testContainsDoubleInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + XCTAssertFalse([self.plotRange containsDouble:0.999], @"Test contains:0.999"); + XCTAssertTrue([self.plotRange containsDouble:1.0], @"Test contains:1.0"); + XCTAssertTrue([self.plotRange containsDouble:2.0], @"Test contains:2.0"); + XCTAssertTrue([self.plotRange containsDouble:3.0], @"Test contains:3.0"); + XCTAssertTrue([self.plotRange containsDouble:3.001], @"Test contains:3.001"); +} + -(void)testContainsNumber { XCTAssertFalse([self.plotRange containsNumber:@(0.999)], @"Test contains:0.999"); @@ -66,6 +99,17 @@ -(void)testContainsNumber XCTAssertFalse([self.plotRange containsNumber:@(3.001)], @"Test contains:3.001"); } +-(void)testContainsNumberInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + XCTAssertFalse([self.plotRange containsNumber:@(0.999)], @"Test contains:0.999"); + XCTAssertTrue([self.plotRange containsNumber:[NSDecimalNumber one]], @"Test contains:1.0"); + XCTAssertTrue([self.plotRange containsNumber:@(2.0)], @"Test contains:2.0"); + XCTAssertTrue([self.plotRange containsNumber:@(3.0)], @"Test contains:3.0"); + XCTAssertTrue([self.plotRange containsNumber:@(3.001)], @"Test contains:3.001"); +} + -(void)testContainsDoubleNegative { self.plotRange.lengthDouble = -2.0; @@ -77,6 +121,17 @@ -(void)testContainsDoubleNegative XCTAssertFalse([self.plotRange containsDouble:1.001], @"Test contains:1.001"); } +-(void)testContainsDoubleNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + XCTAssertTrue([self.plotRange containsDouble:-1.001], @"Test contains:-1.001"); + XCTAssertTrue([self.plotRange containsDouble:-1.0], @"Test contains:-1.0"); + XCTAssertTrue([self.plotRange containsDouble:0.0], @"Test contains:0.0"); + XCTAssertTrue([self.plotRange containsDouble:1.0], @"Test contains:1.0"); + XCTAssertFalse([self.plotRange containsDouble:1.001], @"Test contains:1.001"); +} + -(void)testContainsRange { CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; @@ -96,6 +151,48 @@ -(void)testContainsRange XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); } +-(void)testContainsRangeInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; + + XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@2.0]; + XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@1.0]; + XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@4.0]; + XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@2.0]; + XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); +} + +-(void)testContainsRangeNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; + + XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@(-2.0)]; + XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@(-1.0)]; + XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@4.0]; + XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(-2.0)]; + XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); +} + #pragma mark - #pragma mark Union @@ -120,6 +217,32 @@ -(void)testUnionRange [self checkRangeWithLocation:-5.0 length:12.0]; } +-(void)testUnionRangeInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]]; + [self checkRangeWithLocation:0.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]]; + [self checkRangeWithLocation:-1.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]]; + [self checkRangeWithLocation:-1.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]]; + [self checkRangeWithLocation:-4.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@(-4.0)]]; + [self checkRangeWithLocation:-5.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(HUGE_VAL)]]; + [self checkRangeWithLocation:-5.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(-HUGE_VAL)]]; + [self checkRangeWithLocation:-HUGE_VAL length:HUGE_VAL]; +} + -(void)testUnionRangeNegative { self.plotRange.lengthDouble = -2.0; @@ -143,6 +266,32 @@ -(void)testUnionRangeNegative [self checkRangeWithLocation:7.0 length:-12.0]; } +-(void)testUnionRangeNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]]; + [self checkRangeWithLocation:4.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]]; + [self checkRangeWithLocation:4.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]]; + [self checkRangeWithLocation:7.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]]; + [self checkRangeWithLocation:7.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@(-4.0)]]; + [self checkRangeWithLocation:7.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@10.0 length:@(-HUGE_VAL)]]; + [self checkRangeWithLocation:10.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(HUGE_VAL)]]; + [self checkRangeWithLocation:-HUGE_VAL length:HUGE_VAL]; +} + #pragma mark - #pragma mark Intersection @@ -162,7 +311,7 @@ -(void)testIntersectRange otherRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]; XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; - [self checkRangeWithLocation:1.0 length:0.0]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; } -(void)testIntersectRange2 @@ -181,7 +330,7 @@ -(void)testIntersectRange2 otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]; XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; - [self checkRangeWithLocation:1.0 length:0.0]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; } -(void)testIntersectRangeNegative @@ -201,7 +350,7 @@ -(void)testIntersectRangeNegative otherRange = [CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]; XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; - [self checkRangeWithLocation:1.0 length:0.0]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; } -(void)testIntersectRangeNegative2 @@ -221,7 +370,67 @@ -(void)testIntersectRangeNegative2 otherRange = [CPTPlotRange plotRangeWithLocation:@5.0 length:@(-4.0)]; XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; - [self checkRangeWithLocation:0.0 length:0.0]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; +} + +-(void)testIntersectRangeInfinite1 +{ + self.plotRange.lengthDouble = HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; + XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:1.0 length:3.0]; +} + +-(void)testIntersectRangeInfinite2 +{ + self.plotRange.lengthDouble = HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(HUGE_VAL)]; + XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:1.0 length:HUGE_VAL]; +} + +-(void)testIntersectRangeInfinite3 +{ + self.plotRange.lengthDouble = HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]; + XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; +} + +-(void)testIntersectRangeNegativeInfinite1 +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; + XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:1.0 length:-1.0]; +} + +-(void)testIntersectRangeNegativeInfinite2 +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(-HUGE_VAL)]; + XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:0.0 length:-HUGE_VAL]; +} + +-(void)testIntersectRangeNegativeInfinite3 +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@10.0 length:@(-4.0)]; + XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; } #pragma mark - @@ -370,6 +579,19 @@ -(void)testCompareToDecimal XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(2.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:2.0"); XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(3.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.0"); XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(3.001)], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:3.001"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalNaN()], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); +} + +-(void)testCompareToDecimalInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(0.999)], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:0.999"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(1.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(2.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:2.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(3.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(3.001)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.001"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalNaN()], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); } -(void)testCompareToDecimalNegative @@ -381,6 +603,19 @@ -(void)testCompareToDecimalNegative XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(0.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:0.0"); XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(1.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(1.001)], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:1.001"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalNaN()], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); +} + +-(void)testCompareToDecimalNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(-1.001)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-1.001"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(-1.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-1.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(0.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:0.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(1.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(1.001)], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:1.001"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalNaN()], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); } -(void)testCompareToDouble @@ -390,6 +625,23 @@ -(void)testCompareToDouble XCTAssertEqual([self.plotRange compareToDouble:2.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:2.0"); XCTAssertEqual([self.plotRange compareToDouble:3.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.0"); XCTAssertEqual([self.plotRange compareToDouble:3.001], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:3.001"); + XCTAssertEqual([self.plotRange compareToDouble:HUGE_VAL], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:+INF"); + XCTAssertEqual([self.plotRange compareToDouble:-HUGE_VAL], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:-INF"); + XCTAssertEqual([self.plotRange compareToDouble:(double)NAN], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); +} + +-(void)testCompareToDoubleInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + XCTAssertEqual([self.plotRange compareToDouble:0.999], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:0.999"); + XCTAssertEqual([self.plotRange compareToDouble:1.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); + XCTAssertEqual([self.plotRange compareToDouble:2.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:2.0"); + XCTAssertEqual([self.plotRange compareToDouble:3.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.0"); + XCTAssertEqual([self.plotRange compareToDouble:3.001], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.001"); + XCTAssertEqual([self.plotRange compareToDouble:HUGE_VAL], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:+INF"); + XCTAssertEqual([self.plotRange compareToDouble:-HUGE_VAL], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:-INF"); + XCTAssertEqual([self.plotRange compareToDouble:(double)NAN], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); } -(void)testCompareToDoubleNegative @@ -401,6 +653,23 @@ -(void)testCompareToDoubleNegative XCTAssertEqual([self.plotRange compareToDouble:0.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:0.0"); XCTAssertEqual([self.plotRange compareToDouble:1.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); XCTAssertEqual([self.plotRange compareToDouble:1.001], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:1.001"); + XCTAssertEqual([self.plotRange compareToDouble:HUGE_VAL], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:+INF"); + XCTAssertEqual([self.plotRange compareToDouble:-HUGE_VAL], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:-INF"); + XCTAssertEqual([self.plotRange compareToDouble:(double)NAN], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); +} + +-(void)testCompareToDoubleNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + XCTAssertEqual([self.plotRange compareToDouble:-1.001], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-1.001"); + XCTAssertEqual([self.plotRange compareToDouble:-1.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-1.0"); + XCTAssertEqual([self.plotRange compareToDouble:0.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:0.0"); + XCTAssertEqual([self.plotRange compareToDouble:1.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); + XCTAssertEqual([self.plotRange compareToDouble:1.001], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:1.001"); + XCTAssertEqual([self.plotRange compareToDouble:HUGE_VAL], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:+INF"); + XCTAssertEqual([self.plotRange compareToDouble:-HUGE_VAL], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-INF"); + XCTAssertEqual([self.plotRange compareToDouble:(double)NAN], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); } #pragma mark - @@ -408,7 +677,7 @@ -(void)testCompareToDoubleNegative -(void)testKeyedArchivingRoundTrip { - CPTPlotRange *newRange = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:self.plotRange]]; + CPTPlotRange *newRange = [self archiveRoundTrip:self.plotRange]; XCTAssertTrue([self.plotRange isEqualToRange:newRange], @"Ranges equal"); } @@ -423,11 +692,11 @@ -(void)checkRangeWithLocation:(double)loc length:(double)len NSDecimal newLocation = self.plotRange.locationDecimal; errMessage = [NSString stringWithFormat:@"expected location = %g, was %@", loc, NSDecimalString(&newLocation, nil)]; - XCTAssertTrue(CPTDecimalEquals( newLocation, CPTDecimalFromDouble(loc) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(newLocation, CPTDecimalFromDouble(loc)), @"%@", errMessage); NSDecimal newLength = self.plotRange.lengthDecimal; errMessage = [NSString stringWithFormat:@"expected location = %g, was %@", loc, NSDecimalString(&newLength, nil)]; - XCTAssertTrue(CPTDecimalEquals( newLength, CPTDecimalFromDouble(len) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(newLength, CPTDecimalFromDouble(len)), @"%@", errMessage); } @end diff --git a/framework/Source/CPTPlotSpace.h b/framework/Source/CPTPlotSpace.h index 203f06a4b..902817b73 100644 --- a/framework/Source/CPTPlotSpace.h +++ b/framework/Source/CPTPlotSpace.h @@ -7,6 +7,16 @@ @class CPTGraph; @class CPTPlotSpace; +/** + * @brief Plot space mapping notification type. + **/ +typedef NSString *CPTPlotSpaceCoordinateMapping cpt_swift_struct; + +/** + * @brief The userInfo dictionary keys used by #CPTPlotSpaceCoordinateMappingDidChangeNotification notifications. + **/ +typedef NSString *CPTPlotSpaceInfoKey cpt_swift_struct; + /// @name Plot Space /// @{ @@ -16,32 +26,32 @@ * the plot space coordinate system and drawing coordinates changes. * @ingroup notification **/ -extern NSString *__nonnull const CPTPlotSpaceCoordinateMappingDidChangeNotification; +extern CPTPlotSpaceCoordinateMapping __nonnull const CPTPlotSpaceCoordinateMappingDidChangeNotification; -/** @brief The userInfo dictionary key used by the CPTPlotSpaceCoordinateMappingDidChangeNotification +/** @brief The userInfo dictionary key used by the #CPTPlotSpaceCoordinateMappingDidChangeNotification * to indicate the plot coordinate affected by the mapping change. * * The value associated with this key is the CPTCoordinate affected by the change wrapped in an instance of NSNumber. * @ingroup notification **/ -extern NSString *__nonnull const CPTPlotSpaceCoordinateKey; +extern CPTPlotSpaceInfoKey __nonnull const CPTPlotSpaceCoordinateKey; -/** @brief The userInfo dictionary key used by the CPTPlotSpaceCoordinateMappingDidChangeNotification +/** @brief The userInfo dictionary key used by the #CPTPlotSpaceCoordinateMappingDidChangeNotification * to indicate whether the mapping change is a scroll movement or other change. * * The value associated with this key is a boolean value wrapped in an instance of NSNumber. The value * is @YES if the plot space change represents a horizontal or vertical translation, @NO otherwise. * @ingroup notification **/ -extern NSString *__nonnull const CPTPlotSpaceScrollingKey; +extern CPTPlotSpaceInfoKey __nonnull const CPTPlotSpaceScrollingKey; -/** @brief The userInfo dictionary key used by the CPTPlotSpaceCoordinateMappingDidChangeNotification +/** @brief The userInfo dictionary key used by the #CPTPlotSpaceCoordinateMappingDidChangeNotification * to indicate the displacement offset for scrolling changes in drawing coordinates. * * The value associated with this key is the displacement offset wrapped in an instance of NSNumber. * @ingroup notification **/ -extern NSString *__nonnull const CPTPlotSpaceDisplacementKey; +extern CPTPlotSpaceInfoKey __nonnull const CPTPlotSpaceDisplacementKey; /// @} @@ -135,7 +145,7 @@ extern NSString *__nonnull const CPTPlotSpaceDisplacementKey; **/ -(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)point; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else /** @brief @optional Notifies that plot space intercepted a scroll wheel event. @@ -156,22 +166,22 @@ extern NSString *__nonnull const CPTPlotSpaceDisplacementKey; /** * @brief An array of plot spaces. **/ -typedef NSArray<__kindof CPTPlotSpace *> *CPTPlotSpaceArray; +typedef NSArray<__kindof CPTPlotSpace *> CPTPlotSpaceArray; /** * @brief A mutable array of plot spaces. **/ -typedef NSMutableArray<__kindof CPTPlotSpace *> *CPTMutablePlotSpaceArray; +typedef NSMutableArray<__kindof CPTPlotSpace *> CPTMutablePlotSpaceArray; #pragma mark - -@interface CPTPlotSpace : NSObject +@interface CPTPlotSpace : NSObject @property (nonatomic, readwrite, copy, nullable) id identifier; @property (nonatomic, readwrite) BOOL allowsUserInteraction; @property (nonatomic, readonly) BOOL isDragging; -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTGraph *graph; -@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak id delegate; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGraph *graph; +@property (nonatomic, readwrite, cpt_weak_property, nullable) id delegate; @property (nonatomic, readonly) NSUInteger numberOfCoordinates; @@ -180,10 +190,10 @@ typedef NSMutableArray<__kindof CPTPlotSpace *> *CPTMutablePlotSpaceArray; -(void)addCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate; -(void)removeCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate; -(void)insertCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx; --(void)setCategories:(nullable CPTStringArray)newCategories forCoordinate:(CPTCoordinate)coordinate; +-(void)setCategories:(nullable CPTStringArray *)newCategories forCoordinate:(CPTCoordinate)coordinate; -(void)removeAllCategories; --(nonnull CPTStringArray)categoriesForCoordinate:(CPTCoordinate)coordinate; +-(nonnull CPTStringArray *)categoriesForCoordinate:(CPTCoordinate)coordinate; -(nullable NSString *)categoryForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx; -(NSUInteger)indexOfCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate; /// @} @@ -205,17 +215,17 @@ typedef NSMutableArray<__kindof CPTPlotSpace *> *CPTMutablePlotSpaceArray; /// @name Coordinate Space Conversions /// @{ --(CGPoint)plotAreaViewPointForPlotPoint:(nonnull CPTNumberArray)plotPoint; +-(CGPoint)plotAreaViewPointForPlotPoint:(nonnull CPTNumberArray *)plotPoint; -(CGPoint)plotAreaViewPointForPlotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count; -(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count; --(nullable CPTNumberArray)plotPointForPlotAreaViewPoint:(CGPoint)point; +-(nullable CPTNumberArray *)plotPointForPlotAreaViewPoint:(CGPoint)point; -(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point; -(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point; -(CGPoint)plotAreaViewPointForEvent:(nonnull CPTNativeEvent *)event; --(nullable CPTNumberArray)plotPointForEvent:(nonnull CPTNativeEvent *)event; +-(nullable CPTNumberArray *)plotPointForEvent:(nonnull CPTNativeEvent *)event; -(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(nonnull CPTNativeEvent *)event; -(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(nonnull CPTNativeEvent *)event; /// @} @@ -234,8 +244,10 @@ typedef NSMutableArray<__kindof CPTPlotSpace *> *CPTMutablePlotSpaceArray; /// @name Adjusting Ranges /// @{ --(void)scaleToFitPlots:(nullable CPTPlotArray)plots; --(void)scaleToFitPlots:(nullable CPTPlotArray)plots forCoordinate:(CPTCoordinate)coordinate; +-(void)scaleToFitPlots:(nullable CPTPlotArray *)plots; +-(void)scaleToFitPlots:(nullable CPTPlotArray *)plots forCoordinate:(CPTCoordinate)coordinate; +-(void)scaleToFitEntirePlots:(nullable CPTPlotArray *)plots; +-(void)scaleToFitEntirePlots:(nullable CPTPlotArray *)plots forCoordinate:(CPTCoordinate)coordinate; -(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint; /// @} diff --git a/framework/Source/CPTPlotSpace.m b/framework/Source/CPTPlotSpace.m index eadc53d9a..644b1df79 100644 --- a/framework/Source/CPTPlotSpace.m +++ b/framework/Source/CPTPlotSpace.m @@ -1,25 +1,26 @@ #import "CPTPlotSpace.h" +#import "CPTGraph.h" #import "CPTMutablePlotRange.h" #import "CPTUtilities.h" -NSString *const CPTPlotSpaceCoordinateMappingDidChangeNotification = @"CPTPlotSpaceCoordinateMappingDidChangeNotification"; +CPTPlotSpaceCoordinateMapping const CPTPlotSpaceCoordinateMappingDidChangeNotification = @"CPTPlotSpaceCoordinateMappingDidChangeNotification"; -NSString *const CPTPlotSpaceCoordinateKey = @"CPTPlotSpaceCoordinateKey"; -NSString *const CPTPlotSpaceScrollingKey = @"CPTPlotSpaceScrollingKey"; -NSString *const CPTPlotSpaceDisplacementKey = @"CPTPlotSpaceDisplacementKey"; +CPTPlotSpaceInfoKey const CPTPlotSpaceCoordinateKey = @"CPTPlotSpaceCoordinateKey"; +CPTPlotSpaceInfoKey const CPTPlotSpaceScrollingKey = @"CPTPlotSpaceScrollingKey"; +CPTPlotSpaceInfoKey const CPTPlotSpaceDisplacementKey = @"CPTPlotSpaceDisplacementKey"; /// @cond -typedef NSMutableOrderedSet *CPTMutableCategorySet; +typedef NSMutableOrderedSet CPTMutableCategorySet; @interface CPTPlotSpace() -@property (nonatomic, readwrite, strong, nullable) NSMutableDictionary *categoryNames; +@property (nonatomic, readwrite, strong, nullable) NSMutableDictionary *categoryNames; @property (nonatomic, readwrite) BOOL isDragging; --(nonnull CPTMutableCategorySet)orderedSetForCoordinate:(CPTCoordinate)coordinate; +-(nonnull CPTMutableCategorySet *)orderedSetForCoordinate:(CPTCoordinate)coordinate; @end @@ -50,12 +51,12 @@ @implementation CPTPlotSpace **/ @synthesize isDragging; -/** @property nullable cpt_weak CPTGraph *graph +/** @property nullable CPTGraph *graph * @brief The graph of the space. **/ @synthesize graph; -/** @property nullable cpt_weak id delegate +/** @property nullable id delegate * @brief The plot space delegate. **/ @synthesize delegate; @@ -91,7 +92,7 @@ @implementation CPTPlotSpace **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { identifier = nil; allowsUserInteraction = NO; isDragging = NO; @@ -142,18 +143,34 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - graph = [coder decodeObjectForKey:@"CPTPlotSpace.graph"]; - identifier = [[coder decodeObjectForKey:@"CPTPlotSpace.identifier"] copy]; - delegate = [coder decodeObjectForKey:@"CPTPlotSpace.delegate"]; + if ((self = [super init])) { + graph = [coder decodeObjectOfClass:[CPTGraph class] + forKey:@"CPTPlotSpace.graph"]; + identifier = [[coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTPlotSpace.identifier"] copy]; + delegate = [coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTPlotSpace.delegate"]; allowsUserInteraction = [coder decodeBoolForKey:@"CPTPlotSpace.allowsUserInteraction"]; - categoryNames = [[coder decodeObjectForKey:@"CPTPlotSpace.categoryNames"] mutableCopy]; + categoryNames = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class], [NSNumber class]]] + forKey:@"CPTPlotSpace.categoryNames"] mutableCopy]; isDragging = NO; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Categorical Data @@ -164,9 +181,9 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder * @param coordinate The axis coordinate. * @return The ordered set of categories for the given coordinate. */ --(nonnull CPTMutableCategorySet)orderedSetForCoordinate:(CPTCoordinate)coordinate +-(nonnull CPTMutableCategorySet *)orderedSetForCoordinate:(CPTCoordinate)coordinate { - NSMutableDictionary *names = self.categoryNames; + NSMutableDictionary *names = self.categoryNames; if ( !names ) { names = [[NSMutableDictionary alloc] init]; @@ -176,7 +193,7 @@ -(nonnull CPTMutableCategorySet)orderedSetForCoordinate:(CPTCoordinate)coordinat NSNumber *cacheKey = @(coordinate); - CPTMutableCategorySet categories = names[cacheKey]; + CPTMutableCategorySet *categories = names[cacheKey]; if ( !categories ) { categories = [[NSMutableOrderedSet alloc] init]; @@ -201,7 +218,7 @@ -(void)addCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coo { NSParameterAssert(category); - CPTMutableCategorySet categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; [categories addObject:category]; } @@ -215,7 +232,7 @@ -(void)removeCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate) { NSParameterAssert(category); - CPTMutableCategorySet categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; [categories removeObject:category]; } @@ -233,7 +250,7 @@ -(void)insertCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate) { NSParameterAssert(category); - CPTMutableCategorySet categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; NSParameterAssert(idx <= categories.count); @@ -245,9 +262,9 @@ -(void)insertCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate) * @param newCategories An array of category names. * @param coordinate The axis coordinate. */ --(void)setCategories:(nullable CPTStringArray)newCategories forCoordinate:(CPTCoordinate)coordinate +-(void)setCategories:(nullable CPTStringArray *)newCategories forCoordinate:(CPTCoordinate)coordinate { - NSMutableDictionary *names = self.categoryNames; + NSMutableDictionary *names = self.categoryNames; if ( !names ) { names = [[NSMutableDictionary alloc] init]; @@ -258,7 +275,7 @@ -(void)setCategories:(nullable CPTStringArray)newCategories forCoordinate:(CPTCo NSNumber *cacheKey = @(coordinate); if ( [newCategories isKindOfClass:[NSArray class]] ) { - CPTStringArray categories = newCategories; + CPTStringArray *categories = newCategories; names[cacheKey] = [NSMutableOrderedSet orderedSetWithArray:categories]; } @@ -280,9 +297,9 @@ -(void)removeAllCategories * @param coordinate The axis coordinate. * @return An array of category names. */ --(nonnull CPTStringArray)categoriesForCoordinate:(CPTCoordinate)coordinate +-(nonnull CPTStringArray *)categoriesForCoordinate:(CPTCoordinate)coordinate { - CPTMutableCategorySet categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; return categories.array; } @@ -295,7 +312,7 @@ -(nonnull CPTStringArray)categoriesForCoordinate:(CPTCoordinate)coordinate */ -(nullable NSString *)categoryForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx { - CPTMutableCategorySet categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; NSParameterAssert(idx < categories.count); @@ -312,7 +329,7 @@ -(NSUInteger)indexOfCategory:(nonnull NSString *)category forCoordinate:(CPTCoor { NSParameterAssert(category); - CPTMutableCategorySet categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; return [categories indexOfObject:category]; } @@ -435,7 +452,7 @@ -(BOOL)pointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event return handledByDelegate; } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else /** @@ -464,6 +481,7 @@ -(BOOL)scrollWheelEvent:(nonnull CPTNativeEvent *)event fromPoint:(CGPoint)fromP } return handledByDelegate; } + #endif /// @} @@ -487,7 +505,7 @@ -(NSUInteger)numberOfCoordinates * @param plotPoint An array of data point coordinates (as NSNumber values). * @return The drawing coordinates of the data point. **/ --(CGPoint)plotAreaViewPointForPlotPoint:(nonnull CPTNumberArray)plotPoint +-(CGPoint)plotAreaViewPointForPlotPoint:(nonnull CPTNumberArray *cpt_unused)plotPoint { NSParameterAssert(plotPoint.count == self.numberOfCoordinates); @@ -499,7 +517,7 @@ -(CGPoint)plotAreaViewPointForPlotPoint:(nonnull CPTNumberArray)plotPoint * @param count The number of coordinate values in the @par{plotPoint} array. * @return The drawing coordinates of the data point. **/ --(CGPoint)plotAreaViewPointForPlotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count +-(CGPoint)plotAreaViewPointForPlotPoint:(nonnull NSDecimal *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count { NSParameterAssert(count == self.numberOfCoordinates); @@ -511,7 +529,7 @@ -(CGPoint)plotAreaViewPointForPlotPoint:(nonnull NSDecimal *)plotPoint numberOfC * @param count The number of coordinate values in the @par{plotPoint} array. * @return The drawing coordinates of the data point. **/ --(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count +-(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(nonnull double *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count { NSParameterAssert(count == self.numberOfCoordinates); @@ -522,7 +540,7 @@ -(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(nonnull double *)plotPoi * @param point The drawing coordinates of the data point. * @return An array of data point coordinates (as NSNumber values). **/ --(nullable CPTNumberArray)plotPointForPlotAreaViewPoint:(CGPoint)point +-(nullable CPTNumberArray *)plotPointForPlotAreaViewPoint:(CGPoint __unused)point { return nil; } @@ -532,7 +550,7 @@ -(nullable CPTNumberArray)plotPointForPlotAreaViewPoint:(CGPoint)point * @param count The number of coordinate values in the @par{plotPoint} array. * @param point The drawing coordinates of the data point. **/ --(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point +-(void)plotPoint:(nonnull NSDecimal *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count forPlotAreaViewPoint:(CGPoint __unused)point { NSParameterAssert(count == self.numberOfCoordinates); } @@ -542,7 +560,7 @@ -(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger) * @param count The number of coordinate values in the @par{plotPoint} array. * @param point The drawing coordinates of the data point. **/ --(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point +-(void)doublePrecisionPlotPoint:(nonnull double *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count forPlotAreaViewPoint:(CGPoint __unused)point { NSParameterAssert(count == self.numberOfCoordinates); } @@ -551,7 +569,7 @@ -(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates: * @param event The event. * @return The drawing coordinates of the point. **/ --(CGPoint)plotAreaViewPointForEvent:(nonnull CPTNativeEvent *)event +-(CGPoint)plotAreaViewPointForEvent:(nonnull CPTNativeEvent *__unused)event { return CGPointZero; } @@ -560,7 +578,7 @@ -(CGPoint)plotAreaViewPointForEvent:(nonnull CPTNativeEvent *)event * @param event The event. * @return An array of data point coordinates (as NSNumber values). **/ --(nullable CPTNumberArray)plotPointForEvent:(nonnull CPTNativeEvent *)event +-(nullable CPTNumberArray *)plotPointForEvent:(nonnull CPTNativeEvent *__unused)event { return nil; } @@ -570,7 +588,7 @@ -(nullable CPTNumberArray)plotPointForEvent:(nonnull CPTNativeEvent *)event * @param count The number of coordinate values in the @par{plotPoint} array. * @param event The event. **/ --(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(nonnull CPTNativeEvent *)event +-(void)plotPoint:(nonnull NSDecimal *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count forEvent:(nonnull CPTNativeEvent *__unused)event { NSParameterAssert(count == self.numberOfCoordinates); } @@ -580,7 +598,7 @@ -(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger) * @param count The number of coordinate values in the @par{plotPoint} array. * @param event The event. **/ --(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(nonnull CPTNativeEvent *)event +-(void)doublePrecisionPlotPoint:(nonnull double *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count forEvent:(nonnull CPTNativeEvent *__unused)event { NSParameterAssert(count == self.numberOfCoordinates); } @@ -589,7 +607,7 @@ -(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates: * @param newRange The new plot range. * @param coordinate The axis coordinate. **/ --(void)setPlotRange:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate +-(void)setPlotRange:(nonnull CPTPlotRange *__unused)newRange forCoordinate:(CPTCoordinate __unused)coordinate { } @@ -597,7 +615,7 @@ -(void)setPlotRange:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinat * @param coordinate The axis coordinate. * @return The range of values. **/ --(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coordinate +-(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate __unused)coordinate { return nil; } @@ -606,7 +624,7 @@ -(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coordinate * @param newType The new scale type. * @param coordinate The axis coordinate. **/ --(void)setScaleType:(CPTScaleType)newType forCoordinate:(CPTCoordinate)coordinate +-(void)setScaleType:(CPTScaleType __unused)newType forCoordinate:(CPTCoordinate __unused)coordinate { } @@ -614,7 +632,7 @@ -(void)setScaleType:(CPTScaleType)newType forCoordinate:(CPTCoordinate)coordinat * @param coordinate The axis coordinate. * @return The scale type. **/ --(CPTScaleType)scaleTypeForCoordinate:(CPTCoordinate)coordinate +-(CPTScaleType)scaleTypeForCoordinate:(CPTCoordinate __unused)coordinate { return CPTScaleTypeLinear; } @@ -622,7 +640,43 @@ -(CPTScaleType)scaleTypeForCoordinate:(CPTCoordinate)coordinate /** @brief Scales the plot ranges so that the plots just fit in the visible space. * @param plots An array of the plots that have to fit in the visible area. **/ --(void)scaleToFitPlots:(nullable CPTPlotArray)plots +-(void)scaleToFitPlots:(nullable CPTPlotArray *__unused)plots +{ +} + +/** @brief Scales the plot range for the given coordinate so that the plots just fit in the visible space. + * @param plots An array of the plots that have to fit in the visible area. + * @param coordinate The axis coordinate. + **/ +-(void)scaleToFitPlots:(nullable CPTPlotArray *)plots forCoordinate:(CPTCoordinate)coordinate +{ + if ( plots.count == 0 ) { + return; + } + + // Determine union of ranges + CPTMutablePlotRange *unionRange = nil; + for ( CPTPlot *plot in plots ) { + CPTPlotRange *currentRange = [plot plotRangeForCoordinate:coordinate]; + if ( !unionRange ) { + unionRange = [currentRange mutableCopy]; + } + [unionRange unionPlotRange:currentRange]; + } + + // Set range + if ( unionRange ) { + if ( CPTDecimalEquals(unionRange.lengthDecimal, CPTDecimalFromInteger(0))) { + [unionRange unionPlotRange:[self plotRangeForCoordinate:coordinate]]; + } + [self setPlotRange:unionRange forCoordinate:coordinate]; + } +} + +/** @brief Scales the plot ranges so that the plots just fit in the visible space. + * @param plots An array of the plots that have to fit in the visible area. + **/ +-(void)scaleToFitEntirePlots:(nullable CPTPlotArray *__unused)plots { } @@ -630,7 +684,7 @@ -(void)scaleToFitPlots:(nullable CPTPlotArray)plots * @param plots An array of the plots that have to fit in the visible area. * @param coordinate The axis coordinate. **/ --(void)scaleToFitPlots:(nullable CPTPlotArray)plots forCoordinate:(CPTCoordinate)coordinate +-(void)scaleToFitEntirePlots:(nullable CPTPlotArray *)plots forCoordinate:(CPTCoordinate)coordinate { if ( plots.count == 0 ) { return; @@ -648,7 +702,7 @@ -(void)scaleToFitPlots:(nullable CPTPlotArray)plots forCoordinate:(CPTCoordinate // Set range if ( unionRange ) { - if ( CPTDecimalEquals( unionRange.lengthDecimal, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalEquals(unionRange.lengthDecimal, CPTDecimalFromInteger(0))) { [unionRange unionPlotRange:[self plotRangeForCoordinate:coordinate]]; } [self setPlotRange:unionRange forCoordinate:coordinate]; @@ -659,7 +713,7 @@ -(void)scaleToFitPlots:(nullable CPTPlotArray)plots forCoordinate:(CPTCoordinate * @param interactionScale The scaling factor. One (@num{1}) gives no scaling. * @param interactionPoint The plot area view point about which the scaling occurs. **/ --(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint +-(void)scaleBy:(CGFloat __unused)interactionScale aboutPoint:(CGPoint __unused)interactionPoint { } diff --git a/framework/Source/CPTPlotSpaceAnnotation.h b/framework/Source/CPTPlotSpaceAnnotation.h index b3540af5a..e81554e07 100644 --- a/framework/Source/CPTPlotSpaceAnnotation.h +++ b/framework/Source/CPTPlotSpaceAnnotation.h @@ -4,12 +4,12 @@ @interface CPTPlotSpaceAnnotation : CPTAnnotation -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray anchorPlotPoint; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *anchorPlotPoint; @property (nonatomic, readonly, nonnull) CPTPlotSpace *plotSpace; /// @name Initialization /// @{ --(nonnull instancetype)initWithPlotSpace:(nonnull CPTPlotSpace *)space anchorPlotPoint:(nullable CPTNumberArray)plotPoint NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithPlotSpace:(nonnull CPTPlotSpace *)space anchorPlotPoint:(nullable CPTNumberArray *)plotPoint NS_DESIGNATED_INITIALIZER; -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; /// @} diff --git a/framework/Source/CPTPlotSpaceAnnotation.m b/framework/Source/CPTPlotSpaceAnnotation.m index 965cd3956..db08c4303 100644 --- a/framework/Source/CPTPlotSpaceAnnotation.m +++ b/framework/Source/CPTPlotSpaceAnnotation.m @@ -28,7 +28,7 @@ -(void)setContentNeedsLayout; **/ @implementation CPTPlotSpaceAnnotation -/** @property nullable CPTNumberArray anchorPlotPoint +/** @property nullable CPTNumberArray *anchorPlotPoint * @brief An array of NSDecimalNumber objects giving the anchor plot coordinates. **/ @synthesize anchorPlotPoint; @@ -56,11 +56,11 @@ @implementation CPTPlotSpaceAnnotation * @param newPlotPoint An array of NSDecimalNumber objects giving the anchor plot coordinates. * @return The initialized CPTPlotSpaceAnnotation object. **/ --(nonnull instancetype)initWithPlotSpace:(nonnull CPTPlotSpace *)newPlotSpace anchorPlotPoint:(nullable CPTNumberArray)newPlotPoint +-(nonnull instancetype)initWithPlotSpace:(nonnull CPTPlotSpace *)newPlotSpace anchorPlotPoint:(nullable CPTNumberArray *)newPlotPoint { NSParameterAssert(newPlotSpace); - if ( (self = [super init]) ) { + if ((self = [super init])) { plotSpace = newPlotSpace; self.anchorPlotPoint = newPlotPoint; @@ -112,17 +112,36 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - anchorPlotPoint = [[coder decodeObjectForKey:@"CPTPlotSpaceAnnotation.anchorPlotPoint"] copy]; + if ((self = [super initWithCoder:coder])) { + self.anchorPlotPoint = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTPlotSpaceAnnotation.anchorPlotPoint"] copy]; - CPTPlotSpace *thePlotSpace = [coder decodeObjectForKey:@"CPTPlotSpaceAnnotation.plotSpace"]; + CPTPlotSpace *thePlotSpace = [coder decodeObjectOfClass:[CPTPlotSpace class] + forKey:@"CPTPlotSpaceAnnotation.plotSpace"]; if ( thePlotSpace ) { plotSpace = thePlotSpace; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(setContentNeedsLayout) + name:CPTPlotSpaceCoordinateMappingDidChangeNotification + object:plotSpace]; } } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Layout @@ -140,7 +159,7 @@ -(void)positionContentLayer if ( content ) { CPTLayer *hostLayer = self.annotationHostLayer; if ( hostLayer ) { - CPTNumberArray plotAnchor = self.anchorPlotPoint; + CPTNumberArray *plotAnchor = self.anchorPlotPoint; if ( plotAnchor ) { // Get plot area point CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -161,7 +180,7 @@ -(void)positionContentLayer content.anchorPoint = self.contentAnchorPoint; content.position = newPosition; - content.transform = CATransform3DMakeRotation( self.rotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0) ); + content.transform = CATransform3DMakeRotation(self.rotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0)); [content pixelAlign]; } } @@ -175,14 +194,14 @@ -(void)positionContentLayer /// @cond --(void)setAnchorPlotPoint:(nullable CPTNumberArray)newPlotPoint +-(void)setAnchorPlotPoint:(nullable CPTNumberArray *)newPlotPoint { if ( anchorPlotPoint != newPlotPoint ) { anchorPlotPoint = [newPlotPoint copy]; self.anchorCount = anchorPlotPoint.count; - NSDecimal *decimalPoint = malloc(sizeof(NSDecimal) * self.anchorCount); + NSDecimal *decimalPoint = calloc(self.anchorCount, sizeof(NSDecimal)); for ( NSUInteger i = 0; i < self.anchorCount; i++ ) { decimalPoint[i] = anchorPlotPoint[i].decimalValue; } diff --git a/framework/Source/CPTPlotSpaceTests.m b/framework/Source/CPTPlotSpaceTests.m index e10faf39f..226617ec5 100644 --- a/framework/Source/CPTPlotSpaceTests.m +++ b/framework/Source/CPTPlotSpaceTests.m @@ -32,7 +32,7 @@ -(void)testKeyedArchivingRoundTrip plotSpace.identifier = @"test plot space"; - CPTPlotSpace *newPlotSpace = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:plotSpace]]; + CPTPlotSpace *newPlotSpace = [self archiveRoundTrip:plotSpace]; XCTAssertEqualObjects(plotSpace.identifier, newPlotSpace.identifier, @"identifier not equal"); XCTAssertEqual(plotSpace.allowsUserInteraction, newPlotSpace.allowsUserInteraction, @"allowsUserInteraction not equal"); diff --git a/framework/Source/CPTPlotSymbol.h b/framework/Source/CPTPlotSymbol.h index a78902ba8..36ca6d399 100644 --- a/framework/Source/CPTPlotSymbol.h +++ b/framework/Source/CPTPlotSymbol.h @@ -27,14 +27,14 @@ typedef NS_ENUM (NSInteger, CPTPlotSymbolType) { /** * @brief An array of plot symbols. **/ -typedef NSArray *CPTPlotSymbolArray; +typedef NSArray CPTPlotSymbolArray; /** * @brief A mutable array of plot symbols. **/ -typedef NSMutableArray *CPTMutablePlotSymbolArray; +typedef NSMutableArray CPTMutablePlotSymbolArray; -@interface CPTPlotSymbol : NSObject +@interface CPTPlotSymbol : NSObject @property (nonatomic, readwrite, assign) CGPoint anchorPoint; @property (nonatomic, readwrite, assign) CGSize size; diff --git a/framework/Source/CPTPlotSymbol.m b/framework/Source/CPTPlotSymbol.m index 18840965c..9bae6be66 100644 --- a/framework/Source/CPTPlotSymbol.m +++ b/framework/Source/CPTPlotSymbol.m @@ -98,7 +98,7 @@ @implementation CPTPlotSymbol **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { anchorPoint = CPTPointMake(0.5, 0.5); size = CPTSizeMake(5.0, 5.0); symbolType = CPTPlotSymbolTypeNone; @@ -151,13 +151,16 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - anchorPoint = [coder decodeCPTPointForKey:@"CPTPlotSymbol.anchorPoint"]; - size = [coder decodeCPTSizeForKey:@"CPTPlotSymbol.size"]; - symbolType = (CPTPlotSymbolType)[coder decodeIntegerForKey:@"CPTPlotSymbol.symbolType"]; - lineStyle = [coder decodeObjectForKey:@"CPTPlotSymbol.lineStyle"]; - fill = [coder decodeObjectForKey:@"CPTPlotSymbol.fill"]; - shadow = [[coder decodeObjectForKey:@"CPTPlotSymbol.shadow"] copy]; + if ((self = [super init])) { + anchorPoint = [coder decodeCPTPointForKey:@"CPTPlotSymbol.anchorPoint"]; + size = [coder decodeCPTSizeForKey:@"CPTPlotSymbol.size"]; + symbolType = (CPTPlotSymbolType)[coder decodeIntegerForKey:@"CPTPlotSymbol.symbolType"]; + lineStyle = [coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTPlotSymbol.lineStyle"]; + fill = [coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTPlotSymbol.fill"]; + shadow = [[coder decodeObjectOfClass:[CPTShadow class] + forKey:@"CPTPlotSymbol.shadow"] copy]; customSymbolPath = [coder newCGPathDecodeForKey:@"CPTPlotSymbol.customSymbolPath"]; usesEvenOddClipRule = [coder decodeBoolForKey:@"CPTPlotSymbol.usesEvenOddClipRule"]; @@ -170,6 +173,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Accessors @@ -177,7 +192,7 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder -(void)setSize:(CGSize)newSize { - if ( !CGSizeEqualToSize(newSize, size) ) { + if ( !CGSizeEqualToSize(newSize, size)) { size = newSize; self.cachedSymbolPath = NULL; } @@ -464,7 +479,7 @@ -(void)renderInContext:(nonnull CGContextRef)context atPoint:(CGPoint)center sca CGLayerRef theCachedLayer = self.cachedLayer; CGFloat theCachedScale = self.cachedScale; - if ( !theCachedLayer || (theCachedScale != scale) ) { + if ( !theCachedLayer || (theCachedScale != scale)) { CGSize layerSize = [self layerSizeForScale:scale]; self.anchorPoint = CPTPointMake(0.5, 0.5); @@ -473,7 +488,7 @@ -(void)renderInContext:(nonnull CGContextRef)context atPoint:(CGPoint)center sca CGContextRef layerContext = CGLayerGetContext(newLayer); [self renderAsVectorInContext:layerContext - atPoint:CPTPointMake( layerSize.width * CPTFloat(0.5), layerSize.height * CPTFloat(0.5) ) + atPoint:CPTPointMake(layerSize.width * CPTFloat(0.5), layerSize.height * CPTFloat(0.5)) scale:scale]; self.cachedLayer = newLayer; @@ -485,18 +500,18 @@ -(void)renderInContext:(nonnull CGContextRef)context atPoint:(CGPoint)center sca if ( theCachedLayer ) { CGSize layerSize = CGLayerGetSize(theCachedLayer); - if ( scale != CPTFloat(1.0) ) { + if ( scale != CPTFloat(1.0)) { layerSize.width /= scale; layerSize.height /= scale; } CGSize symbolSize = self.size; - CGPoint origin = CPTPointMake( center.x - layerSize.width * CPTFloat(0.5) - symbolSize.width * ( symbolAnchor.x - CPTFloat(0.5) ), - center.y - layerSize.height * CPTFloat(0.5) - symbolSize.height * ( symbolAnchor.y - CPTFloat(0.5) ) ); + CGPoint origin = CPTPointMake(center.x - layerSize.width * CPTFloat(0.5) - symbolSize.width * (symbolAnchor.x - CPTFloat(0.5)), + center.y - layerSize.height * CPTFloat(0.5) - symbolSize.height * (symbolAnchor.y - CPTFloat(0.5))); if ( alignToPixels ) { - if ( scale == CPTFloat(1.0) ) { + if ( scale == CPTFloat(1.0)) { origin.x = round(origin.x); origin.y = round(origin.y); } @@ -584,12 +599,12 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context atPoint:(CGPoint)ce CPTShadow *myShadow = self.shadow; CGContextSaveGState(context); - CGContextTranslateCTM(context, center.x + ( symbolAnchor.x - CPTFloat(0.5) ) * symbolSize.width, center.y + ( symbolAnchor.y - CPTFloat(0.5) ) * symbolSize.height); + CGContextTranslateCTM(context, center.x + (symbolAnchor.x - CPTFloat(0.5)) * symbolSize.width, center.y + (symbolAnchor.y - CPTFloat(0.5)) * symbolSize.height); CGContextScaleCTM(context, scale, scale); [myShadow setShadowInContext:context]; // redraw only symbol rectangle - CGSize halfSize = CPTSizeMake( symbolSize.width * CPTFloat(0.5), symbolSize.height * CPTFloat(0.5) ); + CGSize halfSize = CPTSizeMake(symbolSize.width * CPTFloat(0.5), symbolSize.height * CPTFloat(0.5)); CGRect bounds = CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height); CGRect symbolRect = bounds; @@ -597,7 +612,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context atPoint:(CGPoint)ce if ( myShadow ) { CGFloat shadowRadius = myShadow.shadowBlurRadius; CGSize shadowOffset = myShadow.shadowOffset; - symbolRect = CGRectInset( symbolRect, -( ABS(shadowOffset.width) + ABS(shadowRadius) ), -( ABS(shadowOffset.height) + ABS(shadowRadius) ) ); + symbolRect = CGRectInset(symbolRect, -(ABS(shadowOffset.width) + ABS(shadowRadius)), -(ABS(shadowOffset.height) + ABS(shadowRadius))); } if ( theLineStyle ) { CGFloat lineWidth = ABS(theLineStyle.lineWidth); @@ -611,7 +626,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context atPoint:(CGPoint)ce if ( theFill ) { // use fillRect instead of fillPath so that images and gradients are properly centered in the symbol CGContextSaveGState(context); - if ( !CGPathIsEmpty(theSymbolPath) ) { + if ( !CGPathIsEmpty(theSymbolPath)) { CGContextBeginPath(context); CGContextAddPath(context, theSymbolPath); if ( self.usesEvenOddClipRule ) { @@ -651,7 +666,7 @@ -(nonnull CGPathRef)newSymbolPath { CGFloat dx, dy; CGSize symbolSize = self.size; - CGSize halfSize = CPTSizeMake( symbolSize.width * CPTFloat(0.5), symbolSize.height * CPTFloat(0.5) ); + CGSize halfSize = CPTSizeMake(symbolSize.width * CPTFloat(0.5), symbolSize.height * CPTFloat(0.5)); CGMutablePathRef symbolPath = CGPathCreateMutable(); @@ -661,11 +676,11 @@ -(nonnull CGPathRef)newSymbolPath break; case CPTPlotSymbolTypeRectangle: - CGPathAddRect( symbolPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height) ); + CGPathAddRect(symbolPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height)); break; case CPTPlotSymbolTypeEllipse: - CGPathAddEllipseInRect( symbolPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height) ); + CGPathAddEllipseInRect(symbolPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height)); break; case CPTPlotSymbolTypeCross: @@ -678,38 +693,38 @@ -(nonnull CGPathRef)newSymbolPath case CPTPlotSymbolTypePlus: CGPathMoveToPoint(symbolPath, NULL, CPTFloat(0.0), halfSize.height); CGPathAddLineToPoint(symbolPath, NULL, CPTFloat(0.0), -halfSize.height); - CGPathMoveToPoint( symbolPath, NULL, -halfSize.width, CPTFloat(0.0) ); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width, CPTFloat(0.0) ); + CGPathMoveToPoint(symbolPath, NULL, -halfSize.width, CPTFloat(0.0)); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width, CPTFloat(0.0)); break; case CPTPlotSymbolTypePentagon: CGPathMoveToPoint(symbolPath, NULL, CPTFloat(0.0), halfSize.height); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); CGPathCloseSubpath(symbolPath); break; case CPTPlotSymbolTypeStar: CGPathMoveToPoint(symbolPath, NULL, CPTFloat(0.0), halfSize.height); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.22451398829), halfSize.height * CPTFloat(0.30901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.36327126400), -halfSize.height * CPTFloat(0.11803398875) ); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, CPTFloat(0.0), -halfSize.height * CPTFloat(0.38196601125) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.36327126400), -halfSize.height * CPTFloat(0.11803398875) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.22451398829), halfSize.height * CPTFloat(0.30901699437) ); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.22451398829), halfSize.height * CPTFloat(0.30901699437)); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.36327126400), -halfSize.height * CPTFloat(0.11803398875)); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(symbolPath, NULL, CPTFloat(0.0), -halfSize.height * CPTFloat(0.38196601125)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.36327126400), -halfSize.height * CPTFloat(0.11803398875)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.22451398829), halfSize.height * CPTFloat(0.30901699437)); CGPathCloseSubpath(symbolPath); break; case CPTPlotSymbolTypeDiamond: CGPathMoveToPoint(symbolPath, NULL, CPTFloat(0.0), halfSize.height); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width, CPTFloat(0.0) ); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width, CPTFloat(0.0)); CGPathAddLineToPoint(symbolPath, NULL, CPTFloat(0.0), -halfSize.height); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width, CPTFloat(0.0) ); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width, CPTFloat(0.0)); CGPathCloseSubpath(symbolPath); break; @@ -724,8 +739,8 @@ -(nonnull CGPathRef)newSymbolPath break; case CPTPlotSymbolTypeDash: - CGPathMoveToPoint( symbolPath, NULL, halfSize.width, CPTFloat(0.0) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width, CPTFloat(0.0) ); + CGPathMoveToPoint(symbolPath, NULL, halfSize.width, CPTFloat(0.0)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width, CPTFloat(0.0)); break; case CPTPlotSymbolTypeHexagon: @@ -762,8 +777,8 @@ -(nonnull CGPathRef)newSymbolPath CGFloat dy1 = symbolSize.height / oldBounds.size.height; CGAffineTransform scaleTransform = CGAffineTransformScale(CGAffineTransformIdentity, dx1, dy1); - scaleTransform = CGAffineTransformConcat( scaleTransform, - CGAffineTransformMakeTranslation(-halfSize.width, -halfSize.height) ); + scaleTransform = CGAffineTransformConcat(scaleTransform, + CGAffineTransformMakeTranslation(-halfSize.width, -halfSize.height)); CGPathAddPath(symbolPath, &scaleTransform, customPath); } } @@ -793,7 +808,7 @@ -(nullable id)debugQuickLookObject self.anchorPoint = CPTPointMake(0.5, 0.5); - [self renderAsVectorInContext:context atPoint:CGPointMake( CGRectGetMidX(bounds), CGRectGetMidY(bounds) ) scale:scale]; + [self renderAsVectorInContext:context atPoint:CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds)) scale:scale]; self.anchorPoint = symbolAnchor; }); diff --git a/framework/Source/CPTRangePlot.h b/framework/Source/CPTRangePlot.h index 09362a50b..5e3434e38 100644 --- a/framework/Source/CPTRangePlot.h +++ b/framework/Source/CPTRangePlot.h @@ -5,27 +5,41 @@ @class CPTFill; @class CPTRangePlot; +/** + * @brief Range plot bindings. + **/ +typedef NSString *CPTRangePlotBinding cpt_swift_struct; + /// @ingroup plotBindingsRangePlot /// @{ -extern NSString *__nonnull const CPTRangePlotBindingXValues; -extern NSString *__nonnull const CPTRangePlotBindingYValues; -extern NSString *__nonnull const CPTRangePlotBindingHighValues; -extern NSString *__nonnull const CPTRangePlotBindingLowValues; -extern NSString *__nonnull const CPTRangePlotBindingLeftValues; -extern NSString *__nonnull const CPTRangePlotBindingRightValues; -extern NSString *__nonnull const CPTRangePlotBindingBarLineStyles; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingXValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingYValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingHighValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingLowValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingLeftValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingRightValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingBarLineStyles; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingBarWidths; /// @} /** * @brief Enumeration of range plot data source field types **/ typedef NS_ENUM (NSInteger, CPTRangePlotField) { - CPTRangePlotFieldX, ///< X values. - CPTRangePlotFieldY, ///< Y values. - CPTRangePlotFieldHigh, ///< relative High values. - CPTRangePlotFieldLow, ///< relative Low values. - CPTRangePlotFieldLeft, ///< relative Left values. - CPTRangePlotFieldRight, ///< relative Right values. + CPTRangePlotFieldX, ///< X values. + CPTRangePlotFieldY, ///< Y values. + CPTRangePlotFieldHigh, ///< relative High values. + CPTRangePlotFieldLow, ///< relative Low values. + CPTRangePlotFieldLeft, ///< relative Left values. + CPTRangePlotFieldRight ///< relative Right values. +}; + +/** + * @brief Enumeration of range plot data fill directions + **/ +typedef NS_ENUM (NSInteger, CPTRangePlotFillDirection) { + CPTRangePlotFillHorizontal, ///< Fill between the high and low values in a horizontal direction. + CPTRangePlotFillVertical ///< Fill between the left and right values in a vertical direction. }; #pragma mark - @@ -44,7 +58,7 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { * @param indexRange The range of the data indexes of interest. * @return An array of line styles. **/ --(nullable CPTLineStyleArray)barLineStylesForRangePlot:(nonnull CPTRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLineStyleArray *)barLineStylesForRangePlot:(nonnull CPTRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a bar line style for the given range plot. * This method will not be called if @@ -57,6 +71,23 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { **/ -(nullable CPTLineStyle *)barLineStyleForRangePlot:(nonnull CPTRangePlot *)plot recordIndex:(NSUInteger)idx; +/** @brief @optional Gets an array of bar widths for the given range plot. + * @param plot The range plot. + * @param indexRange The range of the data indexes of interest. + * @return An array of bar widths. + **/ +-(nullable CPTNumberArray *)barWidthsForRangePlot:(nonnull CPTRangePlot *)barPlot recordIndexRange:(NSRange)indexRange; + +/** @brief @optional Gets a bar width for the given range plot. + * This method will not be called if + * @link CPTRangePlotDataSource::barWidthForRangePlot:recordIndexRange: -barWidthForRangePlot:recordIndexRange: @endlink + * is also implemented in the datasource. + * @param plot The range plot. + * @param idx The data index of interest. + * @return The bar width for the bar with the given index. If the data source returns @nil, the default barWidth is used. + **/ +-(nullable NSNumber *)barWidthForRangePlot:(nonnull CPTRangePlot *)plot recordIndex:(NSUInteger)idx; + /// @} @end @@ -154,6 +185,7 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { /// @name Drawing /// @{ +@property (nonatomic, readwrite) CPTRangePlotFillDirection fillDirection; @property (nonatomic, copy, nullable) CPTFill *areaFill; @property (nonatomic, readwrite, copy, nullable) CPTLineStyle *areaBorderLineStyle; /// @} @@ -162,6 +194,8 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { /// @{ -(void)reloadBarLineStyles; -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange; +-(void)reloadBarWidths; +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange; /// @} @end diff --git a/framework/Source/CPTRangePlot.m b/framework/Source/CPTRangePlot.m index 26b8599f6..b03c7e6e2 100644 --- a/framework/Source/CPTRangePlot.m +++ b/framework/Source/CPTRangePlot.m @@ -13,6 +13,7 @@ #import "CPTUtilities.h" #import "CPTXYPlotSpace.h" #import "NSCoderExtensions.h" +#import "NSNumberExtensions.h" #import "tgmath.h" /** @defgroup plotAnimationRangePlot Range Plot @@ -27,13 +28,14 @@ * @endif **/ -NSString *const CPTRangePlotBindingXValues = @"xValues"; ///< X values. -NSString *const CPTRangePlotBindingYValues = @"yValues"; ///< Y values. -NSString *const CPTRangePlotBindingHighValues = @"highValues"; ///< High values. -NSString *const CPTRangePlotBindingLowValues = @"lowValues"; ///< Low values. -NSString *const CPTRangePlotBindingLeftValues = @"leftValues"; ///< Left price values. -NSString *const CPTRangePlotBindingRightValues = @"rightValues"; ///< Right price values. -NSString *const CPTRangePlotBindingBarLineStyles = @"barLineStyles"; ///< Bar line styles. +CPTRangePlotBinding const CPTRangePlotBindingXValues = @"xValues"; ///< X values. +CPTRangePlotBinding const CPTRangePlotBindingYValues = @"yValues"; ///< Y values. +CPTRangePlotBinding const CPTRangePlotBindingHighValues = @"highValues"; ///< High values. +CPTRangePlotBinding const CPTRangePlotBindingLowValues = @"lowValues"; ///< Low values. +CPTRangePlotBinding const CPTRangePlotBindingLeftValues = @"leftValues"; ///< Left price values. +CPTRangePlotBinding const CPTRangePlotBindingRightValues = @"rightValues"; ///< Right price values. +CPTRangePlotBinding const CPTRangePlotBindingBarLineStyles = @"barLineStyles"; ///< Bar line styles. +CPTRangePlotBinding const CPTRangePlotBindingBarWidths = @"barWidths"; ///< Bar widths. /// @cond struct CGPointError { @@ -48,22 +50,24 @@ @interface CPTRangePlot() -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray xValues; -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray yValues; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *xValues; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *yValues; @property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *highValues; @property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *lowValues; @property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *leftValues; @property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *rightValues; -@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray barLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *barLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *barWidths; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownIndex; --(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount forPlotSpace:(nonnull CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly; +-(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount forPlotSpace:(nonnull CPTXYPlotSpace *)xyPlotSpace; -(void)calculateViewPoints:(nonnull CGPointError *)viewPoints withDrawPointFlags:(nonnull BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount; -(void)alignViewPointsToUserSpace:(nonnull CGPointError *)viewPoints withContext:(nonnull CGContextRef)context drawPointFlags:(nonnull BOOL *)drawPointFlag numberOfPoints:(NSUInteger)dataCounts; -(NSInteger)extremeDrawnPointIndexForFlags:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount extremeNumIsLowerBound:(BOOL)isLowerBound; -(void)drawRangeInContext:(nonnull CGContextRef)context lineStyle:(nonnull CPTLineStyle *)lineStyle viewPoint:(CGPointError *)viewPoint halfGapSize:(CGSize)halfGapSize halfBarWidth:(CGFloat)halfBarWidth alignPoints:(BOOL)alignPoints; -(CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx; +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx; @end @@ -88,6 +92,13 @@ @implementation CPTRangePlot @dynamic leftValues; @dynamic rightValues; @dynamic barLineStyles; +@dynamic barWidths; + +/** @property CPTRangePlotFillDirection fillDirection + * @brief Fill the range in a horizontal or vertical direction. + * Default is CPTRangePlotFillHorizontal. + **/ +@synthesize fillDirection; /** @property CPTFill *areaFill * @brief The fill used to render the area. @@ -138,7 +149,7 @@ @implementation CPTRangePlot /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -150,8 +161,10 @@ +(void)initialize [self exposeBinding:CPTRangePlotBindingLeftValues]; [self exposeBinding:CPTRangePlotBindingRightValues]; [self exposeBinding:CPTRangePlotBindingBarLineStyles]; + [self exposeBinding:CPTRangePlotBindingBarWidths]; } } + #endif /// @endcond @@ -163,7 +176,12 @@ +(void)initialize * * This is the designated initializer. The initialized layer will have the following properties: * - @ref barLineStyle = default line style + * - @ref fillDirection = CPTRangePlotFillHorizontal * - @ref areaFill = @nil + * - @ref areaBorderLineStyle = @nil + * - @ref barWidth = 0.0 + * - @ref gapHeight = 0.0 + * - @ref gapWidth = 0.0 * - @ref labelField = #CPTRangePlotFieldX * * @param newFrame The frame rectangle. @@ -171,10 +189,14 @@ +(void)initialize **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { barLineStyle = [[CPTLineStyle alloc] init]; + fillDirection = CPTRangePlotFillHorizontal; areaFill = nil; areaBorderLineStyle = nil; + barWidth = CPTFloat(0.0); + gapHeight = CPTFloat(0.0); + gapWidth = CPTFloat(0.0); pointingDeviceDownIndex = NSNotFound; @@ -189,12 +211,16 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTRangePlot *theLayer = (CPTRangePlot *)layer; barLineStyle = theLayer->barLineStyle; + fillDirection = theLayer->fillDirection; areaFill = theLayer->areaFill; areaBorderLineStyle = theLayer->areaBorderLineStyle; + barWidth = theLayer->barWidth; + gapHeight = theLayer->gapHeight; + gapWidth = theLayer->gapWidth; pointingDeviceDownIndex = NSNotFound; } @@ -216,6 +242,7 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder [coder encodeCGFloat:self.barWidth forKey:@"CPTRangePlot.barWidth"]; [coder encodeCGFloat:self.gapHeight forKey:@"CPTRangePlot.gapHeight"]; [coder encodeCGFloat:self.gapWidth forKey:@"CPTRangePlot.gapWidth"]; + [coder encodeInteger:self.fillDirection forKey:@"CPTRangePlot.fillDirection"]; [coder encodeObject:self.areaFill forKey:@"CPTRangePlot.areaFill"]; [coder encodeObject:self.areaBorderLineStyle forKey:@"CPTRangePlot.areaBorderLineStyle"]; @@ -225,13 +252,17 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - barLineStyle = [[coder decodeObjectForKey:@"CPTRangePlot.barLineStyle"] copy]; - barWidth = [coder decodeCGFloatForKey:@"CPTRangePlot.barWidth"]; - gapHeight = [coder decodeCGFloatForKey:@"CPTRangePlot.gapHeight"]; - gapWidth = [coder decodeCGFloatForKey:@"CPTRangePlot.gapWidth"]; - areaFill = [[coder decodeObjectForKey:@"CPTRangePlot.areaFill"] copy]; - areaBorderLineStyle = [[coder decodeObjectForKey:@"CPTRangePlot.areaBorderLineStyle"] copy]; + if ((self = [super initWithCoder:coder])) { + barLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTRangePlot.barLineStyle"] copy]; + barWidth = [coder decodeCGFloatForKey:@"CPTRangePlot.barWidth"]; + gapHeight = [coder decodeCGFloatForKey:@"CPTRangePlot.gapHeight"]; + gapWidth = [coder decodeCGFloatForKey:@"CPTRangePlot.gapWidth"]; + fillDirection = [coder decodeIntegerForKey:@"CPTRangePlot.fillDirection"]; + areaFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTRangePlot.areaFill"] copy]; + areaBorderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTRangePlot.areaBorderLineStyle"] copy]; pointingDeviceDownIndex = NSNotFound; } @@ -240,12 +271,24 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Determining Which Points to Draw /// @cond --(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount forPlotSpace:(nonnull CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly +-(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount forPlotSpace:(nonnull CPTXYPlotSpace *)xyPlotSpace { if ( dataCount == 0 ) { return; @@ -258,9 +301,9 @@ -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUI } } else { - CPTPlotRangeComparisonResult *xRangeFlags = malloc( dataCount * sizeof(CPTPlotRangeComparisonResult) ); - CPTPlotRangeComparisonResult *yRangeFlags = malloc( dataCount * sizeof(CPTPlotRangeComparisonResult) ); - BOOL *nanFlags = malloc( dataCount * sizeof(BOOL) ); + CPTPlotRangeComparisonResult *xRangeFlags = calloc(dataCount, sizeof(CPTPlotRangeComparisonResult)); + CPTPlotRangeComparisonResult *yRangeFlags = calloc(dataCount, sizeof(CPTPlotRangeComparisonResult)); + BOOL *nanFlags = calloc(dataCount, sizeof(BOOL)); CPTPlotRange *xRange = xyPlotSpace.xRange; CPTPlotRange *yRange = xyPlotSpace.yRange; @@ -276,7 +319,7 @@ -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUI xRangeFlags[i] = [xRange compareToDouble:x]; yRangeFlags[i] = [yRange compareToDouble:y]; - nanFlags[i] = isnan(x) || isnan(y); + nanFlags[i] = isnan(x) || isnan(y); }); } else { @@ -289,7 +332,7 @@ -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUI xRangeFlags[i] = [xRange compareToDecimal:x]; yRangeFlags[i] = [yRange compareToDecimal:y]; - nanFlags[i] = NSDecimalIsNotANumber(&x); + nanFlags[i] = NSDecimalIsNotANumber(&x); }); } @@ -321,13 +364,13 @@ -(void)calculateViewPoints:(nonnull CGPointError *)viewPoints withDrawPointFlags const double *rightBytes = (const double *)[self cachedNumbersForField:CPTRangePlotFieldRight].data.bytes; dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { - const double x = xBytes[i]; - const double y = yBytes[i]; - const double high = highBytes[i]; - const double low = lowBytes[i]; - const double left = leftBytes[i]; + const double x = xBytes[i]; + const double y = yBytes[i]; + const double high = highBytes[i]; + const double low = lowBytes[i]; + const double left = leftBytes[i]; const double right = rightBytes[i]; - if ( !drawPointFlags[i] || isnan(x) || isnan(y) ) { + if ( !drawPointFlags[i] || isnan(x) || isnan(y)) { viewPoints[i].x = CPTNAN; // depending coordinates viewPoints[i].y = CPTNAN; } @@ -335,29 +378,29 @@ -(void)calculateViewPoints:(nonnull CGPointError *)viewPoints withDrawPointFlags double plotPoint[2]; plotPoint[CPTCoordinateX] = x; plotPoint[CPTCoordinateY] = y; - CGPoint pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].x = pos.x; - viewPoints[i].y = pos.y; + CGPoint pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].x = pos.x; + viewPoints[i].y = pos.y; plotPoint[CPTCoordinateX] = x; plotPoint[CPTCoordinateY] = y + high; - pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].high = pos.y; + pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].high = pos.y; plotPoint[CPTCoordinateX] = x; plotPoint[CPTCoordinateY] = y - low; - pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].low = pos.y; + pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].low = pos.y; plotPoint[CPTCoordinateX] = x - left; plotPoint[CPTCoordinateY] = y; - pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].left = pos.x; + pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].left = pos.x; plotPoint[CPTCoordinateX] = x + right; plotPoint[CPTCoordinateY] = y; - pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].right = pos.x; + pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].right = pos.x; } }); } @@ -370,14 +413,14 @@ -(void)calculateViewPoints:(nonnull CGPointError *)viewPoints withDrawPointFlags const NSDecimal *rightBytes = (const NSDecimal *)[self cachedNumbersForField:CPTRangePlotFieldRight].data.bytes; dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { - const NSDecimal x = xBytes[i]; - const NSDecimal y = yBytes[i]; - const NSDecimal high = highBytes[i]; - const NSDecimal low = lowBytes[i]; - const NSDecimal left = leftBytes[i]; + const NSDecimal x = xBytes[i]; + const NSDecimal y = yBytes[i]; + const NSDecimal high = highBytes[i]; + const NSDecimal low = lowBytes[i]; + const NSDecimal left = leftBytes[i]; const NSDecimal right = rightBytes[i]; - if ( !drawPointFlags[i] || NSDecimalIsNotANumber(&x) || NSDecimalIsNotANumber(&y) ) { + if ( !drawPointFlags[i] || NSDecimalIsNotANumber(&x) || NSDecimalIsNotANumber(&y)) { viewPoints[i].x = CPTNAN; // depending coordinates viewPoints[i].y = CPTNAN; } @@ -385,52 +428,52 @@ -(void)calculateViewPoints:(nonnull CGPointError *)viewPoints withDrawPointFlags NSDecimal plotPoint[2]; plotPoint[CPTCoordinateX] = x; plotPoint[CPTCoordinateY] = y; - CGPoint pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].x = pos.x; - viewPoints[i].y = pos.y; + CGPoint pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].x = pos.x; + viewPoints[i].y = pos.y; - if ( !NSDecimalIsNotANumber(&high) ) { + if ( !NSDecimalIsNotANumber(&high)) { plotPoint[CPTCoordinateX] = x; NSDecimal yh; NSDecimalAdd(&yh, &y, &high, NSRoundPlain); plotPoint[CPTCoordinateY] = yh; - pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].high = pos.y; + pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].high = pos.y; } else { viewPoints[i].high = CPTNAN; } - if ( !NSDecimalIsNotANumber(&low) ) { + if ( !NSDecimalIsNotANumber(&low)) { plotPoint[CPTCoordinateX] = x; NSDecimal yl; NSDecimalSubtract(&yl, &y, &low, NSRoundPlain); plotPoint[CPTCoordinateY] = yl; - pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].low = pos.y; + pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].low = pos.y; } else { viewPoints[i].low = CPTNAN; } - if ( !NSDecimalIsNotANumber(&left) ) { + if ( !NSDecimalIsNotANumber(&left)) { NSDecimal xl; NSDecimalSubtract(&xl, &x, &left, NSRoundPlain); plotPoint[CPTCoordinateX] = xl; plotPoint[CPTCoordinateY] = y; - pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].left = pos.x; + pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].left = pos.x; } else { viewPoints[i].left = CPTNAN; } - if ( !NSDecimalIsNotANumber(&right) ) { + if ( !NSDecimalIsNotANumber(&right)) { NSDecimal xr; NSDecimalAdd(&xr, &x, &right, NSRoundPlain); plotPoint[CPTCoordinateX] = xr; plotPoint[CPTCoordinateY] = y; - pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].right = pos.x; + pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].right = pos.x; } else { viewPoints[i].right = CPTNAN; @@ -444,22 +487,22 @@ -(void)alignViewPointsToUserSpace:(nonnull CGPointError *)viewPoints withContext { // Align to device pixels if there is a data line. // Otherwise, align to view space, so fills are sharp at edges. - if ( self.barLineStyle.lineWidth > CPTFloat(0.0) ) { + if ( self.barLineStyle.lineWidth > CPTFloat(0.0)) { dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { if ( drawPointFlags[i] ) { - CGFloat x = viewPoints[i].x; - CGFloat y = viewPoints[i].y; - CGPoint pos = CPTAlignPointToUserSpace( context, CPTPointMake(viewPoints[i].x, viewPoints[i].y) ); + CGFloat x = viewPoints[i].x; + CGFloat y = viewPoints[i].y; + CGPoint pos = CPTAlignPointToUserSpace(context, CPTPointMake(viewPoints[i].x, viewPoints[i].y)); viewPoints[i].x = pos.x; viewPoints[i].y = pos.y; - pos = CPTAlignPointToUserSpace( context, CPTPointMake(x, viewPoints[i].high) ); - viewPoints[i].high = pos.y; - pos = CPTAlignPointToUserSpace( context, CPTPointMake(x, viewPoints[i].low) ); - viewPoints[i].low = pos.y; - pos = CPTAlignPointToUserSpace( context, CPTPointMake(viewPoints[i].left, y) ); - viewPoints[i].left = pos.x; - pos = CPTAlignPointToUserSpace( context, CPTPointMake(viewPoints[i].right, y) ); + pos = CPTAlignPointToUserSpace(context, CPTPointMake(x, viewPoints[i].high)); + viewPoints[i].high = pos.y; + pos = CPTAlignPointToUserSpace(context, CPTPointMake(x, viewPoints[i].low)); + viewPoints[i].low = pos.y; + pos = CPTAlignPointToUserSpace(context, CPTPointMake(viewPoints[i].left, y)); + viewPoints[i].left = pos.x; + pos = CPTAlignPointToUserSpace(context, CPTPointMake(viewPoints[i].right, y)); viewPoints[i].right = pos.x; } }); @@ -467,19 +510,19 @@ -(void)alignViewPointsToUserSpace:(nonnull CGPointError *)viewPoints withContext else { dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { if ( drawPointFlags[i] ) { - CGFloat x = viewPoints[i].x; - CGFloat y = viewPoints[i].y; - CGPoint pos = CPTAlignIntegralPointToUserSpace( context, CPTPointMake(viewPoints[i].x, viewPoints[i].y) ); + CGFloat x = viewPoints[i].x; + CGFloat y = viewPoints[i].y; + CGPoint pos = CPTAlignIntegralPointToUserSpace(context, CPTPointMake(viewPoints[i].x, viewPoints[i].y)); viewPoints[i].x = pos.x; viewPoints[i].y = pos.y; - pos = CPTAlignIntegralPointToUserSpace( context, CPTPointMake(x, viewPoints[i].high) ); - viewPoints[i].high = pos.y; - pos = CPTAlignIntegralPointToUserSpace( context, CPTPointMake(x, viewPoints[i].low) ); - viewPoints[i].low = pos.y; - pos = CPTAlignIntegralPointToUserSpace( context, CPTPointMake(viewPoints[i].left, y) ); - viewPoints[i].left = pos.x; - pos = CPTAlignIntegralPointToUserSpace( context, CPTPointMake(viewPoints[i].right, y) ); + pos = CPTAlignIntegralPointToUserSpace(context, CPTPointMake(x, viewPoints[i].high)); + viewPoints[i].high = pos.y; + pos = CPTAlignIntegralPointToUserSpace(context, CPTPointMake(x, viewPoints[i].low)); + viewPoints[i].low = pos.y; + pos = CPTAlignIntegralPointToUserSpace(context, CPTPointMake(viewPoints[i].left, y)); + viewPoints[i].left = pos.x; + pos = CPTAlignIntegralPointToUserSpace(context, CPTPointMake(viewPoints[i].right, y)); viewPoints[i].right = pos.x; } }); @@ -498,7 +541,7 @@ -(NSInteger)extremeDrawnPointIndexForFlags:(nonnull BOOL *)pointDrawFlags number result = i; break; } - if ( (delta < 0) && (i == 0) ) { + if ((delta < 0) && (i == 0)) { break; } } @@ -519,6 +562,9 @@ -(void)reloadDataInIndexRange:(NSRange)indexRange // Bar line styles [self reloadBarLineStylesInIndexRange:indexRange]; + + // Bar widths + [self reloadBarWidthsInIndexRange:indexRange]; } -(void)reloadPlotDataInIndexRange:(NSRange)indexRange @@ -582,9 +628,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(barLineStyleForRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - CPTMutableLineStyleArray array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLineStyleArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLineStyle *dataSourceLineStyle = [theDataSource barLineStyleForRangePlot:self recordIndex:idx]; @@ -607,6 +653,49 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange [self setNeedsDisplay]; } +/** + * @brief Reload all bar widths from the data source immediately. + **/ +-(void)reloadBarWidths +{ + [self reloadBarWidthsInIndexRange:NSMakeRange(0, self.cachedDataCount)]; +} + +/** @brief Reload bar widths in the given index range from the data source immediately. + * @param indexRange The index range to load. + **/ +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange +{ + id theDataSource = (id)self.dataSource; + + if ( [theDataSource respondsToSelector:@selector(barWidthsForRangePlot:recordIndexRange:)] ) { + [self cacheArray:[theDataSource barWidthsForRangePlot:self recordIndexRange:indexRange] + forKey:CPTRangePlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + else if ( [theDataSource respondsToSelector:@selector(barWidthForRangePlot:recordIndex:)] ) { + id nilObject = [CPTPlot nilData]; + CPTMutableNumberArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); + + for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { + NSNumber *width = [theDataSource barWidthForRangePlot:self recordIndex:idx]; + if ( width ) { + [array addObject:width]; + } + else { + [array addObject:nilObject]; + } + } + + [self cacheArray:array + forKey:CPTRangePlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + + [self setNeedsDisplay]; +} + #pragma mark - #pragma mark Drawing @@ -621,7 +710,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CPTMutableNumericData *xValueData = [self cachedNumbersForField:CPTRangePlotFieldX]; CPTMutableNumericData *yValueData = [self cachedNumbersForField:CPTRangePlotFieldY]; - if ( (xValueData == nil) || (yValueData == nil) ) { + if ((xValueData == nil) || (yValueData == nil)) { return; } NSUInteger dataCount = self.cachedDataCount; @@ -635,11 +724,11 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context [super renderAsVectorInContext:context]; // Calculate view points, and align to user space - CGPointError *viewPoints = calloc( dataCount, sizeof(CGPointError) ); - BOOL *drawPointFlags = calloc( dataCount, sizeof(BOOL) ); + CGPointError *viewPoints = calloc(dataCount, sizeof(CGPointError)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = (CPTXYPlotSpace *)self.plotSpace; - [self calculatePointsToDraw:drawPointFlags numberOfPoints:dataCount forPlotSpace:thePlotSpace includeVisiblePointsOnly:NO]; + [self calculatePointsToDraw:drawPointFlags numberOfPoints:dataCount forPlotSpace:thePlotSpace]; [self calculateViewPoints:viewPoints withDrawPointFlags:drawPointFlags numberOfPoints:dataCount]; if ( self.alignsPointsToPixels ) { [self alignViewPointsToUserSpace:viewPoints withContext:context drawPointFlags:drawPointFlags numberOfPoints:dataCount]; @@ -653,39 +742,80 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context if ( self.areaFill ) { CGMutablePathRef fillPath = CGPathCreateMutable(); - // First do the top points - for ( NSUInteger i = (NSUInteger)firstDrawnPointIndex; i <= (NSUInteger)lastDrawnPointIndex; i++ ) { - CGFloat x = viewPoints[i].x; - CGFloat y = viewPoints[i].high; - if ( isnan(y) ) { - y = viewPoints[i].y; - } - - if ( !isnan(x) && !isnan(y) ) { - if ( i == (NSUInteger)firstDrawnPointIndex ) { - CGPathMoveToPoint(fillPath, NULL, x, y); + switch ( self.fillDirection ) { + case CPTRangePlotFillHorizontal: + // First do the top points + for ( NSUInteger i = (NSUInteger)firstDrawnPointIndex; i <= (NSUInteger)lastDrawnPointIndex; i++ ) { + CGFloat x = viewPoints[i].x; + CGFloat y = viewPoints[i].high; + if ( isnan(y)) { + y = viewPoints[i].y; + } + + if ( !isnan(x) && !isnan(y)) { + if ( i == (NSUInteger)firstDrawnPointIndex ) { + CGPathMoveToPoint(fillPath, NULL, x, y); + } + else { + CGPathAddLineToPoint(fillPath, NULL, x, y); + } + } } - else { - CGPathAddLineToPoint(fillPath, NULL, x, y); + + // Then reverse over bottom points + for ( NSUInteger j = (NSUInteger)lastDrawnPointIndex; j >= (NSUInteger)firstDrawnPointIndex; j-- ) { + CGFloat x = viewPoints[j].x; + CGFloat y = viewPoints[j].low; + if ( isnan(y)) { + y = viewPoints[j].y; + } + + if ( !isnan(x) && !isnan(y)) { + CGPathAddLineToPoint(fillPath, NULL, x, y); + } + if ( j == (NSUInteger)firstDrawnPointIndex ) { + // This could be done a bit more elegant + break; + } } - } - } + break; - // Then reverse over bottom points - for ( NSUInteger j = (NSUInteger)lastDrawnPointIndex; j >= (NSUInteger)firstDrawnPointIndex; j-- ) { - CGFloat x = viewPoints[j].x; - CGFloat y = viewPoints[j].low; - if ( isnan(y) ) { - y = viewPoints[j].y; - } + case CPTRangePlotFillVertical: + // First do the left points + for ( NSUInteger i = (NSUInteger)firstDrawnPointIndex; i <= (NSUInteger)lastDrawnPointIndex; i++ ) { + CGFloat x = viewPoints[i].left; + CGFloat y = viewPoints[i].y; + if ( isnan(x)) { + y = viewPoints[i].x; + } + + if ( !isnan(x) && !isnan(y)) { + if ( i == (NSUInteger)firstDrawnPointIndex ) { + CGPathMoveToPoint(fillPath, NULL, x, y); + } + else { + CGPathAddLineToPoint(fillPath, NULL, x, y); + } + } + } - if ( !isnan(x) && !isnan(y) ) { - CGPathAddLineToPoint(fillPath, NULL, x, y); - } - if ( j == (NSUInteger)firstDrawnPointIndex ) { - // This could be done a bit more elegant + // Then reverse over right points + for ( NSUInteger j = (NSUInteger)lastDrawnPointIndex; j >= (NSUInteger)firstDrawnPointIndex; j-- ) { + CGFloat x = viewPoints[j].right; + CGFloat y = viewPoints[j].y; + if ( isnan(x)) { + y = viewPoints[j].x; + } + + if ( !isnan(x) && !isnan(y)) { + CGPathAddLineToPoint(fillPath, NULL, x, y); + } + if ( j == (NSUInteger)firstDrawnPointIndex ) { + // This could be done a bit more elegant + break; + } + } break; - } } // Close the path to have a closed loop @@ -708,11 +838,12 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CGPathRelease(fillPath); } - CGSize halfGapSize = CPTSizeMake( self.gapWidth * CPTFloat(0.5), self.gapHeight * CPTFloat(0.5) ); - CGFloat halfBarWidth = self.barWidth * CPTFloat(0.5); - BOOL alignPoints = self.alignsPointsToPixels; + CGSize halfGapSize = CPTSizeMake(self.gapWidth * CPTFloat(0.5), self.gapHeight * CPTFloat(0.5)); + BOOL alignPoints = self.alignsPointsToPixels; for ( NSUInteger i = (NSUInteger)firstDrawnPointIndex; i <= (NSUInteger)lastDrawnPointIndex; i++ ) { + CGFloat halfBarWidth = [self barWidthForIndex:i].cgFloatValue * CPTFloat(0.5); + [self drawRangeInContext:context lineStyle:[self barLineStyleForIndex:i] viewPoint:&viewPoints[i] @@ -733,18 +864,18 @@ -(void)drawRangeInContext:(nonnull CGContextRef)context halfBarWidth:(CGFloat)halfBarWidth alignPoints:(BOOL)alignPoints { - if ( [lineStyle isKindOfClass:[CPTLineStyle class]] && !isnan(viewPoint->x) && !isnan(viewPoint->y) ) { + if ( [lineStyle isKindOfClass:[CPTLineStyle class]] && !isnan(viewPoint->x) && !isnan(viewPoint->y)) { CPTAlignPointFunction alignmentFunction = CPTAlignPointToUserSpace; CGFloat lineWidth = lineStyle.lineWidth; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } CGMutablePathRef path = CGPathCreateMutable(); // centre-high - if ( !isnan(viewPoint->high) ) { + if ( !isnan(viewPoint->high)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x, viewPoint->y + halfGapSize.height); CGPoint alignedLowPoint = CPTPointMake(viewPoint->x, viewPoint->high); if ( alignPoints ) { @@ -756,7 +887,7 @@ -(void)drawRangeInContext:(nonnull CGContextRef)context } // centre-low - if ( !isnan(viewPoint->low) ) { + if ( !isnan(viewPoint->low)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x, viewPoint->y - halfGapSize.height); CGPoint alignedLowPoint = CPTPointMake(viewPoint->x, viewPoint->low); if ( alignPoints ) { @@ -768,7 +899,7 @@ -(void)drawRangeInContext:(nonnull CGContextRef)context } // top bar - if ( !isnan(viewPoint->high) ) { + if ( !isnan(viewPoint->high)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x - halfBarWidth, viewPoint->high); CGPoint alignedLowPoint = CPTPointMake(viewPoint->x + halfBarWidth, viewPoint->high); if ( alignPoints ) { @@ -780,7 +911,7 @@ -(void)drawRangeInContext:(nonnull CGContextRef)context } // bottom bar - if ( !isnan(viewPoint->low) ) { + if ( !isnan(viewPoint->low)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x - halfBarWidth, viewPoint->low); CGPoint alignedLowPoint = CPTPointMake(viewPoint->x + halfBarWidth, viewPoint->low); if ( alignPoints ) { @@ -792,7 +923,7 @@ -(void)drawRangeInContext:(nonnull CGContextRef)context } // centre-left - if ( !isnan(viewPoint->left) ) { + if ( !isnan(viewPoint->left)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x - halfGapSize.width, viewPoint->y); CGPoint alignedLowPoint = CPTPointMake(viewPoint->left, viewPoint->y); if ( alignPoints ) { @@ -804,7 +935,7 @@ -(void)drawRangeInContext:(nonnull CGContextRef)context } // centre-right - if ( !isnan(viewPoint->right) ) { + if ( !isnan(viewPoint->right)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x + halfGapSize.width, viewPoint->y); CGPoint alignedLowPoint = CPTPointMake(viewPoint->right, viewPoint->y); if ( alignPoints ) { @@ -816,7 +947,7 @@ -(void)drawRangeInContext:(nonnull CGContextRef)context } // left bar - if ( !isnan(viewPoint->left) ) { + if ( !isnan(viewPoint->left)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->left, viewPoint->y - halfBarWidth); CGPoint alignedLowPoint = CPTPointMake(viewPoint->left, viewPoint->y + halfBarWidth); if ( alignPoints ) { @@ -828,7 +959,7 @@ -(void)drawRangeInContext:(nonnull CGContextRef)context } // right bar - if ( !isnan(viewPoint->right) ) { + if ( !isnan(viewPoint->right)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->right, viewPoint->y - halfBarWidth); CGPoint alignedLowPoint = CPTPointMake(viewPoint->right, viewPoint->y + halfBarWidth); if ( alignPoints ) { @@ -882,7 +1013,7 @@ -(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx i [self drawRangeInContext:context lineStyle:theBarLineStyle viewPoint:&viewPoint - halfGapSize:CPTSizeMake( MIN( self.gapWidth, rect.size.width / CPTFloat(2.0) ) * CPTFloat(0.5), MIN( self.gapHeight, rect.size.height / CPTFloat(2.0) ) * CPTFloat(0.5) ) + halfGapSize:CPTSizeMake(MIN(self.gapWidth, rect.size.width / CPTFloat(2.0)) * CPTFloat(0.5), MIN(self.gapHeight, rect.size.height / CPTFloat(2.0)) * CPTFloat(0.5)) halfBarWidth:MIN(MIN(self.barWidth, rect.size.width), rect.size.height) * CPTFloat(0.5) alignPoints:YES]; } @@ -893,13 +1024,24 @@ -(nullable CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx { CPTLineStyle *theBarLineStyle = [self cachedValueForKey:CPTRangePlotBindingBarLineStyles recordIndex:idx]; - if ( (theBarLineStyle == nil) || (theBarLineStyle == [CPTPlot nilData]) ) { + if ((theBarLineStyle == nil) || (theBarLineStyle == [CPTPlot nilData])) { theBarLineStyle = self.barLineStyle; } return theBarLineStyle; } +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx +{ + NSNumber *theBarWidth = [self cachedValueForKey:CPTRangePlotBindingBarWidths recordIndex:idx]; + + if ((theBarWidth == nil) || (theBarWidth == [CPTPlot nilData])) { + theBarWidth = @(self.barWidth); + } + + return theBarWidth; +} + /// @endcond #pragma mark - @@ -938,7 +1080,7 @@ -(NSUInteger)numberOfFields return 6; } --(nonnull CPTNumberArray)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[@(CPTRangePlotFieldX), @(CPTRangePlotFieldY), @@ -948,18 +1090,18 @@ -(nonnull CPTNumberArray)fieldIdentifiers @(CPTRangePlotFieldRight)]; } --(nonnull CPTNumberArray)fieldIdentifiersForCoordinate:(CPTCoordinate)coord +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord { - CPTNumberArray result = nil; + CPTNumberArray *result = nil; switch ( coord ) { case CPTCoordinateX: result = @[@(CPTRangePlotFieldX)]; - break; + break; case CPTCoordinateY: result = @[@(CPTRangePlotFieldY)]; - break; + break; default: [NSException raise:CPTException format:@"Invalid coordinate passed to fieldIdentifiersForCoordinate:"]; @@ -1002,24 +1144,15 @@ -(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger)field -(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx { NSNumber *xValue = [self cachedNumberForField:CPTRangePlotFieldX recordIndex:idx]; + NSNumber *yValue = [self cachedNumberForField:CPTRangePlotFieldY recordIndex:idx]; BOOL positiveDirection = YES; CPTPlotRange *yRange = [self.plotSpace plotRangeForCoordinate:CPTCoordinateY]; - if ( CPTDecimalLessThan( yRange.lengthDecimal, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalLessThan(yRange.lengthDecimal, CPTDecimalFromInteger(0))) { positiveDirection = !positiveDirection; } - NSNumber *yValue; - CPTNumberArray yValues = @[[self cachedNumberForField:CPTRangePlotFieldY recordIndex:idx]]; - CPTNumberArray yValuesSorted = [yValues sortedArrayUsingSelector:@selector(compare:)]; - if ( positiveDirection ) { - yValue = yValuesSorted.lastObject; - } - else { - yValue = yValuesSorted[0]; - } - label.anchorPlotPoint = @[xValue, yValue]; label.contentLayer.hidden = self.hidden || isnan([xValue doubleValue]) || isnan([yValue doubleValue]); @@ -1041,10 +1174,10 @@ -(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex: -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point { NSUInteger dataCount = self.cachedDataCount; - CGPointError *viewPoints = calloc( dataCount, sizeof(CGPointError) ); - BOOL *drawPointFlags = malloc( dataCount * sizeof(BOOL) ); + CGPointError *viewPoints = calloc(dataCount, sizeof(CGPointError)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); - [self calculatePointsToDraw:drawPointFlags numberOfPoints:dataCount forPlotSpace:(id)self.plotSpace includeVisiblePointsOnly:YES]; + [self calculatePointsToDraw:drawPointFlags numberOfPoints:dataCount forPlotSpace:(CPTXYPlotSpace *)self.plotSpace]; [self calculateViewPoints:viewPoints withDrawPointFlags:drawPointFlags numberOfPoints:dataCount]; NSInteger result = [self extremeDrawnPointIndexForFlags:drawPointFlags numberOfPoints:dataCount extremeNumIsLowerBound:YES]; @@ -1056,7 +1189,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point lastViewPoint = viewPoints[i]; CGPoint lastPoint = CPTPointMake(lastViewPoint.x, lastViewPoint.y); CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, lastPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = (NSInteger)i; } @@ -1065,16 +1198,16 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( result != NSNotFound ) { lastViewPoint = viewPoints[result]; - if ( !isnan(lastViewPoint.left) && (point.x < lastViewPoint.left) ) { + if ( !isnan(lastViewPoint.left) && (point.x < lastViewPoint.left)) { result = NSNotFound; } - if ( !isnan(lastViewPoint.right) && (point.x > lastViewPoint.right) ) { + if ( !isnan(lastViewPoint.right) && (point.x > lastViewPoint.right)) { result = NSNotFound; } - if ( !isnan(lastViewPoint.high) && (point.y > lastViewPoint.high) ) { + if ( !isnan(lastViewPoint.high) && (point.y > lastViewPoint.high)) { result = NSNotFound; } - if ( !isnan(lastViewPoint.low) && (point.y < lastViewPoint.low) ) { + if ( !isnan(lastViewPoint.low) && (point.y < lastViewPoint.low)) { result = NSNotFound; } } @@ -1118,7 +1251,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(rangePlot:rangeTouchDownAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(rangePlot:rangeTouchDownAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(rangePlot:rangeWasSelectedAtRecordIndex:)] || @@ -1187,7 +1320,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(rangePlot:rangeTouchUpAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(rangePlot:rangeTouchUpAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(rangePlot:rangeWasSelectedAtRecordIndex:)] || @@ -1288,22 +1421,22 @@ -(void)setGapWidth:(CGFloat)newGapWidth } } --(void)setXValues:(nullable CPTNumberArray)newValues +-(void)setXValues:(nullable CPTNumberArray *)newValues { [self cacheNumbers:newValues forField:CPTRangePlotFieldX]; } --(nullable CPTNumberArray)xValues +-(nullable CPTNumberArray *)xValues { return [[self cachedNumbersForField:CPTRangePlotFieldX] sampleArray]; } --(void)setYValues:(nullable CPTNumberArray)newValues +-(void)setYValues:(nullable CPTNumberArray *)newValues { [self cacheNumbers:newValues forField:CPTRangePlotFieldY]; } --(nullable CPTNumberArray)yValues +-(nullable CPTNumberArray *)yValues { return [[self cachedNumbersForField:CPTRangePlotFieldY] sampleArray]; } @@ -1348,12 +1481,12 @@ -(void)setRightValues:(nullable CPTMutableNumericData *)newValues [self cacheNumbers:newValues forField:CPTRangePlotFieldRight]; } --(nullable CPTLineStyleArray)barLineStyles +-(nullable CPTLineStyleArray *)barLineStyles { return [self cachedArrayForKey:CPTRangePlotBindingBarLineStyles]; } --(void)setBarLineStyles:(nullable CPTLineStyleArray)newLineStyles +-(void)setBarLineStyles:(nullable CPTLineStyleArray *)newLineStyles { [self cacheArray:newLineStyles forKey:CPTRangePlotBindingBarLineStyles]; [self setNeedsDisplay]; diff --git a/framework/Source/CPTResponder.h b/framework/Source/CPTResponder.h index 0e60d5d54..6b56832ff 100644 --- a/framework/Source/CPTResponder.h +++ b/framework/Source/CPTResponder.h @@ -48,7 +48,7 @@ **/ -(BOOL)pointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else /** diff --git a/framework/Source/CPTScatterPlot.h b/framework/Source/CPTScatterPlot.h index 84317a202..8cd3b9a7d 100644 --- a/framework/Source/CPTScatterPlot.h +++ b/framework/Source/CPTScatterPlot.h @@ -9,11 +9,16 @@ @class CPTScatterPlot; @class CPTFill; +/** + * @brief Scatter plot bindings. + **/ +typedef NSString *CPTScatterPlotBinding cpt_swift_struct; + /// @ingroup plotBindingsScatterPlot /// @{ -extern NSString *__nonnull const CPTScatterPlotBindingXValues; -extern NSString *__nonnull const CPTScatterPlotBindingYValues; -extern NSString *__nonnull const CPTScatterPlotBindingPlotSymbols; +extern CPTScatterPlotBinding __nonnull const CPTScatterPlotBindingXValues; +extern CPTScatterPlotBinding __nonnull const CPTScatterPlotBindingYValues; +extern CPTScatterPlotBinding __nonnull const CPTScatterPlotBindingPlotSymbols; /// @} /** @@ -31,7 +36,19 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { CPTScatterPlotInterpolationLinear, ///< Linear interpolation. CPTScatterPlotInterpolationStepped, ///< Steps beginning at data point. CPTScatterPlotInterpolationHistogram, ///< Steps centered at data point. - CPTScatterPlotInterpolationCurved ///< Bezier curve interpolation. + CPTScatterPlotInterpolationCurved ///< Curved interpolation. +}; + +/** + * @brief Enumration of scatter plot curved interpolation style options + **/ +typedef NS_ENUM (NSInteger, CPTScatterPlotCurvedInterpolationOption) { + CPTScatterPlotCurvedInterpolationNormal, ///< Standard Curved Interpolation (Bezier Curve) + CPTScatterPlotCurvedInterpolationCatmullRomUniform, ///< Catmull-Rom Spline Interpolation with alpha = @num{0.0}. + CPTScatterPlotCurvedInterpolationCatmullRomCentripetal, ///< Catmull-Rom Spline Interpolation with alpha = @num{0.5}. + CPTScatterPlotCurvedInterpolationCatmullRomChordal, ///< Catmull-Rom Spline Interpolation with alpha = @num{1.0}. + CPTScatterPlotCurvedInterpolationCatmullCustomAlpha, ///< Catmull-Rom Spline Interpolation with a custom alpha value. + CPTScatterPlotCurvedInterpolationHermiteCubic ///< Hermite Cubic Spline Interpolation }; /** @@ -61,7 +78,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotHistogramOption) { * @param indexRange The range of the data indexes of interest. * @return An array of plot symbols. **/ --(nullable CPTPlotSymbolArray)symbolsForScatterPlot:(nonnull CPTScatterPlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTPlotSymbolArray *)symbolsForScatterPlot:(nonnull CPTScatterPlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a single plot symbol for the given scatter plot. * This method will not be called if @@ -234,11 +251,13 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotHistogramOption) { @property (nonatomic, readwrite, strong, nullable) NSNumber *areaBaseValue2; @property (nonatomic, readwrite, assign) CPTScatterPlotInterpolation interpolation; @property (nonatomic, readwrite, assign) CPTScatterPlotHistogramOption histogramOption; +@property (nonatomic, readwrite, assign) CPTScatterPlotCurvedInterpolationOption curvedInterpolationOption; +@property (nonatomic, readwrite, assign) CGFloat curvedInterpolationCustomAlpha; /// @} /// @name Area Fill Bands /// @{ -@property (nonatomic, readonly, nullable) CPTLimitBandArray areaFillBands; +@property (nonatomic, readonly, nullable) CPTLimitBandArray *areaFillBands; /// @} /// @name Drawing diff --git a/framework/Source/CPTScatterPlot.m b/framework/Source/CPTScatterPlot.m index 689561562..d8417fc1f 100644 --- a/framework/Source/CPTScatterPlot.m +++ b/framework/Source/CPTScatterPlot.m @@ -27,19 +27,19 @@ * @endif **/ -NSString *const CPTScatterPlotBindingXValues = @"xValues"; ///< X values. -NSString *const CPTScatterPlotBindingYValues = @"yValues"; ///< Y values. -NSString *const CPTScatterPlotBindingPlotSymbols = @"plotSymbols"; ///< Plot symbols. +CPTScatterPlotBinding const CPTScatterPlotBindingXValues = @"xValues"; ///< X values. +CPTScatterPlotBinding const CPTScatterPlotBindingYValues = @"yValues"; ///< Y values. +CPTScatterPlotBinding const CPTScatterPlotBindingPlotSymbols = @"plotSymbols"; ///< Plot symbols. /// @cond @interface CPTScatterPlot() -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray xValues; -@property (nonatomic, readwrite, copy, nullable) CPTNumberArray yValues; -@property (nonatomic, readwrite, strong, nullable) CPTPlotSymbolArray plotSymbols; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *xValues; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *yValues; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSymbolArray *plotSymbols; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownIndex; @property (nonatomic, readwrite, assign) BOOL pointingDeviceDownOnLine; -@property (nonatomic, readwrite, strong) CPTMutableLimitBandArray mutableAreaFillBands; +@property (nonatomic, readwrite, strong) CPTMutableLimitBandArray *mutableAreaFillBands; -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnull CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly numberOfPoints:(NSUInteger)dataCount; -(void)calculateViewPoints:(nonnull CGPoint *)viewPoints withDrawPointFlags:(nonnull BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount; @@ -49,7 +49,10 @@ -(NSInteger)extremeDrawnPointIndexForFlags:(nonnull BOOL *)pointDrawFlags number -(nonnull CGPathRef)newDataLinePathForViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange baselineYValue:(CGFloat)baselineYValue; -(nonnull CGPathRef)newCurvedDataLinePathForViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange baselineYValue:(CGFloat)baselineYValue; --(void)computeControlPoints:(nonnull CGPoint *)cp1 points2:(nonnull CGPoint *)cp2 forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange; +-(void)computeBezierControlPoints:(nonnull CGPoint *)cp1 points2:(nonnull CGPoint *)cp2 forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange; +-(void)computeCatmullRomControlPoints:(nonnull CGPoint *)points points2:(nonnull CGPoint *)points2 withAlpha:(CGFloat)alpha forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange; +-(void)computeHermiteControlPoints:(nonnull CGPoint *)points points2:(nonnull CGPoint *)points2 forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange; +-(BOOL)monotonicViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange; @end @@ -82,6 +85,19 @@ @implementation CPTScatterPlot **/ @synthesize histogramOption; +/** @property CPTScatterPlotCurvedInterpolationOption curvedInterpolationOption + * @brief The interpolation method used to generate the curved plot line (@ref interpolation = #CPTScatterPlotInterpolationCurved) + * Default is #CPTScatterPlotCurvedInterpolationNormal + **/ +@synthesize curvedInterpolationOption; + +/** @property CGFloat curvedInterpolationCustomAlpha + * @brief The custom alpha value used when the #CPTScatterPlotCurvedInterpolationCatmullCustomAlpha interpolation is selected. + * Default is @num{0.5}. + * @note Must be between @num{0.0} and @num{1.0}. + **/ +@synthesize curvedInterpolationCustomAlpha; + /** @property nullable CPTLineStyle *dataLineStyle * @brief The line style for the data line. * If @nil, the line is not drawn. @@ -166,7 +182,7 @@ @implementation CPTScatterPlot **/ @synthesize pointingDeviceDownOnLine; -/** @property nullable CPTLimitBandArray areaFillBands +/** @property nullable CPTLimitBandArray *areaFillBands * @brief An array of CPTLimitBand objects. * * The limit bands are drawn between the plot line and areaBaseValue and on top of the areaFill. @@ -180,7 +196,7 @@ @implementation CPTScatterPlot /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -190,6 +206,7 @@ +(void)initialize [self exposeBinding:CPTScatterPlotBindingPlotSymbols]; } } + #endif /// @endcond @@ -211,6 +228,8 @@ +(void)initialize * - @ref allowSimultaneousSymbolAndPlotSelection = NO * - @ref interpolation = #CPTScatterPlotInterpolationLinear * - @ref histogramOption = #CPTScatterPlotHistogramNormal + * - @ref curvedInterpolationOption = #CPTScatterPlotCurvedInterpolationNormal + * - @ref curvedInterpolationCustomAlpha = @num{0.5} * - @ref labelField = #CPTScatterPlotFieldY * * @param newFrame The frame rectangle. @@ -218,7 +237,7 @@ +(void)initialize **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { dataLineStyle = [[CPTLineStyle alloc] init]; plotSymbol = nil; areaFill = nil; @@ -229,6 +248,8 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame plotLineMarginForHitDetection = CPTFloat(4.0); interpolation = CPTScatterPlotInterpolationLinear; histogramOption = CPTScatterPlotHistogramNormal; + curvedInterpolationOption = CPTScatterPlotCurvedInterpolationNormal; + curvedInterpolationCustomAlpha = CPTFloat(0.5); pointingDeviceDownIndex = NSNotFound; pointingDeviceDownOnLine = NO; mutableAreaFillBands = nil; @@ -243,7 +264,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTScatterPlot *theLayer = (CPTScatterPlot *)layer; dataLineStyle = theLayer->dataLineStyle; @@ -257,6 +278,8 @@ -(nonnull instancetype)initWithLayer:(nonnull id)layer allowSimultaneousSymbolAndPlotSelection = theLayer->allowSimultaneousSymbolAndPlotSelection; interpolation = theLayer->interpolation; histogramOption = theLayer->histogramOption; + curvedInterpolationOption = theLayer->curvedInterpolationOption; + curvedInterpolationCustomAlpha = theLayer->curvedInterpolationCustomAlpha; mutableAreaFillBands = theLayer->mutableAreaFillBands; pointingDeviceDownIndex = NSNotFound; pointingDeviceDownOnLine = NO; @@ -277,6 +300,8 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder [coder encodeInteger:self.interpolation forKey:@"CPTScatterPlot.interpolation"]; [coder encodeInteger:self.histogramOption forKey:@"CPTScatterPlot.histogramOption"]; + [coder encodeInteger:self.curvedInterpolationOption forKey:@"CPTScatterPlot.curvedInterpolationOption"]; + [coder encodeCGFloat:self.curvedInterpolationCustomAlpha forKey:@"CPTScatterPlot.curvedInterpolationCustomAlpha"]; [coder encodeObject:self.dataLineStyle forKey:@"CPTScatterPlot.dataLineStyle"]; [coder encodeObject:self.plotSymbol forKey:@"CPTScatterPlot.plotSymbol"]; [coder encodeObject:self.areaFill forKey:@"CPTScatterPlot.areaFill"]; @@ -295,16 +320,25 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - interpolation = (CPTScatterPlotInterpolation)[coder decodeIntegerForKey:@"CPTScatterPlot.interpolation"]; - histogramOption = (CPTScatterPlotHistogramOption)[coder decodeIntegerForKey:@"CPTScatterPlot.histogramOption"]; - dataLineStyle = [[coder decodeObjectForKey:@"CPTScatterPlot.dataLineStyle"] copy]; - plotSymbol = [[coder decodeObjectForKey:@"CPTScatterPlot.plotSymbol"] copy]; - areaFill = [[coder decodeObjectForKey:@"CPTScatterPlot.areaFill"] copy]; - areaFill2 = [[coder decodeObjectForKey:@"CPTScatterPlot.areaFill2"] copy]; - mutableAreaFillBands = [[coder decodeObjectForKey:@"CPTScatterPlot.mutableAreaFillBands"] mutableCopy]; - areaBaseValue = [coder decodeObjectForKey:@"CPTScatterPlot.areaBaseValue"]; - areaBaseValue2 = [coder decodeObjectForKey:@"CPTScatterPlot.areaBaseValue2"]; + if ((self = [super initWithCoder:coder])) { + interpolation = (CPTScatterPlotInterpolation)[coder decodeIntegerForKey:@"CPTScatterPlot.interpolation"]; + histogramOption = (CPTScatterPlotHistogramOption)[coder decodeIntegerForKey:@"CPTScatterPlot.histogramOption"]; + curvedInterpolationOption = (CPTScatterPlotCurvedInterpolationOption)[coder decodeIntegerForKey:@"CPTScatterPlot.curvedInterpolationOption"]; + curvedInterpolationCustomAlpha = [coder decodeCGFloatForKey:@"CPTScatterPlot.curvedInterpolationCustomAlpha"]; + dataLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTScatterPlot.dataLineStyle"] copy]; + plotSymbol = [[coder decodeObjectOfClass:[CPTPlotSymbol class] + forKey:@"CPTScatterPlot.plotSymbol"] copy]; + areaFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTScatterPlot.areaFill"] copy]; + areaFill2 = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTScatterPlot.areaFill2"] copy]; + mutableAreaFillBands = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTLimitBand class]]] + forKey:@"CPTScatterPlot.mutableAreaFillBands"] mutableCopy]; + areaBaseValue = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTScatterPlot.areaBaseValue"]; + areaBaseValue2 = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTScatterPlot.areaBaseValue2"]; plotSymbolMarginForHitDetection = [coder decodeCGFloatForKey:@"CPTScatterPlot.plotSymbolMarginForHitDetection"]; plotLineMarginForHitDetection = [coder decodeCGFloatForKey:@"CPTScatterPlot.plotLineMarginForHitDetection"]; allowSimultaneousSymbolAndPlotSelection = [coder decodeBoolForKey:@"CPTScatterPlot.allowSimultaneousSymbolAndPlotSelection"]; @@ -316,6 +350,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Data Loading @@ -374,9 +420,9 @@ -(void)reloadPlotSymbolsInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(symbolForScatterPlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - CPTMutablePlotSymbolArray array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutablePlotSymbolArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTPlotSymbol *symbol = [theDataSource symbolForScatterPlot:self recordIndex:idx]; @@ -410,7 +456,7 @@ -(nullable CPTPlotSymbol *)plotSymbolForRecordIndex:(NSUInteger)idx { CPTPlotSymbol *symbol = [self cachedValueForKey:CPTScatterPlotBindingPlotSymbols recordIndex:idx]; - if ( (symbol == nil) || (symbol == [CPTPlot nilData]) ) { + if ((symbol == nil) || (symbol == [CPTPlot nilData])) { symbol = self.plotSymbol; } @@ -430,16 +476,16 @@ -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnul CPTLineStyle *lineStyle = self.dataLineStyle; - if ( self.areaFill || self.areaFill2 || lineStyle.dashPattern || lineStyle.lineFill || (self.interpolation == CPTScatterPlotInterpolationCurved) ) { + if ( self.areaFill || self.areaFill2 || lineStyle.dashPattern || lineStyle.lineFill || (self.interpolation == CPTScatterPlotInterpolationCurved)) { // show all points to preserve the line dash and area fills for ( NSUInteger i = 0; i < dataCount; i++ ) { pointDrawFlags[i] = YES; } } else { - CPTPlotRangeComparisonResult *xRangeFlags = malloc( dataCount * sizeof(CPTPlotRangeComparisonResult) ); - CPTPlotRangeComparisonResult *yRangeFlags = malloc( dataCount * sizeof(CPTPlotRangeComparisonResult) ); - BOOL *nanFlags = malloc( dataCount * sizeof(BOOL) ); + CPTPlotRangeComparisonResult *xRangeFlags = calloc(dataCount, sizeof(CPTPlotRangeComparisonResult)); + CPTPlotRangeComparisonResult *yRangeFlags = calloc(dataCount, sizeof(CPTPlotRangeComparisonResult)); + BOOL *nanFlags = calloc(dataCount, sizeof(BOOL)); CPTPlotRange *xRange = xyPlotSpace.xRange; CPTPlotRange *yRange = xyPlotSpace.yRange; @@ -454,7 +500,7 @@ -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnul const double y = yBytes[i]; CPTPlotRangeComparisonResult xFlag = [xRange compareToDouble:x]; - xRangeFlags[i] = xFlag; + xRangeFlags[i] = xFlag; if ( xFlag != CPTPlotRangeComparisonResultNumberInRange ) { yRangeFlags[i] = CPTPlotRangeComparisonResultNumberInRange; // if x is out of range, then y doesn't matter } @@ -474,7 +520,7 @@ -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnul const NSDecimal y = yBytes[i]; CPTPlotRangeComparisonResult xFlag = [xRange compareToDecimal:x]; - xRangeFlags[i] = xFlag; + xRangeFlags[i] = xFlag; if ( xFlag != CPTPlotRangeComparisonResultNumberInRange ) { yRangeFlags[i] = CPTPlotRangeComparisonResultNumberInRange; // if x is out of range, then y doesn't matter } @@ -490,7 +536,7 @@ -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnul // are included. This ensures no lines are left out that shouldn't be. CPTScatterPlotInterpolation theInterpolation = self.interpolation; - memset( pointDrawFlags, NO, dataCount * sizeof(BOOL) ); + memset(pointDrawFlags, NO, dataCount * sizeof(BOOL)); if ( dataCount > 0 ) { pointDrawFlags[0] = (xRangeFlags[0] == CPTPlotRangeComparisonResultNumberInRange && yRangeFlags[0] == CPTPlotRangeComparisonResultNumberInRange && @@ -498,9 +544,9 @@ -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnul } if ( visibleOnly ) { for ( NSUInteger i = 1; i < dataCount; i++ ) { - if ( (xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - !nanFlags[i] ) { + if ((xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + !nanFlags[i] ) { pointDrawFlags[i] = YES; } } @@ -510,13 +556,13 @@ -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnul case CPTScatterPlotInterpolationCurved: // Keep 2 points outside of the visible area on each side to maintain the correct curvature of the line if ( dataCount > 1 ) { - if ( !nanFlags[0] && !nanFlags[1] && ( (xRangeFlags[0] != xRangeFlags[1]) || (yRangeFlags[0] != yRangeFlags[1]) ) ) { + if ( !nanFlags[0] && !nanFlags[1] && ((xRangeFlags[0] != xRangeFlags[1]) || (yRangeFlags[0] != yRangeFlags[1]))) { pointDrawFlags[0] = YES; pointDrawFlags[1] = YES; } - else if ( (xRangeFlags[1] == CPTPlotRangeComparisonResultNumberInRange) && - (yRangeFlags[1] == CPTPlotRangeComparisonResultNumberInRange) && - !nanFlags[1] ) { + else if ((xRangeFlags[1] == CPTPlotRangeComparisonResultNumberInRange) && + (yRangeFlags[1] == CPTPlotRangeComparisonResultNumberInRange) && + !nanFlags[1] ) { pointDrawFlags[1] = YES; } } @@ -527,14 +573,14 @@ -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnul pointDrawFlags[i - 1] = YES; pointDrawFlags[i] = YES; } - else if ( !nanFlags[i - 1] && !nanFlags[i] && ( (xRangeFlags[i - 1] != xRangeFlags[i]) || (yRangeFlags[i - 1] != yRangeFlags[i]) ) ) { + else if ( !nanFlags[i - 1] && !nanFlags[i] && ((xRangeFlags[i - 1] != xRangeFlags[i]) || (yRangeFlags[i - 1] != yRangeFlags[i]))) { pointDrawFlags[i - 2] = YES; pointDrawFlags[i - 1] = YES; pointDrawFlags[i] = YES; } - else if ( (xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - !nanFlags[i] ) { + else if ((xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + !nanFlags[i] ) { pointDrawFlags[i] = YES; } } @@ -543,13 +589,13 @@ -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnul default: // Keep 1 point outside of the visible area on each side for ( NSUInteger i = 1; i < dataCount; i++ ) { - if ( !nanFlags[i - 1] && !nanFlags[i] && ( (xRangeFlags[i - 1] != xRangeFlags[i]) || (yRangeFlags[i - 1] != yRangeFlags[i]) ) ) { + if ( !nanFlags[i - 1] && !nanFlags[i] && ((xRangeFlags[i - 1] != xRangeFlags[i]) || (yRangeFlags[i - 1] != yRangeFlags[i]))) { pointDrawFlags[i - 1] = YES; pointDrawFlags[i] = YES; } - else if ( (xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - !nanFlags[i] ) { + else if ((xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + !nanFlags[i] ) { pointDrawFlags[i] = YES; } } @@ -575,7 +621,7 @@ -(void)calculateViewPoints:(nonnull CGPoint *)viewPoints withDrawPointFlags:(non dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { const double x = xBytes[i]; const double y = yBytes[i]; - if ( !drawPointFlags[i] || isnan(x) || isnan(y) ) { + if ( !drawPointFlags[i] || isnan(x) || isnan(y)) { viewPoints[i] = CPTPointMake(NAN, NAN); } else { @@ -597,7 +643,7 @@ -(void)calculateViewPoints:(nonnull CGPoint *)viewPoints withDrawPointFlags:(non dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { const NSDecimal x = xBytes[i]; const NSDecimal y = yBytes[i]; - if ( !drawPointFlags[i] || NSDecimalIsNotANumber(&x) || NSDecimalIsNotANumber(&y) ) { + if ( !drawPointFlags[i] || NSDecimalIsNotANumber(&x) || NSDecimalIsNotANumber(&y)) { viewPoints[i] = CPTPointMake(NAN, NAN); } else { @@ -615,7 +661,7 @@ -(void)alignViewPointsToUserSpace:(nonnull CGPoint *)viewPoints withContext:(non { // Align to device pixels if there is a data line. // Otherwise, align to view space, so fills are sharp at edges. - if ( self.dataLineStyle.lineWidth > CPTFloat(0.0) ) { + if ( self.dataLineStyle.lineWidth > CPTFloat(0.0)) { dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { if ( drawPointFlags[i] ) { viewPoints[i] = CPTAlignPointToUserSpace(context, viewPoints[i]); @@ -643,7 +689,7 @@ -(NSInteger)extremeDrawnPointIndexForFlags:(nonnull BOOL *)pointDrawFlags number result = i; break; } - if ( (delta < 0) && (i == 0) ) { + if ((delta < 0) && (i == 0)) { break; } } @@ -672,10 +718,10 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point -(NSUInteger)indexOfVisiblePointClosestToPlotAreaPoint:(CGPoint)viewPoint { NSUInteger dataCount = self.cachedDataCount; - CGPoint *viewPoints = calloc( dataCount, sizeof(CGPoint) ); - BOOL *drawPointFlags = calloc( dataCount, sizeof(BOOL) ); + CGPoint *viewPoints = calloc(dataCount, sizeof(CGPoint)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); - [self calculatePointsToDraw:drawPointFlags forPlotSpace:(id)self.plotSpace includeVisiblePointsOnly:YES numberOfPoints:dataCount]; + [self calculatePointsToDraw:drawPointFlags forPlotSpace:(CPTXYPlotSpace *)self.plotSpace includeVisiblePointsOnly:YES numberOfPoints:dataCount]; [self calculateViewPoints:viewPoints withDrawPointFlags:drawPointFlags numberOfPoints:dataCount]; NSInteger result = [self extremeDrawnPointIndexForFlags:drawPointFlags numberOfPoints:dataCount extremeNumIsLowerBound:YES]; @@ -684,7 +730,7 @@ -(NSUInteger)indexOfVisiblePointClosestToPlotAreaPoint:(CGPoint)viewPoint for ( NSUInteger i = (NSUInteger)result; i < dataCount; ++i ) { if ( drawPointFlags[i] ) { CGFloat distanceSquared = squareOfDistanceBetweenPoints(viewPoint, viewPoints[i]); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = (NSInteger)i; } @@ -741,14 +787,14 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CPTMutableNumericData *xValueData = [self cachedNumbersForField:CPTScatterPlotFieldX]; CPTMutableNumericData *yValueData = [self cachedNumbersForField:CPTScatterPlotFieldY]; - if ( (xValueData == nil) || (yValueData == nil) ) { + if ((xValueData == nil) || (yValueData == nil)) { return; } NSUInteger dataCount = self.cachedDataCount; if ( dataCount == 0 ) { return; } - if ( !(self.dataLineStyle || self.areaFill || self.areaFill2 || self.plotSymbol || self.plotSymbols.count) ) { + if ( !(self.dataLineStyle || self.areaFill || self.areaFill2 || self.plotSymbol || self.plotSymbols.count)) { return; } if ( xValueData.numberOfSamples != yValueData.numberOfSamples ) { @@ -758,8 +804,8 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context [super renderAsVectorInContext:context]; // Calculate view points, and align to user space - CGPoint *viewPoints = malloc( dataCount * sizeof(CGPoint) ); - BOOL *drawPointFlags = malloc( dataCount * sizeof(BOOL) ); + CGPoint *viewPoints = calloc(dataCount, sizeof(CGPoint)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = (CPTXYPlotSpace *)self.plotSpace; [self calculatePointsToDraw:drawPointFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:NO numberOfPoints:dataCount]; @@ -775,11 +821,11 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context NSInteger firstDrawnPointIndex = [self extremeDrawnPointIndexForFlags:drawPointFlags numberOfPoints:dataCount extremeNumIsLowerBound:YES]; if ( firstDrawnPointIndex != NSNotFound ) { - NSRange viewIndexRange = NSMakeRange( (NSUInteger)firstDrawnPointIndex, (NSUInteger)(lastDrawnPointIndex - firstDrawnPointIndex + 1) ); + NSRange viewIndexRange = NSMakeRange((NSUInteger)firstDrawnPointIndex, (NSUInteger)(lastDrawnPointIndex - firstDrawnPointIndex + 1)); - CPTPlotArea *thePlotArea = self.plotArea; - CPTLineStyle *theLineStyle = self.dataLineStyle; - CPTMutableLimitBandArray fillBands = self.mutableAreaFillBands; + CPTPlotArea *thePlotArea = self.plotArea; + CPTLineStyle *theLineStyle = self.dataLineStyle; + CPTMutableLimitBandArray *fillBands = self.mutableAreaFillBands; // Draw fills NSDecimal theAreaBaseValue; @@ -801,8 +847,8 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context theAreaBaseValue = CPTDecimalNaN(); break; } - if ( !NSDecimalIsNotANumber(&theAreaBaseValue) ) { - if ( theFill || ( (i == 0) && fillBands ) ) { + if ( !NSDecimalIsNotANumber(&theAreaBaseValue)) { + if ( theFill || ((i == 0) && fillBands)) { // clear the plot shadow if any--not needed for fills when the plot has a data line if ( theLineStyle ) { CGContextSaveGState(context); @@ -827,8 +873,8 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context } // Draw fill bands - if ( (i == 0) && fillBands ) { - CGFloat height = CPTFloat( CGBitmapContextGetHeight(context) ); + if ((i == 0) && fillBands ) { + CGFloat height = CPTFloat(CGBitmapContextGetHeight(context)); for ( CPTLimitBand *band in fillBands ) { CGContextSaveGState(context); @@ -846,7 +892,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context maxPoint = CPTAlignIntegralPointToUserSpace(context, maxPoint); } - CGContextClipToRect( context, CGRectMake(minPoint.x, 0.0, maxPoint.x - minPoint.x, height) ); + CGContextClipToRect(context, CGRectMake(minPoint.x, 0.0, maxPoint.x - minPoint.x, height)); CGContextBeginPath(context); CGContextAddPath(context, dataLinePath); @@ -870,7 +916,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CGPathRef dataLinePath = [self newDataLinePathForViewPoints:viewPoints indexRange:viewIndexRange baselineYValue:CPTNAN]; // Give the delegate a chance to prepare for the drawing. - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(scatterPlot:prepareForDrawingPlotLine:inContext:)] ) { [theDelegate scatterPlot:self prepareForDrawingPlotLine:dataLinePath inContext:context]; } @@ -938,9 +984,9 @@ -(nonnull CGPathRef)newDataLinePathForViewPoints:(nonnull CGPoint *)viewPoints i for ( NSUInteger i = indexRange.location; i <= lastDrawnPointIndex; i++ ) { CGPoint viewPoint = viewPoints[i]; - if ( isnan(viewPoint.x) || isnan(viewPoint.y) ) { + if ( isnan(viewPoint.x) || isnan(viewPoint.y)) { if ( !lastPointSkipped ) { - if ( !isnan(baselineYValue) ) { + if ( !isnan(baselineYValue)) { CGPathAddLineToPoint(dataLinePath, NULL, lastPoint.x, baselineYValue); CGPathAddLineToPoint(dataLinePath, NULL, firstPoint.x, baselineYValue); CGPathCloseSubpath(dataLinePath); @@ -987,7 +1033,7 @@ -(nonnull CGPathRef)newDataLinePathForViewPoints:(nonnull CGPoint *)viewPoints i } } - if ( !lastPointSkipped && !isnan(baselineYValue) ) { + if ( !lastPointSkipped && !isnan(baselineYValue)) { CGPathAddLineToPoint(dataLinePath, NULL, lastPoint.x, baselineYValue); CGPathAddLineToPoint(dataLinePath, NULL, firstPoint.x, baselineYValue); CGPathCloseSubpath(dataLinePath); @@ -1005,9 +1051,11 @@ -(nonnull CGPathRef)newCurvedDataLinePathForViewPoints:(nonnull CGPoint *)viewPo NSUInteger firstIndex = indexRange.location; NSUInteger lastDrawnPointIndex = NSMaxRange(indexRange); + CPTScatterPlotCurvedInterpolationOption interpolationOption = self.curvedInterpolationOption; + if ( lastDrawnPointIndex > 0 ) { - CGPoint *controlPoints1 = calloc( lastDrawnPointIndex, sizeof(CGPoint) ); - CGPoint *controlPoints2 = calloc( lastDrawnPointIndex, sizeof(CGPoint) ); + CGPoint *controlPoints1 = calloc(lastDrawnPointIndex, sizeof(CGPoint)); + CGPoint *controlPoints2 = calloc(lastDrawnPointIndex, sizeof(CGPoint)); lastDrawnPointIndex--; @@ -1015,12 +1063,56 @@ -(nonnull CGPathRef)newCurvedDataLinePathForViewPoints:(nonnull CGPoint *)viewPo for ( NSUInteger i = indexRange.location; i <= lastDrawnPointIndex; i++ ) { CGPoint viewPoint = viewPoints[i]; - if ( isnan(viewPoint.x) || isnan(viewPoint.y) ) { + if ( isnan(viewPoint.x) || isnan(viewPoint.y)) { if ( !lastPointSkipped ) { - [self computeControlPoints:controlPoints1 - points2:controlPoints2 - forViewPoints:viewPoints - indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + switch ( interpolationOption ) { + case CPTScatterPlotCurvedInterpolationNormal: + [self computeBezierControlPoints:controlPoints1 + points2:controlPoints2 + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomUniform: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(0.0) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomCentripetal: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(0.5) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomChordal: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(1.0) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + + break; + + case CPTScatterPlotCurvedInterpolationHermiteCubic: + [self computeHermiteControlPoints:controlPoints1 + points2:controlPoints2 + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullCustomAlpha: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:self.curvedInterpolationCustomAlpha + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + break; + } lastPointSkipped = YES; } @@ -1034,10 +1126,55 @@ -(nonnull CGPathRef)newCurvedDataLinePathForViewPoints:(nonnull CGPoint *)viewPo } if ( !lastPointSkipped ) { - [self computeControlPoints:controlPoints1 - points2:controlPoints2 - forViewPoints:viewPoints - indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + switch ( interpolationOption ) { + case CPTScatterPlotCurvedInterpolationNormal: + [self computeBezierControlPoints:controlPoints1 + points2:controlPoints2 + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomUniform: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(0.0) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomCentripetal: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(0.5) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomChordal: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(1.0) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + + break; + + case CPTScatterPlotCurvedInterpolationHermiteCubic: + [self computeHermiteControlPoints:controlPoints1 + points2:controlPoints2 + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullCustomAlpha: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:self.curvedInterpolationCustomAlpha + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + break; + } } // Build the path @@ -1045,9 +1182,9 @@ -(nonnull CGPathRef)newCurvedDataLinePathForViewPoints:(nonnull CGPoint *)viewPo for ( NSUInteger i = indexRange.location; i <= lastDrawnPointIndex; i++ ) { CGPoint viewPoint = viewPoints[i]; - if ( isnan(viewPoint.x) || isnan(viewPoint.y) ) { + if ( isnan(viewPoint.x) || isnan(viewPoint.y)) { if ( !lastPointSkipped ) { - if ( !isnan(baselineYValue) ) { + if ( !isnan(baselineYValue)) { CGPathAddLineToPoint(dataLinePath, NULL, lastPoint.x, baselineYValue); CGPathAddLineToPoint(dataLinePath, NULL, firstPoint.x, baselineYValue); CGPathCloseSubpath(dataLinePath); @@ -1071,13 +1208,13 @@ -(nonnull CGPathRef)newCurvedDataLinePathForViewPoints:(nonnull CGPoint *)viewPo // add the control points CGPathMoveToPoint(dataLinePath, NULL, cp1.x - CPTFloat(5.0), cp1.y); CGPathAddLineToPoint(dataLinePath, NULL, cp1.x + CPTFloat(5.0), cp1.y); - CGPathMoveToPoint( dataLinePath, NULL, cp1.x, cp1.y - CPTFloat(5.0) ); - CGPathAddLineToPoint( dataLinePath, NULL, cp1.x, cp1.y + CPTFloat(5.0) ); + CGPathMoveToPoint(dataLinePath, NULL, cp1.x, cp1.y - CPTFloat(5.0)); + CGPathAddLineToPoint(dataLinePath, NULL, cp1.x, cp1.y + CPTFloat(5.0)); - CGPathMoveToPoint( dataLinePath, NULL, cp2.x - CPTFloat(3.5), cp2.y - CPTFloat(3.5) ); - CGPathAddLineToPoint( dataLinePath, NULL, cp2.x + CPTFloat(3.5), cp2.y + CPTFloat(3.5) ); - CGPathMoveToPoint( dataLinePath, NULL, cp2.x + CPTFloat(3.5), cp2.y - CPTFloat(3.5) ); - CGPathAddLineToPoint( dataLinePath, NULL, cp2.x - CPTFloat(3.5), cp2.y + CPTFloat(3.5) ); + CGPathMoveToPoint(dataLinePath, NULL, cp2.x - CPTFloat(3.5), cp2.y - CPTFloat(3.5)); + CGPathAddLineToPoint(dataLinePath, NULL, cp2.x + CPTFloat(3.5), cp2.y + CPTFloat(3.5)); + CGPathMoveToPoint(dataLinePath, NULL, cp2.x + CPTFloat(3.5), cp2.y - CPTFloat(3.5)); + CGPathAddLineToPoint(dataLinePath, NULL, cp2.x - CPTFloat(3.5), cp2.y + CPTFloat(3.5)); // add a line connecting the control points CGPathMoveToPoint(dataLinePath, NULL, cp1.x, cp1.y); @@ -1092,7 +1229,7 @@ -(nonnull CGPathRef)newCurvedDataLinePathForViewPoints:(nonnull CGPoint *)viewPo } } - if ( !lastPointSkipped && !isnan(baselineYValue) ) { + if ( !lastPointSkipped && !isnan(baselineYValue)) { CGPathAddLineToPoint(dataLinePath, NULL, lastPoint.x, baselineYValue); CGPathAddLineToPoint(dataLinePath, NULL, firstPoint.x, baselineYValue); CGPathCloseSubpath(dataLinePath); @@ -1105,9 +1242,238 @@ -(nonnull CGPathRef)newCurvedDataLinePathForViewPoints:(nonnull CGPoint *)viewPo return dataLinePath; } +/** @brief Compute the control points using a catmull-rom spline. + * @param points A pointer to the array which should hold the first control points. + * @param points2 A pointer to the array which should hold the second control points. + * @param alpha The alpha value used for the catmull-rom interpolation. + * @param viewPoints A pointer to the array which holds all view points for which the interpolation should be calculated. + * @param indexRange The range in which the interpolation should occur. + * @warning The @par{indexRange} must be valid for all passed arrays otherwise this method crashes. + **/ +-(void)computeCatmullRomControlPoints:(nonnull CGPoint *)points points2:(nonnull CGPoint *)points2 withAlpha:(CGFloat)alpha forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange +{ + if ( indexRange.length >= 2 ) { + NSUInteger startIndex = indexRange.location; + NSUInteger endIndex = NSMaxRange(indexRange) - 1; // the index starts at zero + NSUInteger segmentCount = endIndex - 1; // there are n - 1 segments + + CGFloat epsilon = CPTFloat(1.0e-5); // the minimum point distance. below that no interpolation happens. + + for ( NSUInteger index = startIndex; index <= segmentCount; index++ ) { + // calculate the control for the segment from index -> index + 1 + CGPoint p0, p1, p2, p3; // the view point + + // the internal points are always valid + p1 = viewPoints[index]; + p2 = viewPoints[index + 1]; + // account for first and last segment + if ( index == startIndex ) { + p0 = p1; + } + else { + p0 = viewPoints[index - 1]; + } + if ( index == segmentCount ) { + p3 = p2; + } + else { + p3 = viewPoints[index + 2]; + } + + // distance between the points + CGFloat d1 = hypot(p1.x - p0.x, p1.y - p0.y); + CGFloat d2 = hypot(p2.x - p1.x, p2.y - p1.y); + CGFloat d3 = hypot(p3.x - p2.x, p3.y - p2.y); + // constants + CGFloat d1_a = pow(d1, alpha); // d1^alpha + CGFloat d2_a = pow(d2, alpha); // d2^alpha + CGFloat d3_a = pow(d3, alpha); // d3^alpha + CGFloat d1_2a = pow(d1_a, CPTFloat(2.0)); // d1^alpha^2 = d1^2*alpha + CGFloat d2_2a = pow(d2_a, CPTFloat(2.0)); // d2^alpha^2 = d2^2*alpha + CGFloat d3_2a = pow(d3_a, CPTFloat(2.0)); // d3^alpha^2 = d3^2*alpha + + // calculate the control points + // see : http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf under point 3. + CGPoint cp1, cp2; // the calculated view points; + if ( fabs(d1) <= epsilon ) { + cp1 = p1; + } + else { + CGFloat divisor = CPTFloat(3.0) * d1_a * (d1_a + d2_a); + cp1 = CPTPointMake((p2.x * d1_2a - p0.x * d2_2a + (2 * d1_2a + 3 * d1_a * d2_a + d2_2a) * p1.x) / divisor, + (p2.y * d1_2a - p0.y * d2_2a + (2 * d1_2a + 3 * d1_a * d2_a + d2_2a) * p1.y) / divisor + ); + } + + if ( fabs(d3) <= epsilon ) { + cp2 = p2; + } + else { + CGFloat divisor = 3 * d3_a * (d3_a + d2_a); + cp2 = CPTPointMake((d3_2a * p1.x - d2_2a * p3.x + (2 * d3_2a + 3 * d3_a * d2_a + d2_2a) * p2.x) / divisor, + (d3_2a * p1.y - d2_2a * p3.y + (2 * d3_2a + 3 * d3_a * d2_a + d2_2a) * p2.y) / divisor); + } + + points[index + 1] = cp1; + points2[index + 1] = cp2; + } + } +} + +/** @brief Compute the control points using a hermite cubic spline. + * + * If the view points are monotonically increasing or decreasing in both @par{x} and @par{y}, + * the smoothed curve will be also. + * + * @param points A pointer to the array which should hold the first control points. + * @param points2 A pointer to the array which should hold the second control points. + * @param viewPoints A pointer to the array which holds all view points for which the interpolation should be calculated. + * @param indexRange The range in which the interpolation should occur. + * @warning The @par{indexRange} must be valid for all passed arrays otherwise this method crashes. + **/ +-(void)computeHermiteControlPoints:(nonnull CGPoint *)points points2:(nonnull CGPoint *)points2 forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange +{ + // See https://en.wikipedia.org/wiki/Cubic_Hermite_spline and https://en.m.wikipedia.org/wiki/Monotone_cubic_interpolation for a discussion of algorithms used. + if ( indexRange.length >= 2 ) { + NSUInteger startIndex = indexRange.location; + NSUInteger lastIndex = NSMaxRange(indexRange) - 1; // last accessible element in view points + + BOOL monotonic = [self monotonicViewPoints:viewPoints indexRange:indexRange]; + + for ( NSUInteger index = startIndex; index <= lastIndex; index++ ) { + CGVector m; + CGPoint p1 = viewPoints[index]; + + if ( index == startIndex ) { + CGPoint p2 = viewPoints[index + 1]; + + m.dx = p2.x - p1.x; + m.dy = p2.y - p1.y; + } + else if ( index == lastIndex ) { + CGPoint p0 = viewPoints[index - 1]; + + m.dx = p1.x - p0.x; + m.dy = p1.y - p0.y; + } + else { // index > startIndex && index < numberOfPoints + CGPoint p0 = viewPoints[index - 1]; + CGPoint p2 = viewPoints[index + 1]; + + m.dx = p2.x - p0.x; + m.dy = p2.y - p0.y; + + if ( monotonic ) { + if ( m.dx > CPTFloat(0.0)) { + m.dx = MIN(p2.x - p1.x, p1.x - p0.x); + } + else if ( m.dx < CPTFloat(0.0)) { + m.dx = MAX(p2.x - p1.x, p1.x - p0.x); + } + + if ( m.dy > CPTFloat(0.0)) { + m.dy = MIN(p2.y - p1.y, p1.y - p0.y); + } + else if ( m.dy < CPTFloat(0.0)) { + m.dy = MAX(p2.y - p1.y, p1.y - p0.y); + } + } + } + + // get control points + m.dx /= CPTFloat(6.0); + m.dy /= CPTFloat(6.0); + + CGPoint rhsControlPoint = CPTPointMake(p1.x + m.dx, p1.y + m.dy); + CGPoint lhsControlPoint = CPTPointMake(p1.x - m.dx, p1.y - m.dy); + + // We calculated the lhs & rhs control point. The rhs control point is the first control point for the curve to the next point. The lhs control point is the second control point for the curve to the current point. + + points2[index] = lhsControlPoint; + if ( index + 1 <= lastIndex ) { + points[index + 1] = rhsControlPoint; + } + } + } +} + +/** @brief Determine whether the plot points form a monotonic series. + * @param viewPoints A pointer to the array which holds all view points for which the interpolation should be calculated. + * @param indexRange The range in which the interpolation should occur. + * @return Returns @YES if the viewpoints are monotonically increasing or decreasing in both @par{x} and @par{y}. + * @warning The @par{indexRange} must be valid for all passed arrays otherwise this method crashes. + **/ +-(BOOL)monotonicViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange +{ + if ( indexRange.length < 2 ) { + return YES; + } + + NSUInteger startIndex = indexRange.location; + NSUInteger lastIndex = NSMaxRange(indexRange) - 2; + + BOOL foundTrendX = NO; + BOOL foundTrendY = NO; + BOOL isIncreasingX = NO; + BOOL isIncreasingY = NO; + + for ( NSUInteger index = startIndex; index <= lastIndex; index++ ) { + CGPoint p1 = viewPoints[index]; + CGPoint p2 = viewPoints[index + 1]; + + if ( !foundTrendX ) { + if ( p2.x > p1.x ) { + isIncreasingX = YES; + foundTrendX = YES; + } + else if ( p2.x < p1.x ) { + foundTrendX = YES; + } + } + + if ( foundTrendX ) { + if ( isIncreasingX ) { + if ( p2.x < p1.x ) { + return NO; + } + } + else { + if ( p2.x > p1.x ) { + return NO; + } + } + } + + if ( !foundTrendY ) { + if ( p2.y > p1.y ) { + isIncreasingY = YES; + foundTrendY = YES; + } + else if ( p2.y < p1.y ) { + foundTrendY = YES; + } + } + + if ( foundTrendY ) { + if ( isIncreasingY ) { + if ( p2.y < p1.y ) { + return NO; + } + } + else { + if ( p2.y > p1.y ) { + return NO; + } + } + } + } + + return YES; +} + // Compute the control points using the algorithm described at http://www.particleincell.com/blog/2012/bezier-splines/ // cp1, cp2, and viewPoints should point to arrays of points with at least NSMaxRange(indexRange) elements each. --(void)computeControlPoints:(nonnull CGPoint *)cp1 points2:(nonnull CGPoint *)cp2 forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange +-(void)computeBezierControlPoints:(nonnull CGPoint *)cp1 points2:(nonnull CGPoint *)cp2 forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange { if ( indexRange.length == 2 ) { NSUInteger rangeEnd = NSMaxRange(indexRange) - 1; @@ -1118,10 +1484,10 @@ -(void)computeControlPoints:(nonnull CGPoint *)cp1 points2:(nonnull CGPoint *)cp NSUInteger n = indexRange.length - 1; // rhs vector - CGPoint *a = malloc( n * sizeof(CGPoint) ); - CGPoint *b = malloc( n * sizeof(CGPoint) ); - CGPoint *c = malloc( n * sizeof(CGPoint) ); - CGPoint *r = malloc( n * sizeof(CGPoint) ); + CGPoint *a = calloc(n, sizeof(CGPoint)); + CGPoint *b = calloc(n, sizeof(CGPoint)); + CGPoint *c = calloc(n, sizeof(CGPoint)); + CGPoint *r = calloc(n, sizeof(CGPoint)); // left most segment a[0] = CGPointZero; @@ -1168,11 +1534,11 @@ -(void)computeControlPoints:(nonnull CGPoint *)cp1 points2:(nonnull CGPoint *)cp cp1[indexRange.location + n] = CGPointMake(r[n - 1].x / b[n - 1].x, r[n - 1].y / b[n - 1].y); for ( NSUInteger i = n - 2; i > 0; i-- ) { - cp1[indexRange.location + i + 1] = CGPointMake( (r[i].x - c[i].x * cp1[indexRange.location + i + 2].x) / b[i].x, - (r[i].y - c[i].y * cp1[indexRange.location + i + 2].y) / b[i].y ); + cp1[indexRange.location + i + 1] = CGPointMake((r[i].x - c[i].x * cp1[indexRange.location + i + 2].x) / b[i].x, + (r[i].y - c[i].y * cp1[indexRange.location + i + 2].y) / b[i].y); } - cp1[indexRange.location + 1] = CGPointMake( (r[0].x - c[0].x * cp1[indexRange.location + 2].x) / b[0].x, - (r[0].y - c[0].y * cp1[indexRange.location + 2].y) / b[0].y ); + cp1[indexRange.location + 1] = CGPointMake((r[0].x - c[0].x * cp1[indexRange.location + 2].x) / b[0].x, + (r[0].y - c[0].y * cp1[indexRange.location + 2].y) / b[0].y); // we have p1, now compute p2 NSUInteger rangeEnd = NSMaxRange(indexRange) - 1; @@ -1181,8 +1547,8 @@ -(void)computeControlPoints:(nonnull CGPoint *)cp1 points2:(nonnull CGPoint *)cp CPTFloat(2.0) * viewPoints[i].y - cp1[i + 1].y); } - cp2[rangeEnd] = CGPointMake( CPTFloat(0.5) * (viewPoints[rangeEnd].x + cp1[rangeEnd].x), - CPTFloat(0.5) * (viewPoints[rangeEnd].y + cp1[rangeEnd].y) ); + cp2[rangeEnd] = CGPointMake(CPTFloat(0.5) * (viewPoints[rangeEnd].x + cp1[rangeEnd].x), + CPTFloat(0.5) * (viewPoints[rangeEnd].y + cp1[rangeEnd].y)); // clean up free(a); @@ -1202,8 +1568,8 @@ -(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx i if ( theLineStyle ) { [theLineStyle setLineStyleInContext:context]; - CGPoint alignedStartPoint = CPTAlignPointToUserSpace( context, CPTPointMake( CGRectGetMinX(rect), CGRectGetMidY(rect) ) ); - CGPoint alignedEndPoint = CPTAlignPointToUserSpace( context, CPTPointMake( CGRectGetMaxX(rect), CGRectGetMidY(rect) ) ); + CGPoint alignedStartPoint = CPTAlignPointToUserSpace(context, CPTPointMake(CGRectGetMinX(rect), CGRectGetMidY(rect))); + CGPoint alignedEndPoint = CPTAlignPointToUserSpace(context, CPTPointMake(CGRectGetMaxX(rect), CGRectGetMidY(rect))); CGContextMoveToPoint(context, alignedStartPoint.x, alignedStartPoint.y); CGContextAddLineToPoint(context, alignedEndPoint.x, alignedEndPoint.y); @@ -1214,7 +1580,7 @@ -(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx i if ( thePlotSymbol ) { [thePlotSymbol renderInContext:context - atPoint:CPTPointMake( CGRectGetMidX(rect), CGRectGetMidY(rect) ) + atPoint:CPTPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect)) scale:self.contentsScale alignToPixels:YES]; } @@ -1242,13 +1608,13 @@ -(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx i CGContextAddPath(context, swatchPath); CGContextClip(context); - if ( CPTDecimalGreaterThanOrEqualTo(self.areaBaseValue2.decimalValue, self.areaBaseValue.decimalValue) ) { - [fill1 fillRect:CPTRectMake( CGRectGetMinX(rect), CGRectGetMinY(rect), rect.size.width, rect.size.height / CPTFloat(2.0) ) inContext:context]; - [fill2 fillRect:CPTRectMake( CGRectGetMinX(rect), CGRectGetMidY(rect), rect.size.width, rect.size.height / CPTFloat(2.0) ) inContext:context]; + if ( CPTDecimalGreaterThanOrEqualTo(self.areaBaseValue2.decimalValue, self.areaBaseValue.decimalValue)) { + [fill1 fillRect:CPTRectMake(CGRectGetMinX(rect), CGRectGetMinY(rect), rect.size.width, rect.size.height / CPTFloat(2.0)) inContext:context]; + [fill2 fillRect:CPTRectMake(CGRectGetMinX(rect), CGRectGetMidY(rect), rect.size.width, rect.size.height / CPTFloat(2.0)) inContext:context]; } else { - [fill2 fillRect:CPTRectMake( CGRectGetMinX(rect), CGRectGetMinY(rect), rect.size.width, rect.size.height / CPTFloat(2.0) ) inContext:context]; - [fill1 fillRect:CPTRectMake( CGRectGetMinX(rect), CGRectGetMidY(rect), rect.size.width, rect.size.height / CPTFloat(2.0) ) inContext:context]; + [fill2 fillRect:CPTRectMake(CGRectGetMinX(rect), CGRectGetMinY(rect), rect.size.width, rect.size.height / CPTFloat(2.0)) inContext:context]; + [fill1 fillRect:CPTRectMake(CGRectGetMinX(rect), CGRectGetMidY(rect), rect.size.width, rect.size.height / CPTFloat(2.0)) inContext:context]; } CGContextRestoreGState(context); @@ -1270,8 +1636,8 @@ -(nonnull CGPathRef)newDataLinePath } // Calculate view points - CGPoint *viewPoints = malloc( dataCount * sizeof(CGPoint) ); - BOOL *drawPointFlags = malloc( dataCount * sizeof(BOOL) ); + CGPoint *viewPoints = calloc(dataCount, sizeof(CGPoint)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); for ( NSUInteger i = 0; i < dataCount; i++ ) { drawPointFlags[i] = YES; @@ -1317,6 +1683,61 @@ +(BOOL)needsDisplayForKey:(nonnull NSString *)aKey /// @endcond +#pragma mark - +#pragma mark Data Ranges + +/// @cond + +-(nullable CPTPlotRange *)plotRangeEnclosingField:(NSUInteger)fieldEnum +{ + CPTPlotRange *range = [self plotRangeForField:fieldEnum]; + + if ( self.interpolation == CPTScatterPlotInterpolationCurved ) { + CPTPlotSpace *space = self.plotSpace; + + if ( space ) { + CGPathRef dataLinePath = self.newDataLinePath; + + CGRect boundingBox = CGPathGetBoundingBox(dataLinePath); + + CGPathRelease(dataLinePath); + + CPTNumberArray *lowerLeft = [space plotPointForPlotAreaViewPoint:boundingBox.origin]; + CPTNumberArray *upperRight = [space plotPointForPlotAreaViewPoint:CGPointMake(CGRectGetMaxX(boundingBox), + CGRectGetMaxY(boundingBox))]; + + switch ( fieldEnum ) { + case CPTScatterPlotFieldX: + { + NSNumber *length = [NSDecimalNumber decimalNumberWithDecimal: + CPTDecimalSubtract(upperRight[CPTCoordinateX].decimalValue, + lowerLeft[CPTCoordinateX].decimalValue)]; + range = [CPTPlotRange plotRangeWithLocation:lowerLeft[CPTCoordinateX] + length:length]; + } + break; + + case CPTScatterPlotFieldY: + { + NSNumber *length = [NSDecimalNumber decimalNumberWithDecimal: + CPTDecimalSubtract(upperRight[CPTCoordinateY].decimalValue, + lowerLeft[CPTCoordinateY].decimalValue)]; + range = [CPTPlotRange plotRangeWithLocation:lowerLeft[CPTCoordinateY] + length:length]; + } + break; + + default: + break; + } + } + } + + return range; +} + +/// @endcond + #pragma mark - #pragma mark Fields @@ -1327,23 +1748,23 @@ -(NSUInteger)numberOfFields return 2; } --(nonnull CPTNumberArray)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[@(CPTScatterPlotFieldX), @(CPTScatterPlotFieldY)]; } --(nonnull CPTNumberArray)fieldIdentifiersForCoordinate:(CPTCoordinate)coord +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord { - CPTNumberArray result = nil; + CPTNumberArray *result = nil; switch ( coord ) { case CPTCoordinateX: result = @[@(CPTScatterPlotFieldX)]; - break; + break; case CPTCoordinateY: result = @[@(CPTScatterPlotFieldY)]; - break; + break; default: [NSException raise:CPTException format:@"Invalid coordinate passed to fieldIdentifiersForCoordinate:"]; @@ -1387,7 +1808,7 @@ -(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex: BOOL positiveDirection = YES; CPTPlotRange *yRange = [self.plotSpace plotRangeForCoordinate:CPTCoordinateY]; - if ( CPTDecimalLessThan( yRange.lengthDecimal, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalLessThan(yRange.lengthDecimal, CPTDecimalFromInteger(0))) { positiveDirection = !positiveDirection; } @@ -1433,7 +1854,7 @@ -(void)addAreaFillBand:(nullable CPTLimitBand *)limitBand -(void)removeAreaFillBand:(nullable CPTLimitBand *)limitBand { if ( limitBand ) { - CPTMutableLimitBandArray fillBands = self.mutableAreaFillBands; + CPTMutableLimitBandArray *fillBands = self.mutableAreaFillBands; CPTLimitBand *band = limitBand; [fillBands removeObject:band]; @@ -1493,7 +1914,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; BOOL symbolTouchUpHandled = NO; if ( [theDelegate respondsToSelector:@selector(scatterPlot:plotSymbolTouchDownAtRecordIndex:)] || @@ -1518,9 +1939,9 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) CGFloat margin = self.plotSymbolMarginForHitDetection * CPTFloat(2.0); symbolRect.size.width += margin; symbolRect.size.height += margin; - symbolRect.origin = CPTPointMake( center.x - CPTFloat(0.5) * CGRectGetWidth(symbolRect), center.y - CPTFloat(0.5) * CGRectGetHeight(symbolRect) ); + symbolRect.origin = CPTPointMake(center.x - CPTFloat(0.5) * CGRectGetWidth(symbolRect), center.y - CPTFloat(0.5) * CGRectGetHeight(symbolRect)); - if ( CGRectContainsPoint(symbolRect, plotAreaPoint) ) { + if ( CGRectContainsPoint(symbolRect, plotAreaPoint)) { self.pointingDeviceDownIndex = idx; if ( [theDelegate respondsToSelector:@selector(scatterPlot:plotSymbolTouchDownAtRecordIndex:)] ) { @@ -1543,7 +1964,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) ([theDelegate respondsToSelector:@selector(scatterPlotDataLineTouchDown:)] || [theDelegate respondsToSelector:@selector(scatterPlot:dataLineTouchDownWithEvent:)] || [theDelegate respondsToSelector:@selector(scatterPlotDataLineWasSelected:)] || - [theDelegate respondsToSelector:@selector(scatterPlot:dataLineWasSelectedWithEvent:)]) ) { + [theDelegate respondsToSelector:@selector(scatterPlot:dataLineWasSelectedWithEvent:)])) { plotSelected = [self plotWasLineHitByInteractionPoint:interactionPoint]; if ( plotSelected ) { // Let the delegate know that the plot was selected. @@ -1610,7 +2031,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; BOOL symbolSelectHandled = NO; if ( [theDelegate respondsToSelector:@selector(scatterPlot:plotSymbolTouchUpAtRecordIndex:)] || @@ -1635,9 +2056,9 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in CGFloat margin = self.plotSymbolMarginForHitDetection * CPTFloat(2.0); symbolRect.size.width += margin; symbolRect.size.height += margin; - symbolRect.origin = CPTPointMake( center.x - CPTFloat(0.5) * CGRectGetWidth(symbolRect), center.y - CPTFloat(0.5) * CGRectGetHeight(symbolRect) ); + symbolRect.origin = CPTPointMake(center.x - CPTFloat(0.5) * CGRectGetWidth(symbolRect), center.y - CPTFloat(0.5) * CGRectGetHeight(symbolRect)); - if ( CGRectContainsPoint(symbolRect, plotAreaPoint) ) { + if ( CGRectContainsPoint(symbolRect, plotAreaPoint)) { self.pointingDeviceDownIndex = idx; if ( [theDelegate respondsToSelector:@selector(scatterPlot:plotSymbolTouchUpAtRecordIndex:)] ) { @@ -1672,7 +2093,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in ([theDelegate respondsToSelector:@selector(scatterPlotDataLineTouchUp:)] || [theDelegate respondsToSelector:@selector(scatterPlot:dataLineTouchUpWithEvent:)] || [theDelegate respondsToSelector:@selector(scatterPlotDataLineWasSelected:)] || - [theDelegate respondsToSelector:@selector(scatterPlot:dataLineWasSelectedWithEvent:)]) ) { + [theDelegate respondsToSelector:@selector(scatterPlot:dataLineWasSelectedWithEvent:)])) { plotSelected = [self plotWasLineHitByInteractionPoint:interactionPoint]; if ( plotSelected ) { @@ -1716,8 +2137,8 @@ -(BOOL)plotWasLineHitByInteractionPoint:(CGPoint)interactionPoint NSUInteger dataCount = self.cachedDataCount; if ( theGraph && thePlotArea && !self.hidden && dataCount ) { - CGPoint *viewPoints = malloc( dataCount * sizeof(CGPoint) ); - BOOL *drawPointFlags = malloc( dataCount * sizeof(BOOL) ); + CGPoint *viewPoints = calloc(dataCount, sizeof(CGPoint)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = (CPTXYPlotSpace *)self.plotSpace; [self calculatePointsToDraw:drawPointFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:NO numberOfPoints:dataCount]; @@ -1727,14 +2148,14 @@ -(BOOL)plotWasLineHitByInteractionPoint:(CGPoint)interactionPoint if ( firstDrawnPointIndex != NSNotFound ) { NSInteger lastDrawnPointIndex = [self extremeDrawnPointIndexForFlags:drawPointFlags numberOfPoints:dataCount extremeNumIsLowerBound:NO]; - NSRange viewIndexRange = NSMakeRange( (NSUInteger)firstDrawnPointIndex, (NSUInteger)(lastDrawnPointIndex - firstDrawnPointIndex + 1) ); + NSRange viewIndexRange = NSMakeRange((NSUInteger)firstDrawnPointIndex, (NSUInteger)(lastDrawnPointIndex - firstDrawnPointIndex + 1)); CGPathRef dataLinePath = [self newDataLinePathForViewPoints:viewPoints indexRange:viewIndexRange baselineYValue:CPTNAN]; - CGPathRef path = CGPathCreateCopyByStrokingPath( dataLinePath, - NULL, - self.plotLineMarginForHitDetection * CPTFloat(2.0), - kCGLineCapRound, - kCGLineJoinRound, - CPTFloat(3.0) ); + CGPathRef path = CGPathCreateCopyByStrokingPath(dataLinePath, + NULL, + self.plotLineMarginForHitDetection * CPTFloat(2.0), + kCGLineCapRound, + kCGLineJoinRound, + CPTFloat(3.0)); CGPoint plotAreaPoint = [theGraph convertPoint:interactionPoint toLayer:thePlotArea]; @@ -1773,6 +2194,29 @@ -(void)setHistogramOption:(CPTScatterPlotHistogramOption)newHistogramOption } } +-(void)setCurvedInterpolationOption:(CPTScatterPlotCurvedInterpolationOption)newCurvedInterpolationOption +{ + if ( newCurvedInterpolationOption != curvedInterpolationOption ) { + curvedInterpolationOption = newCurvedInterpolationOption; + [self setNeedsDisplay]; + } +} + +-(void)setCurvedInterpolationCustomAlpha:(CGFloat)newCurvedInterpolationCustomAlpha +{ + if ( newCurvedInterpolationCustomAlpha > CPTFloat(1.0)) { + newCurvedInterpolationCustomAlpha = CPTFloat(1.0); + } + if ( newCurvedInterpolationCustomAlpha < CPTFloat(0.0)) { + newCurvedInterpolationCustomAlpha = CPTFloat(0.0); + } + + if ( newCurvedInterpolationCustomAlpha != curvedInterpolationCustomAlpha ) { + curvedInterpolationCustomAlpha = newCurvedInterpolationCustomAlpha; + [self setNeedsDisplay]; + } +} + -(void)setPlotSymbol:(nullable CPTPlotSymbol *)aSymbol { if ( aSymbol != plotSymbol ) { @@ -1809,7 +2253,7 @@ -(void)setAreaFill2:(nullable CPTFill *)newFill } } --(nullable CPTLimitBandArray)areaFillBands +-(nullable CPTLimitBandArray *)areaFillBands { return [self.mutableAreaFillBands copy]; } @@ -1846,33 +2290,33 @@ -(void)setAreaBaseValue2:(nullable NSNumber *)newAreaBaseValue } } --(void)setXValues:(nullable CPTNumberArray)newValues +-(void)setXValues:(nullable CPTNumberArray *)newValues { [self cacheNumbers:newValues forField:CPTScatterPlotFieldX]; } --(nullable CPTNumberArray)xValues +-(nullable CPTNumberArray *)xValues { return [[self cachedNumbersForField:CPTScatterPlotFieldX] sampleArray]; } --(void)setYValues:(nullable CPTNumberArray)newValues +-(void)setYValues:(nullable CPTNumberArray *)newValues { [self cacheNumbers:newValues forField:CPTScatterPlotFieldY]; } --(nullable CPTNumberArray)yValues +-(nullable CPTNumberArray *)yValues { return [[self cachedNumbersForField:CPTScatterPlotFieldY] sampleArray]; } --(void)setPlotSymbols:(nullable CPTPlotSymbolArray)newSymbols +-(void)setPlotSymbols:(nullable CPTPlotSymbolArray *)newSymbols { [self cacheArray:newSymbols forKey:CPTScatterPlotBindingPlotSymbols]; [self setNeedsDisplay]; } --(nullable CPTPlotSymbolArray)plotSymbols +-(nullable CPTPlotSymbolArray *)plotSymbols { return [self cachedArrayForKey:CPTScatterPlotBindingPlotSymbols]; } diff --git a/framework/Source/CPTScatterPlotTests.m b/framework/Source/CPTScatterPlotTests.m index 700ebb1fa..5cecafe5b 100644 --- a/framework/Source/CPTScatterPlotTests.m +++ b/framework/Source/CPTScatterPlotTests.m @@ -7,8 +7,8 @@ @interface CPTScatterPlot(Testing) -(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnull CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly numberOfPoints:(NSUInteger)dataCount; --(void)setXValues:(nullable CPTNumberArray)newValues; --(void)setYValues:(nullable CPTNumberArray)newValues; +-(void)setXValues:(nullable CPTNumberArray *)newValues; +-(void)setYValues:(nullable CPTNumberArray *)newValues; @end @@ -19,7 +19,7 @@ @implementation CPTScatterPlotTests -(void)setUp { - CPTNumberArray yValues = @[@0.5, @0.5, @0.5, @0.5, @0.5]; + CPTNumberArray *yValues = @[@0.5, @0.5, @0.5, @0.5, @0.5]; self.plot = [CPTScatterPlot new]; [self.plot setYValues:yValues]; @@ -40,9 +40,9 @@ -(void)tearDown -(void)testCalculatePointsToDrawAllInRange { - CPTNumberArray inRangeValues = @[@0.1, @0.2, @0.15, @0.6, @0.9]; + CPTNumberArray *inRangeValues = @[@0.1, @0.2, @0.15, @0.6, @0.9]; - BOOL *drawFlags = malloc(sizeof(BOOL) * inRangeValues.count); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = self.plotSpace; @@ -58,9 +58,9 @@ -(void)testCalculatePointsToDrawAllInRange -(void)testCalculatePointsToDrawAllInRangeVisibleOnly { - CPTNumberArray inRangeValues = @[@0.1, @0.2, @0.15, @0.6, @0.9]; + CPTNumberArray *inRangeValues = @[@0.1, @0.2, @0.15, @0.6, @0.9]; - BOOL *drawFlags = malloc(sizeof(BOOL) * inRangeValues.count); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = self.plotSpace; @@ -76,9 +76,9 @@ -(void)testCalculatePointsToDrawAllInRangeVisibleOnly -(void)testCalculatePointsToDrawNoneInRange { - CPTNumberArray inRangeValues = @[@(-0.1), @(-0.2), @(-0.15), @(-0.6), @(-0.9)]; + CPTNumberArray *inRangeValues = @[@(-0.1), @(-0.2), @(-0.15), @(-0.6), @(-0.9)]; - BOOL *drawFlags = malloc(sizeof(BOOL) * inRangeValues.count); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = self.plotSpace; @@ -94,9 +94,9 @@ -(void)testCalculatePointsToDrawNoneInRange -(void)testCalculatePointsToDrawNoneInRangeVisibleOnly { - CPTNumberArray inRangeValues = @[@(-0.1), @(-0.2), @(-0.15), @(-0.6), @(-0.9)]; + CPTNumberArray *inRangeValues = @[@(-0.1), @(-0.2), @(-0.15), @(-0.6), @(-0.9)]; - BOOL *drawFlags = malloc(sizeof(BOOL) * inRangeValues.count); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = self.plotSpace; @@ -112,9 +112,9 @@ -(void)testCalculatePointsToDrawNoneInRangeVisibleOnly -(void)testCalculatePointsToDrawNoneInRangeDifferentRegions { - CPTNumberArray inRangeValues = @[@(-0.1), @2, @(-0.15), @3, @(-0.9)]; + CPTNumberArray *inRangeValues = @[@(-0.1), @2, @(-0.15), @3, @(-0.9)]; - BOOL *drawFlags = malloc(sizeof(BOOL) * inRangeValues.count); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = self.plotSpace; @@ -130,9 +130,9 @@ -(void)testCalculatePointsToDrawNoneInRangeDifferentRegions -(void)testCalculatePointsToDrawNoneInRangeDifferentRegionsVisibleOnly { - CPTNumberArray inRangeValues = @[@(-0.1), @2, @(-0.15), @3, @(-0.9)]; + CPTNumberArray *inRangeValues = @[@(-0.1), @2, @(-0.15), @3, @(-0.9)]; - BOOL *drawFlags = malloc(sizeof(BOOL) * inRangeValues.count); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = self.plotSpace; @@ -148,10 +148,10 @@ -(void)testCalculatePointsToDrawNoneInRangeDifferentRegionsVisibleOnly -(void)testCalculatePointsToDrawSomeInRange { - CPTNumberArray inRangeValues = @[@(-0.1), @0.1, @0.2, @1.2, @1.5]; - BOOL expected[5] = { YES, YES, YES, YES, NO }; + CPTNumberArray *inRangeValues = @[@(-0.1), @0.1, @0.2, @1.2, @1.5]; + BOOL expected[5] = { YES, YES, YES, YES, NO }; - BOOL *drawFlags = malloc(sizeof(BOOL) * inRangeValues.count); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = self.plotSpace; @@ -171,9 +171,9 @@ -(void)testCalculatePointsToDrawSomeInRange -(void)testCalculatePointsToDrawSomeInRangeVisibleOnly { - CPTNumberArray inRangeValues = @[@(-0.1), @0.1, @0.2, @1.2, @1.5]; + CPTNumberArray *inRangeValues = @[@(-0.1), @0.1, @0.2, @1.2, @1.5]; - BOOL *drawFlags = malloc(sizeof(BOOL) * inRangeValues.count); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = self.plotSpace; @@ -194,10 +194,10 @@ -(void)testCalculatePointsToDrawSomeInRangeVisibleOnly -(void)testCalculatePointsToDrawSomeInRangeCrossing { - CPTNumberArray inRangeValues = @[@(-0.1), @1.1, @0.9, @(-0.1), @(-0.2)]; + CPTNumberArray *inRangeValues = @[@(-0.1), @1.1, @0.9, @(-0.1), @(-0.2)]; - BOOL *drawFlags = malloc(sizeof(BOOL) * inRangeValues.count); - BOOL *expected = malloc(sizeof(BOOL) * inRangeValues.count); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); + BOOL *expected = calloc(inRangeValues.count, sizeof(BOOL)); for ( NSUInteger i = 0; i < inRangeValues.count - 1; i++ ) { expected[i] = YES; @@ -224,9 +224,9 @@ -(void)testCalculatePointsToDrawSomeInRangeCrossing -(void)testCalculatePointsToDrawSomeInRangeCrossingVisibleOnly { - CPTNumberArray inRangeValues = @[@(-0.1), @1.1, @0.9, @(-0.1), @(-0.2)]; + CPTNumberArray *inRangeValues = @[@(-0.1), @1.1, @0.9, @(-0.1), @(-0.2)]; - BOOL *drawFlags = malloc(sizeof(BOOL) * inRangeValues.count); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = self.plotSpace; diff --git a/framework/Source/CPTShadow.h b/framework/Source/CPTShadow.h index f07db0871..758ba528a 100644 --- a/framework/Source/CPTShadow.h +++ b/framework/Source/CPTShadow.h @@ -1,6 +1,6 @@ @class CPTColor; -@interface CPTShadow : NSObject +@interface CPTShadow : NSObject @property (nonatomic, readonly) CGSize shadowOffset; @property (nonatomic, readonly) CGFloat shadowBlurRadius; diff --git a/framework/Source/CPTShadow.m b/framework/Source/CPTShadow.m index ce752e189..6204c3943 100644 --- a/framework/Source/CPTShadow.m +++ b/framework/Source/CPTShadow.m @@ -70,7 +70,7 @@ +(nonnull instancetype)shadow **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { shadowOffset = CGSizeZero; shadowBlurRadius = CPTFloat(0.0); shadowColor = nil; @@ -94,16 +94,29 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { shadowOffset = [coder decodeCPTSizeForKey:@"CPTShadow.shadowOffset"]; shadowBlurRadius = [coder decodeCGFloatForKey:@"CPTShadow.shadowBlurRadius"]; - shadowColor = [coder decodeObjectForKey:@"CPTShadow.shadowColor"]; + shadowColor = [coder decodeObjectOfClass:[CPTColor class] + forKey:@"CPTShadow.shadowColor"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing @@ -161,7 +174,7 @@ -(nonnull id)mutableCopyWithZone:(nullable NSZone *)zone -(void)setShadowBlurRadius:(CGFloat)newShadowBlurRadius { - NSParameterAssert( newShadowBlurRadius >= CPTFloat(0.0) ); + NSParameterAssert(newShadowBlurRadius >= CPTFloat(0.0)); if ( newShadowBlurRadius != shadowBlurRadius ) { shadowBlurRadius = newShadowBlurRadius; diff --git a/framework/Source/CPTTestCase.h b/framework/Source/CPTTestCase.h index 5be665d34..b87b0c191 100644 --- a/framework/Source/CPTTestCase.h +++ b/framework/Source/CPTTestCase.h @@ -2,4 +2,7 @@ @interface CPTTestCase : XCTestCase +-(nullable id)archiveRoundTrip:(nonnull id)object toClass:(nonnull Class)archiveClass; +-(nullable id)archiveRoundTrip:(nonnull id)object; + @end diff --git a/framework/Source/CPTTestCase.m b/framework/Source/CPTTestCase.m index d1fffb5c9..effe3adec 100644 --- a/framework/Source/CPTTestCase.m +++ b/framework/Source/CPTTestCase.m @@ -2,4 +2,28 @@ @implementation CPTTestCase +-(nullable id)archiveRoundTrip:(nonnull id)object +{ + return [self archiveRoundTrip:object toClass:[object class]]; +} + +-(nullable id)archiveRoundTrip:(nonnull id)object toClass:(nonnull Class)archiveClass +{ + const BOOL secure = ![archiveClass isSubclassOfClass:[NSNumberFormatter class]]; + + NSMutableData *archiveData = [[NSMutableData alloc] init]; + + NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:archiveData]; + + archiver.requiresSecureCoding = secure; + + [archiver encodeObject:object forKey:@"test"]; + [archiver finishEncoding]; + + NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:archiveData]; + unarchiver.requiresSecureCoding = secure; + + return [unarchiver decodeObjectOfClass:archiveClass forKey:@"test"]; +} + @end diff --git a/framework/Source/CPTTextLayer.h b/framework/Source/CPTTextLayer.h index e8f2243b3..9f3c6773b 100644 --- a/framework/Source/CPTTextLayer.h +++ b/framework/Source/CPTTextLayer.h @@ -17,6 +17,7 @@ extern const CGFloat kCPTTextLayerMarginWidth; ///< Margin width around the text -(nonnull instancetype)initWithText:(nullable NSString *)newText; -(nonnull instancetype)initWithText:(nullable NSString *)newText style:(nullable CPTTextStyle *)newStyle NS_DESIGNATED_INITIALIZER; -(nonnull instancetype)initWithAttributedText:(nullable NSAttributedString *)newText; + -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; -(nonnull instancetype)initWithLayer:(nonnull id)layer NS_DESIGNATED_INITIALIZER; /// @} diff --git a/framework/Source/CPTTextLayer.m b/framework/Source/CPTTextLayer.m index 8e3cc2464..45a208f31 100644 --- a/framework/Source/CPTTextLayer.m +++ b/framework/Source/CPTTextLayer.m @@ -71,7 +71,7 @@ @implementation CPTTextLayer **/ -(nonnull instancetype)initWithText:(nullable NSString *)newText style:(nullable CPTTextStyle *)newStyle { - if ( (self = [super initWithFrame:CGRectZero]) ) { + if ((self = [super initWithFrame:CGRectZero])) { textStyle = newStyle; text = [newText copy]; attributedText = nil; @@ -102,7 +102,7 @@ -(nonnull instancetype)initWithAttributedText:(nullable NSAttributedString *)new { CPTTextStyle *newStyle = [CPTTextStyle textStyleWithAttributes:[newText attributesAtIndex:0 effectiveRange:NULL]]; - if ( (self = [self initWithText:newText.string style:newStyle]) ) { + if ((self = [self initWithText:newText.string style:newStyle])) { attributedText = [newText copy]; [self sizeToFit]; @@ -115,7 +115,7 @@ -(nonnull instancetype)initWithAttributedText:(nullable NSAttributedString *)new -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTTextLayer *theLayer = (CPTTextLayer *)layer; textStyle = theLayer->textStyle; @@ -141,7 +141,7 @@ -(nonnull instancetype)initWithLayer:(nonnull id)layer * @param newFrame The frame rectangle. * @return The initialized CPTTextLayer object. **/ --(nonnull instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect __unused)newFrame { return [self initWithText:nil style:nil]; } @@ -167,10 +167,13 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - textStyle = [coder decodeObjectForKey:@"CPTTextLayer.textStyle"]; - text = [[coder decodeObjectForKey:@"CPTTextLayer.text"] copy]; - attributedText = [[coder decodeObjectForKey:@"CPTTextLayer.attributedText"] copy]; + if ((self = [super initWithCoder:coder])) { + textStyle = [coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTTextLayer.textStyle"]; + text = [[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTTextLayer.text"] copy]; + attributedText = [[coder decodeObjectOfClass:[NSAttributedString class] + forKey:@"CPTTextLayer.attributedText"] copy]; inTextUpdate = NO; } @@ -179,6 +182,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Accessors @@ -240,7 +255,7 @@ -(void)setAttributedText:(nullable NSAttributedString *)newValue -(void)setMaximumSize:(CGSize)newSize { - if ( !CGSizeEqualToSize(maximumSize, newSize) ) { + if ( !CGSizeEqualToSize(maximumSize, newSize)) { maximumSize = newSize; [self sizeToFit]; } @@ -301,12 +316,8 @@ -(CGSize)sizeThatFits if ( myText.length > 0 ) { NSAttributedString *styledText = self.attributedText; - if ( (styledText.length > 0) && [styledText respondsToSelector:@selector(size)] ) { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - textSize = styledText.size; -#else - textSize = NSSizeToCGSize(styledText.size); -#endif + if ( styledText.length > 0 ) { + textSize = [styledText sizeAsDrawn]; } else { textSize = [myText sizeWithTextStyle:self.textStyle]; @@ -336,10 +347,10 @@ -(void)sizeToFit newBounds.size.height += self.paddingTop + self.paddingBottom; CGSize myMaxSize = self.maximumSize; - if ( myMaxSize.width > CPTFloat(0.0) ) { + if ( myMaxSize.width > CPTFloat(0.0)) { newBounds.size.width = MIN(newBounds.size.width, myMaxSize.width); } - if ( myMaxSize.height > CPTFloat(0.0) ) { + if ( myMaxSize.height > CPTFloat(0.0)) { newBounds.size.height = MIN(newBounds.size.height, myMaxSize.height); } @@ -367,15 +378,15 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context if ( myText.length > 0 ) { [super renderAsVectorInContext:context]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGContextSaveGState(context); CGContextTranslateCTM(context, CPTFloat(0.0), self.bounds.size.height); - CGContextScaleCTM( context, CPTFloat(1.0), CPTFloat(-1.0) ); + CGContextScaleCTM(context, CPTFloat(1.0), CPTFloat(-1.0)); #endif CGRect newBounds = CGRectInset(self.bounds, kCPTTextLayerMarginWidth, kCPTTextLayerMarginWidth); newBounds.origin.x += self.paddingLeft; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE newBounds.origin.y += self.paddingTop; #else newBounds.origin.y += self.paddingBottom; @@ -384,7 +395,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context newBounds.size.height -= self.paddingTop + self.paddingBottom; NSAttributedString *styledText = self.attributedText; - if ( (styledText.length > 0) && [styledText respondsToSelector:@selector(drawInRect:)] ) { + if ((styledText.length > 0) && [styledText respondsToSelector:@selector(drawInRect:)] ) { [styledText drawInRect:newBounds inContext:context]; } @@ -394,7 +405,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context inContext:context]; } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGContextRestoreGState(context); #endif } diff --git a/framework/Source/CPTTextStyle.h b/framework/Source/CPTTextStyle.h index 01605fe22..df94cd374 100644 --- a/framework/Source/CPTTextStyle.h +++ b/framework/Source/CPTTextStyle.h @@ -1,4 +1,5 @@ #import "CPTDefinitions.h" +#import "CPTPlatformSpecificDefines.h" #import "CPTTextStylePlatformSpecific.h" @class CPTColor; @@ -7,15 +8,17 @@ /** * @brief An array of text styles. **/ -typedef NSArray *CPTTextStyleArray; +typedef NSArray CPTTextStyleArray; /** * @brief A mutable array of text styles. **/ -typedef NSMutableArray *CPTMutableTextStyleArray; +typedef NSMutableArray CPTMutableTextStyleArray; -@interface CPTTextStyle : NSObject +@interface CPTTextStyle : NSObject +// font would override fontName/fontSize if not nil +@property (readonly, strong, nonatomic, nullable) CPTNativeFont *font; @property (readonly, copy, nonatomic, nullable) NSString *fontName; @property (readonly, nonatomic) CGFloat fontSize; @property (readonly, copy, nonatomic, nullable) CPTColor *color; @@ -37,11 +40,11 @@ typedef NSMutableArray *CPTMutableTextStyleArray; **/ @interface CPTTextStyle(CPTPlatformSpecificTextStyleExtensions) -@property (readonly, nonatomic, nonnull) CPTDictionary attributes; +@property (readonly, nonatomic, nonnull) CPTDictionary *attributes; /// @name Factory Methods /// @{ -+(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attributes; ++(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary *)attributes; /// @} @end diff --git a/framework/Source/CPTTextStyle.m b/framework/Source/CPTTextStyle.m index 4ec64b45f..f1c5c4628 100644 --- a/framework/Source/CPTTextStyle.m +++ b/framework/Source/CPTTextStyle.m @@ -7,6 +7,8 @@ /// @cond @interface CPTTextStyle() +// font would override fontName/fontSize if not nil +@property (readwrite, strong, nonatomic, nullable) CPTNativeFont *font; @property (readwrite, copy, nonatomic, nullable) NSString *fontName; @property (readwrite, assign, nonatomic) CGFloat fontSize; @property (readwrite, copy, nonatomic, nullable) CPTColor *color; @@ -26,13 +28,20 @@ @interface CPTTextStyle() @implementation CPTTextStyle +/** @property CPTNativeFont* font + * @brief The font. Default is @nil. + * + * Font will override fontName and fontSize if not @nil. + **/ +@synthesize font; + /** @property CGFloat fontSize - * @brief The font size. Default is @num{12.0}. + * @brief The font size. Default is @num{12.0}. Ignored if font is not @nil. **/ @synthesize fontSize; /** @property nullable NSString *fontName - * @brief The font name. Default is Helvetica. + * @brief The font name. Default is Helvetica. Ignored if font is not @nil. **/ @synthesize fontName; @@ -73,6 +82,7 @@ +(nonnull instancetype)textStyleWithStyle:(nullable CPTTextStyle *)textStyle { CPTTextStyle *newTextStyle = [[self alloc] init]; + newTextStyle.font = textStyle.font; newTextStyle.color = textStyle.color; newTextStyle.fontName = textStyle.fontName; newTextStyle.fontSize = textStyle.fontSize; @@ -88,9 +98,10 @@ +(nonnull instancetype)textStyleWithStyle:(nullable CPTTextStyle *)textStyle /// @name Initialization /// @{ -/** @brief Initializes a newly allocated CPTAnnotation object. +/** @brief Initializes a newly allocated CPTTextStyle object. * * The initialized object will have the following properties: + * - @ref font = nil * - @ref fontName = Helvetica * - @ref fontSize = @num{12.0} * - @ref color = opaque black @@ -101,7 +112,8 @@ +(nonnull instancetype)textStyleWithStyle:(nullable CPTTextStyle *)textStyle **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { + font = nil; fontName = @"Helvetica"; fontSize = CPTFloat(12.0); color = [CPTColor blackColor]; @@ -120,6 +132,16 @@ -(nonnull instancetype)init -(void)encodeWithCoder:(nonnull NSCoder *)coder { +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV + if ( self.font ) { + // UIFont does not support NSCoding :( + [coder encodeObject:[self.font fontDescriptor] forKey:@"CPTTextStyle.font+descriptor"]; + } +#else + // NSFont supports NSCoding :) + [coder encodeObject:self.font forKey:@"CPTTextStyle.font"]; +#endif + [coder encodeObject:self.fontName forKey:@"CPTTextStyle.fontName"]; [coder encodeCGFloat:self.fontSize forKey:@"CPTTextStyle.fontSize"]; [coder encodeObject:self.color forKey:@"CPTTextStyle.color"]; @@ -129,10 +151,25 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - fontName = [[coder decodeObjectForKey:@"CPTTextStyle.fontName"] copy]; - fontSize = [coder decodeCGFloatForKey:@"CPTTextStyle.fontSize"]; - color = [[coder decodeObjectForKey:@"CPTTextStyle.color"] copy]; + if ((self = [super init])) { +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV + // UIFont does not support NSCoding :( + UIFontDescriptor *fontDescriptor = [coder decodeObjectOfClass:[UIFontDescriptor class] + forKey:@"CPTTextStyle.font+descriptor"]; + if ( fontDescriptor ) { + font = [UIFont fontWithDescriptor:fontDescriptor size:0]; // 0 will keep the same font size + } +#else + // NSFont supports NSCoding :) + font = [coder decodeObjectOfClass:[NSFont class] + forKey:@"CPTTextStyle.font"]; +#endif + + fontName = [[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTTextStyle.fontName"] copy]; + fontSize = [coder decodeCGFloatForKey:@"CPTTextStyle.fontSize"]; + color = [[coder decodeObjectOfClass:[CPTColor class] + forKey:@"CPTTextStyle.color"] copy]; textAlignment = (CPTTextAlignment)[coder decodeIntegerForKey:@"CPTTextStyle.textAlignment"]; lineBreakMode = (NSLineBreakMode)[coder decodeIntegerForKey:@"CPTTextStyle.lineBreakMode"]; } @@ -141,6 +178,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark NSCopying Methods @@ -150,6 +199,7 @@ -(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTTextStyle *newCopy = [[CPTTextStyle allocWithZone:zone] init]; + newCopy.font = self.font; newCopy.fontName = self.fontName; newCopy.color = self.color; newCopy.fontSize = self.fontSize; @@ -170,6 +220,7 @@ -(nonnull id)mutableCopyWithZone:(nullable NSZone *)zone { CPTTextStyle *newCopy = [[CPTMutableTextStyle allocWithZone:zone] init]; + newCopy.font = self.font; newCopy.fontName = self.fontName; newCopy.color = self.color; newCopy.fontSize = self.fontSize; diff --git a/framework/Source/CPTTextStyleTests.m b/framework/Source/CPTTextStyleTests.m index d2df4a71a..5e21ddcf7 100644 --- a/framework/Source/CPTTextStyleTests.m +++ b/framework/Source/CPTTextStyleTests.m @@ -22,7 +22,7 @@ -(void)testKeyedArchivingRoundTrip { CPTTextStyle *textStyle = [CPTTextStyle textStyle]; - CPTTextStyle *newTextStyle = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:textStyle]]; + CPTTextStyle *newTextStyle = [self archiveRoundTrip:textStyle]; XCTAssertEqualObjects(newTextStyle.fontName, textStyle.fontName, @"Font names not equal"); XCTAssertEqual(newTextStyle.fontSize, textStyle.fontSize, @"Font sizes not equal"); diff --git a/framework/Source/CPTTheme.h b/framework/Source/CPTTheme.h index 130155c0c..83cda6ef7 100644 --- a/framework/Source/CPTTheme.h +++ b/framework/Source/CPTTheme.h @@ -1,10 +1,17 @@ +#import "CPTDefinitions.h" + +/** + * @brief Theme name type. + **/ +typedef NSString *CPTThemeName cpt_swift_struct; + /// @ingroup themeNames /// @{ -extern NSString *__nonnull const kCPTDarkGradientTheme; ///< A graph theme with dark gray gradient backgrounds and light gray lines. -extern NSString *__nonnull const kCPTPlainBlackTheme; ///< A graph theme with black backgrounds and white lines. -extern NSString *__nonnull const kCPTPlainWhiteTheme; ///< A graph theme with white backgrounds and black lines. -extern NSString *__nonnull const kCPTSlateTheme; ///< A graph theme with colors that match the default iPhone navigation bar, toolbar buttons, and table views. -extern NSString *__nonnull const kCPTStocksTheme; ///< A graph theme with a gradient background and white lines. +extern CPTThemeName __nonnull const kCPTDarkGradientTheme; ///< A graph theme with dark gray gradient backgrounds and light gray lines. +extern CPTThemeName __nonnull const kCPTPlainBlackTheme; ///< A graph theme with black backgrounds and white lines. +extern CPTThemeName __nonnull const kCPTPlainWhiteTheme; ///< A graph theme with white backgrounds and black lines. +extern CPTThemeName __nonnull const kCPTSlateTheme; ///< A graph theme with colors that match the default iPhone navigation bar, toolbar buttons, and table views. +extern CPTThemeName __nonnull const kCPTStocksTheme; ///< A graph theme with a gradient background and white lines. /// @} @class CPTGraph; @@ -12,7 +19,7 @@ extern NSString *__nonnull const kCPTStocksTheme; ///< A graph theme with @class CPTAxisSet; @class CPTMutableTextStyle; -@interface CPTTheme : NSObject +@interface CPTTheme : NSObject @property (nonatomic, readwrite, strong, nullable) Class graphClass; @@ -20,8 +27,8 @@ extern NSString *__nonnull const kCPTStocksTheme; ///< A graph theme with /// @{ +(void)registerTheme:(nonnull Class)themeClass; +(nullable NSArray *)themeClasses; -+(nullable instancetype)themeNamed:(nullable NSString *)themeName; -+(nonnull NSString *)name; ++(nullable instancetype)themeNamed:(nullable CPTThemeName)themeName; ++(nonnull CPTThemeName)name; /// @} /// @name Theme Usage diff --git a/framework/Source/CPTTheme.m b/framework/Source/CPTTheme.m index 3aae496f3..9d17a6e00 100644 --- a/framework/Source/CPTTheme.m +++ b/framework/Source/CPTTheme.m @@ -40,7 +40,7 @@ @implementation CPTTheme **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { graphClass = Nil; } return self; @@ -65,10 +65,12 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - self = [CPTTheme themeNamed:[coder decodeObjectForKey:@"CPTTheme.name"]]; + self = [CPTTheme themeNamed:[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTTheme.name"]]; if ( self ) { - NSString *className = [coder decodeObjectForKey:@"CPTTheme.graphClass"]; + NSString *className = [coder decodeObjectOfClass:[NSString class] + forKey:@"CPTTheme.graphClass"]; if ( className ) { self.graphClass = NSClassFromString(className); } @@ -78,6 +80,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Theme management @@ -96,7 +110,7 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder * @return A CPTTheme instance with name matching @par{themeName} or @nil if no themes with a matching name were found. * @see See @ref themeNames "Theme Names" for a list of named themes provided by Core Plot. **/ -+(nullable instancetype)themeNamed:(nullable NSString *)themeName ++(nullable instancetype)themeNamed:(nullable CPTThemeName)themeName { CPTTheme *newTheme = nil; @@ -117,8 +131,7 @@ +(void)registerTheme:(nonnull Class)themeClass { NSParameterAssert(themeClass); - @synchronized(self) - { + @synchronized ( self ) { if ( !themes ) { themes = [[NSMutableSet alloc] init]; } @@ -135,7 +148,7 @@ +(void)registerTheme:(nonnull Class)themeClass /** @brief The name used for this theme class. * @return The name. **/ -+(nonnull NSString *)name ++(nonnull CPTThemeName)name { return NSStringFromClass(self); } @@ -200,21 +213,21 @@ -(nullable id)newGraph /** @brief Applies the background theme to the provided graph. * @param graph The graph to style. **/ --(void)applyThemeToBackground:(nonnull CPTGraph *)graph +-(void)applyThemeToBackground:(nonnull CPTGraph *__unused)graph { } /** @brief Applies the theme to the provided plot area. * @param plotAreaFrame The plot area to style. **/ --(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *)plotAreaFrame +-(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *__unused)plotAreaFrame { } /** @brief Applies the theme to the provided axis set. * @param axisSet The axis set to style. **/ --(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet +-(void)applyThemeToAxisSet:(nonnull CPTAxisSet *__unused)axisSet { } diff --git a/framework/Source/CPTThemeTests.m b/framework/Source/CPTThemeTests.m index 1750f90c4..d0007cb38 100644 --- a/framework/Source/CPTThemeTests.m +++ b/framework/Source/CPTThemeTests.m @@ -1,13 +1,13 @@ #import "CPTThemeTests.h" -#import "CPTDerivedXYGraph.h" -#import "CPTExceptions.h" -#import "CPTTheme.h" #import "_CPTDarkGradientTheme.h" #import "_CPTPlainBlackTheme.h" #import "_CPTPlainWhiteTheme.h" #import "_CPTSlateTheme.h" #import "_CPTStocksTheme.h" +#import "CPTDerivedXYGraph.h" +#import "CPTExceptions.h" +#import "CPTTheme.h" @implementation CPTThemeTests @@ -52,6 +52,8 @@ -(void)testThemeNamedDarkGradientShouldReturnCPTDarkGradientTheme CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; XCTAssertTrue([theme isKindOfClass:[_CPTDarkGradientTheme class]], @"Should be _CPTDarkGradientTheme"); + + [self archiveRoundTrip:theme toClass:[CPTTheme class]]; } -(void)testThemeNamedPlainBlackShouldReturnCPTPlainBlackTheme @@ -59,6 +61,8 @@ -(void)testThemeNamedPlainBlackShouldReturnCPTPlainBlackTheme CPTTheme *theme = [CPTTheme themeNamed:kCPTPlainBlackTheme]; XCTAssertTrue([theme isKindOfClass:[_CPTPlainBlackTheme class]], @"Should be _CPTPlainBlackTheme"); + + [self archiveRoundTrip:theme toClass:[CPTTheme class]]; } -(void)testThemeNamedPlainWhiteShouldReturnCPTPlainWhiteTheme @@ -66,6 +70,8 @@ -(void)testThemeNamedPlainWhiteShouldReturnCPTPlainWhiteTheme CPTTheme *theme = [CPTTheme themeNamed:kCPTPlainWhiteTheme]; XCTAssertTrue([theme isKindOfClass:[_CPTPlainWhiteTheme class]], @"Should be _CPTPlainWhiteTheme"); + + [self archiveRoundTrip:theme toClass:[CPTTheme class]]; } -(void)testThemeNamedStocksShouldReturnCPTStocksTheme @@ -73,6 +79,8 @@ -(void)testThemeNamedStocksShouldReturnCPTStocksTheme CPTTheme *theme = [CPTTheme themeNamed:kCPTStocksTheme]; XCTAssertTrue([theme isKindOfClass:[_CPTStocksTheme class]], @"Should be _CPTStocksTheme"); + + [self archiveRoundTrip:theme toClass:[CPTTheme class]]; } -(void)testThemeNamedSlateShouldReturnCPTSlateTheme @@ -80,6 +88,8 @@ -(void)testThemeNamedSlateShouldReturnCPTSlateTheme CPTTheme *theme = [CPTTheme themeNamed:kCPTSlateTheme]; XCTAssertTrue([theme isKindOfClass:[_CPTSlateTheme class]], @"Should be _CPTSlateTheme"); + + [self archiveRoundTrip:theme toClass:[CPTTheme class]]; } @end diff --git a/framework/Source/CPTTimeFormatter.h b/framework/Source/CPTTimeFormatter.h index 62328736c..9a5de1b9d 100644 --- a/framework/Source/CPTTimeFormatter.h +++ b/framework/Source/CPTTimeFormatter.h @@ -1,5 +1,3 @@ -/// @file - @interface CPTTimeFormatter : NSNumberFormatter @property (nonatomic, readwrite, strong, nullable) NSDateFormatter *dateFormatter; diff --git a/framework/Source/CPTTimeFormatter.m b/framework/Source/CPTTimeFormatter.m index d35d6dc94..8d0ad4b51 100644 --- a/framework/Source/CPTTimeFormatter.m +++ b/framework/Source/CPTTimeFormatter.m @@ -49,7 +49,7 @@ -(nonnull instancetype)init **/ -(nonnull instancetype)initWithDateFormatter:(nullable NSDateFormatter *)aDateFormatter { - if ( (self = [super init]) ) { + if ((self = [super init])) { dateFormatter = aDateFormatter; referenceDate = nil; } @@ -77,7 +77,7 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { dateFormatter = [coder decodeObjectForKey:@"CPTTimeFormatter.dateFormatter"]; referenceDate = [[coder decodeObjectForKey:@"CPTTimeFormatter.referenceDate"] copy]; } @@ -116,7 +116,7 @@ -(nonnull id)copyWithZone:(nullable NSZone *)zone * @param coordinateValue The time value. * @return The date string. **/ --(nullable NSString *)stringForObjectValue:(nonnull id)coordinateValue +-(nullable NSString *)stringForObjectValue:(nullable id)coordinateValue { NSString *string = nil; diff --git a/framework/Source/CPTTimeFormatterTests.m b/framework/Source/CPTTimeFormatterTests.m index fbcf5b822..52d5fcfc1 100644 --- a/framework/Source/CPTTimeFormatterTests.m +++ b/framework/Source/CPTTimeFormatterTests.m @@ -18,7 +18,7 @@ -(void)testKeyedArchivingRoundTrip CPTTimeFormatter *timeFormatter = [[CPTTimeFormatter alloc] initWithDateFormatter:dateFormatter]; timeFormatter.referenceDate = refDate; - CPTTimeFormatter *newTimeFormatter = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:timeFormatter]]; + CPTTimeFormatter *newTimeFormatter = [self archiveRoundTrip:timeFormatter]; XCTAssertEqualObjects(timeFormatter.dateFormatter.dateFormat, newTimeFormatter.dateFormatter.dateFormat, @"Date formatter not equal"); XCTAssertEqualObjects(timeFormatter.referenceDate, newTimeFormatter.referenceDate, @"Reference date not equal"); diff --git a/framework/Source/CPTTradingRangePlot.h b/framework/Source/CPTTradingRangePlot.h index f9a4d4122..b32085afe 100644 --- a/framework/Source/CPTTradingRangePlot.h +++ b/framework/Source/CPTTradingRangePlot.h @@ -7,18 +7,24 @@ @class CPTTradingRangePlot; +/** + * @brief Trading range plot bindings. + **/ +typedef NSString *CPTTradingRangePlotBinding cpt_swift_struct; + /// @ingroup plotBindingsTradingRangePlot /// @{ -extern NSString *__nonnull const CPTTradingRangePlotBindingXValues; -extern NSString *__nonnull const CPTTradingRangePlotBindingOpenValues; -extern NSString *__nonnull const CPTTradingRangePlotBindingHighValues; -extern NSString *__nonnull const CPTTradingRangePlotBindingLowValues; -extern NSString *__nonnull const CPTTradingRangePlotBindingCloseValues; -extern NSString *__nonnull const CPTTradingRangePlotBindingIncreaseFills; -extern NSString *__nonnull const CPTTradingRangePlotBindingDecreaseFills; -extern NSString *__nonnull const CPTTradingRangePlotBindingLineStyles; -extern NSString *__nonnull const CPTTradingRangePlotBindingIncreaseLineStyles; -extern NSString *__nonnull const CPTTradingRangePlotBindingDecreaseLineStyles; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingXValues; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingOpenValues; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingHighValues; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingLowValues; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingCloseValues; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingIncreaseFills; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingDecreaseFills; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingLineStyles; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingIncreaseLineStyles; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingDecreaseLineStyles; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingBarWidths; /// @} /** @@ -56,7 +62,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @param indexRange The range of the data indexes of interest. * @return An array of fills. **/ --(nullable CPTFillArray)increaseFillsForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTFillArray *)increaseFillsForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets the fill used with a candlestick plot when close >= open for the given plot. * This method will not be called if @@ -73,7 +79,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @param plot The trading range plot. * @param indexRange The range of the data indexes of interest. **/ --(nullable CPTFillArray)decreaseFillsForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTFillArray *)decreaseFillsForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets the fill used with a candlestick plot when close < open for the given plot. * This method will not be called if @@ -86,6 +92,23 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { **/ -(nullable CPTFill *)decreaseFillForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; +/** @brief @optional Gets an array of bar widths for the given trading range plot. + * @param plot The trading range plot. + * @param indexRange The range of the data indexes of interest. + * @return An array of bar widths. + **/ +-(nullable CPTNumberArray *)barWidthsForTradingRangePlot:(nonnull CPTTradingRangePlot *)barPlot recordIndexRange:(NSRange)indexRange; + +/** @brief @optional Gets a bar width for the given trading range plot. + * This method will not be called if + * @link CPTTradingRangePlotDataSource::barWidthForTradingRangePlot:recordIndexRange: -barWidthForTradingRangePlot:recordIndexRange: @endlink + * is also implemented in the datasource. + * @param plot The tradingrange plot. + * @param idx The data index of interest. + * @return The bar width for the bar with the given index. If the data source returns @nil, the default barWidth is used. + **/ +-(nullable NSNumber *)barWidthForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; + /// @} /// @name Bar Line Styles @@ -96,7 +119,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @param indexRange The range of the data indexes of interest. * @return An array of line styles. **/ --(nullable CPTLineStyleArray)lineStylesForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLineStyleArray *)lineStylesForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets the line style used to draw candlestick or OHLC symbols for the given trading range plot. * This method will not be called if @@ -114,7 +137,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @param indexRange The range of the data indexes of interest. * @return An array of line styles. **/ --(nullable CPTLineStyleArray)increaseLineStylesForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLineStyleArray *)increaseLineStylesForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets the line style used to outline candlestick symbols when close >= open for the given trading range plot. * This method will not be called if @@ -132,7 +155,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @param indexRange The range of the data indexes of interest. * @return An array of line styles. **/ --(nullable CPTLineStyleArray)decreaseLineStylesForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLineStyleArray *)decreaseLineStylesForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets the line style used to outline candlestick symbols when close < open for the given trading range plot. * This method will not be called if @@ -256,6 +279,8 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { -(void)reloadBarFillsInIndexRange:(NSRange)indexRange; -(void)reloadBarLineStyles; -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange; +-(void)reloadBarWidths; +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange; /// @} @end diff --git a/framework/Source/CPTTradingRangePlot.m b/framework/Source/CPTTradingRangePlot.m index 79218c679..3589b2870 100644 --- a/framework/Source/CPTTradingRangePlot.m +++ b/framework/Source/CPTTradingRangePlot.m @@ -12,6 +12,7 @@ #import "CPTUtilities.h" #import "CPTXYPlotSpace.h" #import "NSCoderExtensions.h" +#import "NSNumberExtensions.h" #import "tgmath.h" /** @defgroup plotAnimationTradingRangePlot Trading Range Plot @@ -26,16 +27,17 @@ * @endif **/ -NSString *const CPTTradingRangePlotBindingXValues = @"xValues"; ///< X values. -NSString *const CPTTradingRangePlotBindingOpenValues = @"openValues"; ///< Open price values. -NSString *const CPTTradingRangePlotBindingHighValues = @"highValues"; ///< High price values. -NSString *const CPTTradingRangePlotBindingLowValues = @"lowValues"; ///< Low price values. -NSString *const CPTTradingRangePlotBindingCloseValues = @"closeValues"; ///< Close price values. -NSString *const CPTTradingRangePlotBindingIncreaseFills = @"increaseFills"; ///< Fills used with a candlestick plot when close >= open. -NSString *const CPTTradingRangePlotBindingDecreaseFills = @"decreaseFills"; ///< Fills used with a candlestick plot when close < open. -NSString *const CPTTradingRangePlotBindingLineStyles = @"lineStyles"; ///< Line styles used to draw candlestick or OHLC symbols. -NSString *const CPTTradingRangePlotBindingIncreaseLineStyles = @"increaseLineStyles"; ///< Line styles used to outline candlestick symbols when close >= open. -NSString *const CPTTradingRangePlotBindingDecreaseLineStyles = @"decreaseLineStyles"; ///< Line styles used to outline candlestick symbols when close < open. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingXValues = @"xValues"; ///< X values. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingOpenValues = @"openValues"; ///< Open price values. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingHighValues = @"highValues"; ///< High price values. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingLowValues = @"lowValues"; ///< Low price values. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingCloseValues = @"closeValues"; ///< Close price values. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingIncreaseFills = @"increaseFills"; ///< Fills used with a candlestick plot when close >= open. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingDecreaseFills = @"decreaseFills"; ///< Fills used with a candlestick plot when close < open. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingLineStyles = @"lineStyles"; ///< Line styles used to draw candlestick or OHLC symbols. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingIncreaseLineStyles = @"increaseLineStyles"; ///< Line styles used to outline candlestick symbols when close >= open. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingDecreaseLineStyles = @"decreaseLineStyles"; ///< Line styles used to outline candlestick symbols when close < open. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingBarWidths = @"barWidths"; ///< Bar widths. static const CPTCoordinate independentCoord = CPTCoordinateX; static const CPTCoordinate dependentCoord = CPTCoordinateY; @@ -48,14 +50,15 @@ @interface CPTTradingRangePlot() @property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *highValues; @property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *lowValues; @property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *closeValues; -@property (nonatomic, readwrite, copy, nullable) CPTFillArray increaseFills; -@property (nonatomic, readwrite, copy, nullable) CPTFillArray decreaseFills; -@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray lineStyles; -@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray increaseLineStyles; -@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray decreaseLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTFillArray *increaseFills; +@property (nonatomic, readwrite, copy, nullable) CPTFillArray *decreaseFills; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *lineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *increaseLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *decreaseLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *barWidths; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownIndex; --(void)drawCandleStickInContext:(nonnull CGContextRef)context atIndex:(NSUInteger)idx x:(CGFloat)x open:(CGFloat)openValue close:(CGFloat)closeValue high:(CGFloat)highValue low:(CGFloat)lowValue alignPoints:(BOOL)alignPoints; +-(void)drawCandleStickInContext:(nonnull CGContextRef)context atIndex:(NSUInteger)idx x:(CGFloat)x open:(CGFloat)openValue close:(CGFloat)closeValue high:(CGFloat)highValue low:(CGFloat)lowValue width:(CGFloat)width alignPoints:(BOOL)alignPoints; -(void)drawOHLCInContext:(nonnull CGContextRef)context atIndex:(NSUInteger)idx x:(CGFloat)x open:(CGFloat)openValue close:(CGFloat)closeValue high:(CGFloat)highValue low:(CGFloat)lowValue alignPoints:(BOOL)alignPoints; -(nullable CPTFill *)increaseFillForIndex:(NSUInteger)idx; @@ -65,6 +68,8 @@ -(nullable CPTLineStyle *)lineStyleForIndex:(NSUInteger)idx; -(nullable CPTLineStyle *)increaseLineStyleForIndex:(NSUInteger)idx; -(nullable CPTLineStyle *)decreaseLineStyleForIndex:(NSUInteger)idx; +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx; + @end /// @endcond @@ -90,6 +95,7 @@ @implementation CPTTradingRangePlot @dynamic lineStyles; @dynamic increaseLineStyles; @dynamic decreaseLineStyles; +@dynamic barWidths; /** @property nullable CPTLineStyle *lineStyle * @brief The line style used to draw candlestick or OHLC symbols. @@ -159,7 +165,7 @@ @implementation CPTTradingRangePlot /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -174,8 +180,10 @@ +(void)initialize [self exposeBinding:CPTTradingRangePlotBindingLineStyles]; [self exposeBinding:CPTTradingRangePlotBindingIncreaseLineStyles]; [self exposeBinding:CPTTradingRangePlotBindingDecreaseLineStyles]; + [self exposeBinding:CPTTradingRangePlotBindingBarWidths]; } } + #endif /// @endcond @@ -203,7 +211,7 @@ +(void)initialize **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { plotStyle = CPTTradingRangePlotStyleOHLC; lineStyle = [[CPTLineStyle alloc] init]; increaseLineStyle = nil; @@ -228,7 +236,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTTradingRangePlot *theLayer = (CPTTradingRangePlot *)layer; plotStyle = theLayer->plotStyle; @@ -275,17 +283,22 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - lineStyle = [[coder decodeObjectForKey:@"CPTTradingRangePlot.lineStyle"] copy]; - increaseLineStyle = [[coder decodeObjectForKey:@"CPTTradingRangePlot.increaseLineStyle"] copy]; - decreaseLineStyle = [[coder decodeObjectForKey:@"CPTTradingRangePlot.decreaseLineStyle"] copy]; - increaseFill = [[coder decodeObjectForKey:@"CPTTradingRangePlot.increaseFill"] copy]; - decreaseFill = [[coder decodeObjectForKey:@"CPTTradingRangePlot.decreaseFill"] copy]; - plotStyle = (CPTTradingRangePlotStyle)[coder decodeIntegerForKey:@"CPTTradingRangePlot.plotStyle"]; - barWidth = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.barWidth"]; - stickLength = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.stickLength"]; - barCornerRadius = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.barCornerRadius"]; - showBarBorder = [coder decodeBoolForKey:@"CPTTradingRangePlot.showBarBorder"]; + if ((self = [super initWithCoder:coder])) { + lineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTTradingRangePlot.lineStyle"] copy]; + increaseLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTTradingRangePlot.increaseLineStyle"] copy]; + decreaseLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTTradingRangePlot.decreaseLineStyle"] copy]; + increaseFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTTradingRangePlot.increaseFill"] copy]; + decreaseFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTTradingRangePlot.decreaseFill"] copy]; + plotStyle = (CPTTradingRangePlotStyle)[coder decodeIntegerForKey:@"CPTTradingRangePlot.plotStyle"]; + barWidth = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.barWidth"]; + stickLength = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.stickLength"]; + barCornerRadius = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.barCornerRadius"]; + showBarBorder = [coder decodeBoolForKey:@"CPTTradingRangePlot.showBarBorder"]; pointingDeviceDownIndex = NSNotFound; } @@ -294,6 +307,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Data Loading @@ -308,6 +333,9 @@ -(void)reloadDataInIndexRange:(NSRange)indexRange // Line styles [self reloadBarLineStylesInIndexRange:indexRange]; + + // Bar widths + [self reloadBarWidthsInIndexRange:indexRange]; } -(void)reloadPlotDataInIndexRange:(NSRange)indexRange @@ -369,9 +397,9 @@ -(void)reloadBarFillsInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(increaseFillForTradingRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - CPTMutableFillArray array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableFillArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTFill *dataSourceFill = [theDataSource increaseFillForTradingRangePlot:self recordIndex:idx]; @@ -397,9 +425,9 @@ -(void)reloadBarFillsInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(decreaseFillForTradingRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - CPTMutableFillArray array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableFillArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTFill *dataSourceFill = [theDataSource decreaseFillForTradingRangePlot:self recordIndex:idx]; @@ -450,9 +478,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(lineStyleForTradingRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - CPTMutableLineStyleArray array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLineStyleArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLineStyle *dataSourceLineStyle = [theDataSource lineStyleForTradingRangePlot:self recordIndex:idx]; @@ -478,9 +506,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(increaseLineStyleForTradingRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - CPTMutableLineStyleArray array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLineStyleArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLineStyle *dataSourceLineStyle = [theDataSource increaseLineStyleForTradingRangePlot:self recordIndex:idx]; @@ -506,9 +534,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(decreaseLineStyleForTradingRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - CPTMutableLineStyleArray array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLineStyleArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLineStyle *dataSourceLineStyle = [theDataSource decreaseLineStyleForTradingRangePlot:self recordIndex:idx]; @@ -531,6 +559,49 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange [self setNeedsDisplay]; } +/** + * @brief Reload all bar widths from the data source immediately. + **/ +-(void)reloadBarWidths +{ + [self reloadBarWidthsInIndexRange:NSMakeRange(0, self.cachedDataCount)]; +} + +/** @brief Reload bar widths in the given index range from the data source immediately. + * @param indexRange The index range to load. + **/ +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange +{ + id theDataSource = (id)self.dataSource; + + if ( [theDataSource respondsToSelector:@selector(barWidthsForTradingRangePlot:recordIndexRange:)] ) { + [self cacheArray:[theDataSource barWidthsForTradingRangePlot:self recordIndexRange:indexRange] + forKey:CPTTradingRangePlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + else if ( [theDataSource respondsToSelector:@selector(barWidthForTradingRangePlot:recordIndex:)] ) { + id nilObject = [CPTPlot nilData]; + CPTMutableNumberArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); + + for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { + NSNumber *width = [theDataSource barWidthForTradingRangePlot:self recordIndex:idx]; + if ( width ) { + [array addObject:width]; + } + else { + [array addObject:nilObject]; + } + } + + [self cacheArray:array + forKey:CPTTradingRangePlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + + [self setNeedsDisplay]; +} + #pragma mark - #pragma mark Drawing @@ -552,11 +623,11 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context if ( sampleCount == 0 ) { return; } - if ( (opens == nil) || (highs == nil) || (lows == nil) || (closes == nil) ) { + if ((opens == nil) || (highs == nil) || (lows == nil) || (closes == nil)) { return; } - if ( (opens.numberOfSamples != sampleCount) || (highs.numberOfSamples != sampleCount) || (lows.numberOfSamples != sampleCount) || (closes.numberOfSamples != sampleCount) ) { + if ((opens.numberOfSamples != sampleCount) || (highs.numberOfSamples != sampleCount) || (lows.numberOfSamples != sampleCount) || (closes.numberOfSamples != sampleCount)) { [NSException raise:CPTException format:@"Mismatching number of data values in trading range plot"]; } @@ -580,7 +651,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context for ( NSUInteger i = 0; i < sampleCount; i++ ) { double plotPoint[2]; plotPoint[independentCoord] = *locationBytes++; - if ( isnan(plotPoint[independentCoord]) ) { + if ( isnan(plotPoint[independentCoord])) { openBytes++; highBytes++; lowBytes++; @@ -590,7 +661,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context // open point plotPoint[dependentCoord] = *openBytes++; - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { openPoint = CPTPointMake(NAN, NAN); } else { @@ -599,7 +670,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context // high point plotPoint[dependentCoord] = *highBytes++; - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { highPoint = CPTPointMake(NAN, NAN); } else { @@ -608,7 +679,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context // low point plotPoint[dependentCoord] = *lowBytes++; - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { lowPoint = CPTPointMake(NAN, NAN); } else { @@ -617,7 +688,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context // close point plotPoint[dependentCoord] = *closeBytes++; - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { closePoint = CPTPointMake(NAN, NAN); } else { @@ -625,17 +696,17 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context } CGFloat xCoord = openPoint.x; - if ( isnan(xCoord) ) { + if ( isnan(xCoord)) { xCoord = highPoint.x; } - else if ( isnan(xCoord) ) { + else if ( isnan(xCoord)) { xCoord = lowPoint.x; } - else if ( isnan(xCoord) ) { + else if ( isnan(xCoord)) { xCoord = closePoint.x; } - if ( !isnan(xCoord) ) { + if ( !isnan(xCoord)) { // Draw switch ( thePlotStyle ) { case CPTTradingRangePlotStyleOHLC: @@ -657,6 +728,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context close:closePoint.y high:highPoint.y low:lowPoint.y + width:[self barWidthForIndex:i].cgFloatValue alignPoints:alignPoints]; break; } @@ -673,7 +745,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context for ( NSUInteger i = 0; i < sampleCount; i++ ) { NSDecimal plotPoint[2]; plotPoint[independentCoord] = *locationBytes++; - if ( NSDecimalIsNotANumber(&plotPoint[independentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[independentCoord])) { openBytes++; highBytes++; lowBytes++; @@ -683,7 +755,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context // open point plotPoint[dependentCoord] = *openBytes++; - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { openPoint = CPTPointMake(NAN, NAN); } else { @@ -692,7 +764,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context // high point plotPoint[dependentCoord] = *highBytes++; - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { highPoint = CPTPointMake(NAN, NAN); } else { @@ -701,7 +773,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context // low point plotPoint[dependentCoord] = *lowBytes++; - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { lowPoint = CPTPointMake(NAN, NAN); } else { @@ -710,7 +782,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context // close point plotPoint[dependentCoord] = *closeBytes++; - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { closePoint = CPTPointMake(NAN, NAN); } else { @@ -718,17 +790,17 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context } CGFloat xCoord = openPoint.x; - if ( isnan(xCoord) ) { + if ( isnan(xCoord)) { xCoord = highPoint.x; } - else if ( isnan(xCoord) ) { + else if ( isnan(xCoord)) { xCoord = lowPoint.x; } - else if ( isnan(xCoord) ) { + else if ( isnan(xCoord)) { xCoord = closePoint.x; } - if ( !isnan(xCoord) ) { + if ( !isnan(xCoord)) { // Draw switch ( thePlotStyle ) { case CPTTradingRangePlotStyleOHLC: @@ -750,6 +822,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context close:closePoint.y high:highPoint.y low:lowPoint.y + width:[self barWidthForIndex:i].cgFloatValue alignPoints:alignPoints]; break; } @@ -767,13 +840,15 @@ -(void)drawCandleStickInContext:(nonnull CGContextRef)context close:(CGFloat)closeValue high:(CGFloat)highValue low:(CGFloat)lowValue + width:(CGFloat)width alignPoints:(BOOL)alignPoints { - const CGFloat halfBarWidth = CPTFloat(0.5) * self.barWidth; + const CGFloat halfBarWidth = CPTFloat(0.5) * width; + CPTFill *currentBarFill = nil; CPTLineStyle *theBorderLineStyle = nil; - if ( !isnan(openValue) && !isnan(closeValue) ) { + if ( !isnan(openValue) && !isnan(closeValue)) { if ( openValue < closeValue ) { theBorderLineStyle = [self increaseLineStyleForIndex:idx]; currentBarFill = [self increaseFillForIndex:idx]; @@ -798,13 +873,13 @@ -(void)drawCandleStickInContext:(nonnull CGContextRef)context [theBorderLineStyle setLineStyleInContext:context]; CGFloat lineWidth = theBorderLineStyle.lineWidth; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } } // high - low only - if ( hasLineStyle && !isnan(highValue) && !isnan(lowValue) && ( isnan(openValue) || isnan(closeValue) ) ) { + if ( hasLineStyle && !isnan(highValue) && !isnan(lowValue) && (isnan(openValue) || isnan(closeValue))) { CGPoint alignedHighPoint = CPTPointMake(x, highValue); CGPoint alignedLowPoint = CPTPointMake(x, lowValue); if ( alignPoints ) { @@ -824,10 +899,10 @@ -(void)drawCandleStickInContext:(nonnull CGContextRef)context } // open-close - if ( !isnan(openValue) && !isnan(closeValue) ) { + if ( !isnan(openValue) && !isnan(closeValue)) { if ( currentBarFill || hasLineStyle ) { CGFloat radius = MIN(self.barCornerRadius, halfBarWidth); - radius = MIN( radius, ABS(closeValue - openValue) ); + radius = MIN(radius, ABS(closeValue - openValue)); CGPoint alignedPoint1 = CPTPointMake(x + halfBarWidth, openValue); CGPoint alignedPoint2 = CPTPointMake(x + halfBarWidth, closeValue); @@ -851,7 +926,7 @@ -(void)drawCandleStickInContext:(nonnull CGContextRef)context } } - if ( hasLineStyle && (openValue == closeValue) ) { + if ( hasLineStyle && (openValue == closeValue)) { // #285 Draw a cross with open/close values marked const CGFloat halfLineWidth = CPTFloat(0.5) * theBorderLineStyle.lineWidth; @@ -881,9 +956,9 @@ -(void)drawCandleStickInContext:(nonnull CGContextRef)context path = CGPathCreateMutable(); } - if ( !isnan(lowValue) ) { - if ( lowValue < MIN(openValue, closeValue) ) { - CGPoint alignedStartPoint = CPTPointMake( x, MIN(openValue, closeValue) ); + if ( !isnan(lowValue)) { + if ( lowValue < MIN(openValue, closeValue)) { + CGPoint alignedStartPoint = CPTPointMake(x, MIN(openValue, closeValue)); CGPoint alignedLowPoint = CPTPointMake(x, lowValue); if ( alignPoints ) { alignedStartPoint = alignmentFunction(context, alignedStartPoint); @@ -894,9 +969,9 @@ -(void)drawCandleStickInContext:(nonnull CGContextRef)context CGPathAddLineToPoint(path, NULL, alignedLowPoint.x, alignedLowPoint.y); } } - if ( !isnan(highValue) ) { - if ( highValue > MAX(openValue, closeValue) ) { - CGPoint alignedStartPoint = CPTPointMake( x, MAX(openValue, closeValue) ); + if ( !isnan(highValue)) { + if ( highValue > MAX(openValue, closeValue)) { + CGPoint alignedStartPoint = CPTPointMake(x, MAX(openValue, closeValue)); CGPoint alignedHighPoint = CPTPointMake(x, highValue); if ( alignPoints ) { alignedStartPoint = alignmentFunction(context, alignedStartPoint); @@ -928,7 +1003,7 @@ -(void)drawOHLCInContext:(nonnull CGContextRef)context { CPTLineStyle *theLineStyle = [self lineStyleForIndex:idx]; - if ( !isnan(openValue) && !isnan(closeValue) ) { + if ( !isnan(openValue) && !isnan(closeValue)) { if ( openValue < closeValue ) { CPTLineStyle *lineStyleForIncrease = [self increaseLineStyleForIndex:idx]; if ( [lineStyleForIncrease isKindOfClass:[CPTLineStyle class]] ) { @@ -950,12 +1025,12 @@ -(void)drawOHLCInContext:(nonnull CGContextRef)context CPTAlignPointFunction alignmentFunction = CPTAlignPointToUserSpace; CGFloat lineWidth = theLineStyle.lineWidth; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } // high-low - if ( !isnan(highValue) && !isnan(lowValue) ) { + if ( !isnan(highValue) && !isnan(lowValue)) { CGPoint alignedHighPoint = CPTPointMake(x, highValue); CGPoint alignedLowPoint = CPTPointMake(x, lowValue); if ( alignPoints ) { @@ -967,7 +1042,7 @@ -(void)drawOHLCInContext:(nonnull CGContextRef)context } // open - if ( !isnan(openValue) ) { + if ( !isnan(openValue)) { CGPoint alignedOpenStartPoint = CPTPointMake(x, openValue); CGPoint alignedOpenEndPoint = CPTPointMake(x - theStickLength, openValue); // left side if ( alignPoints ) { @@ -979,7 +1054,7 @@ -(void)drawOHLCInContext:(nonnull CGContextRef)context } // close - if ( !isnan(closeValue) ) { + if ( !isnan(closeValue)) { CGPoint alignedCloseStartPoint = CPTPointMake(x, closeValue); CGPoint alignedCloseEndPoint = CPTPointMake(x + theStickLength, closeValue); // right side if ( alignPoints ) { @@ -1008,7 +1083,7 @@ -(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx i switch ( self.plotStyle ) { case CPTTradingRangePlotStyleOHLC: [self drawOHLCInContext:context - atIndex:idx + atIndex:0 x:CGRectGetMidX(rect) open:CGRectGetMinY(rect) + rect.size.height / CPTFloat(3.0) close:CGRectGetMinY(rect) + rect.size.height * (CGFloat)(2.0 / 3.0) @@ -1019,12 +1094,13 @@ -(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx i case CPTTradingRangePlotStyleCandleStick: [self drawCandleStickInContext:context - atIndex:idx + atIndex:0 x:CGRectGetMidX(rect) open:CGRectGetMinY(rect) + rect.size.height / CPTFloat(3.0) close:CGRectGetMinY(rect) + rect.size.height * (CGFloat)(2.0 / 3.0) high:CGRectGetMaxY(rect) low:CGRectGetMinY(rect) + width:rect.size.width * CPTFloat(0.8) alignPoints:YES]; break; } @@ -1035,7 +1111,7 @@ -(nullable CPTFill *)increaseFillForIndex:(NSUInteger)idx { CPTFill *theFill = [self cachedValueForKey:CPTTradingRangePlotBindingIncreaseFills recordIndex:idx]; - if ( (theFill == nil) || (theFill == [CPTPlot nilData]) ) { + if ((theFill == nil) || (theFill == [CPTPlot nilData])) { theFill = self.increaseFill; } @@ -1046,7 +1122,7 @@ -(nullable CPTFill *)decreaseFillForIndex:(NSUInteger)idx { CPTFill *theFill = [self cachedValueForKey:CPTTradingRangePlotBindingDecreaseFills recordIndex:idx]; - if ( (theFill == nil) || (theFill == [CPTPlot nilData]) ) { + if ((theFill == nil) || (theFill == [CPTPlot nilData])) { theFill = self.decreaseFill; } @@ -1057,7 +1133,7 @@ -(nullable CPTLineStyle *)lineStyleForIndex:(NSUInteger)idx { CPTLineStyle *theLineStyle = [self cachedValueForKey:CPTTradingRangePlotBindingLineStyles recordIndex:idx]; - if ( (theLineStyle == nil) || (theLineStyle == [CPTPlot nilData]) ) { + if ((theLineStyle == nil) || (theLineStyle == [CPTPlot nilData])) { theLineStyle = self.lineStyle; } @@ -1068,7 +1144,7 @@ -(nullable CPTLineStyle *)increaseLineStyleForIndex:(NSUInteger)idx { CPTLineStyle *theLineStyle = [self cachedValueForKey:CPTTradingRangePlotBindingIncreaseLineStyles recordIndex:idx]; - if ( (theLineStyle == nil) || (theLineStyle == [CPTPlot nilData]) ) { + if ((theLineStyle == nil) || (theLineStyle == [CPTPlot nilData])) { theLineStyle = self.increaseLineStyle; } @@ -1083,7 +1159,7 @@ -(nullable CPTLineStyle *)decreaseLineStyleForIndex:(NSUInteger)idx { CPTLineStyle *theLineStyle = [self cachedValueForKey:CPTTradingRangePlotBindingDecreaseLineStyles recordIndex:idx]; - if ( (theLineStyle == nil) || (theLineStyle == [CPTPlot nilData]) ) { + if ((theLineStyle == nil) || (theLineStyle == [CPTPlot nilData])) { theLineStyle = self.decreaseLineStyle; } @@ -1094,6 +1170,17 @@ -(nullable CPTLineStyle *)decreaseLineStyleForIndex:(NSUInteger)idx return theLineStyle; } +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx +{ + NSNumber *theBarWidth = [self cachedValueForKey:CPTTradingRangePlotBindingBarWidths recordIndex:idx]; + + if ((theBarWidth == nil) || (theBarWidth == [CPTPlot nilData])) { + theBarWidth = @(self.barWidth); + } + + return theBarWidth; +} + /// @endcond #pragma mark - @@ -1133,7 +1220,7 @@ -(NSUInteger)numberOfFields return 5; } --(nonnull CPTNumberArray)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[@(CPTTradingRangePlotFieldX), @(CPTTradingRangePlotFieldOpen), @@ -1142,21 +1229,21 @@ -(nonnull CPTNumberArray)fieldIdentifiers @(CPTTradingRangePlotFieldLow)]; } --(nonnull CPTNumberArray)fieldIdentifiersForCoordinate:(CPTCoordinate)coord +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord { - CPTNumberArray result = nil; + CPTNumberArray *result = nil; switch ( coord ) { case CPTCoordinateX: result = @[@(CPTTradingRangePlotFieldX)]; - break; + break; case CPTCoordinateY: result = @[@(CPTTradingRangePlotFieldOpen), @(CPTTradingRangePlotFieldLow), @(CPTTradingRangePlotFieldHigh), @(CPTTradingRangePlotFieldClose)]; - break; + break; default: [NSException raise:CPTException format:@"Invalid coordinate passed to fieldIdentifiersForCoordinate:"]; @@ -1200,17 +1287,22 @@ -(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex: BOOL positiveDirection = YES; CPTPlotRange *yRange = [self.plotSpace plotRangeForCoordinate:CPTCoordinateY]; - if ( CPTDecimalLessThan( yRange.lengthDecimal, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalLessThan(yRange.lengthDecimal, CPTDecimalFromInteger(0))) { positiveDirection = !positiveDirection; } - NSNumber *xValue = [self cachedNumberForField:CPTTradingRangePlotFieldX recordIndex:idx]; + NSNumber *xValue = [self cachedNumberForField:CPTTradingRangePlotFieldX recordIndex:idx]; + NSNumber *openValue = [self cachedNumberForField:CPTTradingRangePlotFieldOpen recordIndex:idx]; + NSNumber *closeValue = [self cachedNumberForField:CPTTradingRangePlotFieldClose recordIndex:idx]; + NSNumber *highValue = [self cachedNumberForField:CPTTradingRangePlotFieldHigh recordIndex:idx]; + NSNumber *lowValue = [self cachedNumberForField:CPTTradingRangePlotFieldLow recordIndex:idx]; + NSNumber *yValue; - CPTNumberArray yValues = @[[self cachedNumberForField:CPTTradingRangePlotFieldOpen recordIndex:idx], - [self cachedNumberForField:CPTTradingRangePlotFieldClose recordIndex:idx], - [self cachedNumberForField:CPTTradingRangePlotFieldHigh recordIndex:idx], - [self cachedNumberForField:CPTTradingRangePlotFieldLow recordIndex:idx]]; - CPTNumberArray yValuesSorted = [yValues sortedArrayUsingSelector:@selector(compare:)]; + CPTNumberArray *yValues = @[openValue, + closeValue, + highValue, + lowValue]; + CPTNumberArray *yValuesSorted = [yValues sortedArrayUsingSelector:@selector(compare:)]; if ( positiveDirection ) { yValue = yValuesSorted.lastObject; } @@ -1284,7 +1376,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !isnan(plotPoint[dependentCoord]) && [yRange containsDouble:plotPoint[dependentCoord]] ) { openPoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, openPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1298,7 +1390,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !isnan(plotPoint[dependentCoord]) && [yRange containsDouble:plotPoint[dependentCoord]] ) { highPoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, highPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1312,7 +1404,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !isnan(plotPoint[dependentCoord]) && [yRange containsDouble:plotPoint[dependentCoord]] ) { lowPoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, lowPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1326,7 +1418,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !isnan(plotPoint[dependentCoord]) && [yRange containsDouble:plotPoint[dependentCoord]] ) { closePoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, closePoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1337,18 +1429,18 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( result == i ) { lastViewX = openPoint.x; - if ( isnan(lastViewX) ) { + if ( isnan(lastViewX)) { lastViewX = highPoint.x; } - else if ( isnan(lastViewX) ) { + else if ( isnan(lastViewX)) { lastViewX = lowPoint.x; } - else if ( isnan(lastViewX) ) { + else if ( isnan(lastViewX)) { lastViewX = closePoint.x; } - lastViewMin = MIN( MIN(openPoint.y, closePoint.y), MIN(highPoint.y, lowPoint.y) ); - lastViewMax = MAX( MAX(openPoint.y, closePoint.y), MAX(highPoint.y, lowPoint.y) ); + lastViewMin = MIN(MIN(openPoint.y, closePoint.y), MIN(highPoint.y, lowPoint.y)); + lastViewMax = MAX(MAX(openPoint.y, closePoint.y), MAX(highPoint.y, lowPoint.y)); } } } @@ -1377,7 +1469,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !NSDecimalIsNotANumber(&plotPoint[dependentCoord]) && [yRange contains:plotPoint[dependentCoord]] ) { openPoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, openPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1391,7 +1483,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !NSDecimalIsNotANumber(&plotPoint[dependentCoord]) && [yRange contains:plotPoint[dependentCoord]] ) { highPoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, highPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1405,7 +1497,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !NSDecimalIsNotANumber(&plotPoint[dependentCoord]) && [yRange contains:plotPoint[dependentCoord]] ) { lowPoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, lowPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1419,7 +1511,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !NSDecimalIsNotANumber(&plotPoint[dependentCoord]) && [yRange contains:plotPoint[dependentCoord]] ) { closePoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, closePoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1430,18 +1522,18 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( result == i ) { lastViewX = openPoint.x; - if ( isnan(lastViewX) ) { + if ( isnan(lastViewX)) { lastViewX = highPoint.x; } - else if ( isnan(lastViewX) ) { + else if ( isnan(lastViewX)) { lastViewX = lowPoint.x; } - else if ( isnan(lastViewX) ) { + else if ( isnan(lastViewX)) { lastViewX = closePoint.x; } - lastViewMin = MIN( MIN(openPoint.y, closePoint.y), MIN(highPoint.y, lowPoint.y) ); - lastViewMax = MAX( MAX(openPoint.y, closePoint.y), MAX(highPoint.y, lowPoint.y) ); + lastViewMin = MIN(MIN(openPoint.y, closePoint.y), MIN(highPoint.y, lowPoint.y)); + lastViewMax = MAX(MAX(openPoint.y, closePoint.y), MAX(highPoint.y, lowPoint.y)); } } } @@ -1455,14 +1547,14 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point break; case CPTTradingRangePlotStyleCandleStick: - offset = self.barWidth * CPTFloat(0.5); + offset = [self barWidthForIndex:result].cgFloatValue * CPTFloat(0.5); break; } - if ( ( point.x < (lastViewX - offset) ) || ( point.x > (lastViewX + offset) ) ) { + if ((point.x < (lastViewX - offset)) || (point.x > (lastViewX + offset))) { result = NSNotFound; } - if ( (point.y < lastViewMin) || (point.y > lastViewMax) ) { + if ((point.y < lastViewMin) || (point.y > lastViewMax)) { result = NSNotFound; } } @@ -1502,7 +1594,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(tradingRangePlot:barTouchDownAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(tradingRangePlot:barTouchDownAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(tradingRangePlot:barWasSelectedAtRecordIndex:)] || @@ -1571,7 +1663,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(tradingRangePlot:barTouchUpAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(tradingRangePlot:barTouchUpAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(tradingRangePlot:barWasSelectedAtRecordIndex:)] || @@ -1759,56 +1851,56 @@ -(void)setCloseValues:(nullable CPTMutableNumericData *)newValues [self cacheNumbers:newValues forField:CPTTradingRangePlotFieldClose]; } --(nullable CPTFillArray)increaseFills +-(nullable CPTFillArray *)increaseFills { return [self cachedArrayForKey:CPTTradingRangePlotBindingIncreaseFills]; } --(void)setIncreaseFills:(nullable CPTFillArray)newFills +-(void)setIncreaseFills:(nullable CPTFillArray *)newFills { [self cacheArray:newFills forKey:CPTTradingRangePlotBindingIncreaseFills]; [self setNeedsDisplay]; } --(nullable CPTFillArray)decreaseFills +-(nullable CPTFillArray *)decreaseFills { return [self cachedArrayForKey:CPTTradingRangePlotBindingDecreaseFills]; } --(void)setDecreaseFills:(nullable CPTFillArray)newFills +-(void)setDecreaseFills:(nullable CPTFillArray *)newFills { [self cacheArray:newFills forKey:CPTTradingRangePlotBindingDecreaseFills]; [self setNeedsDisplay]; } --(nullable CPTLineStyleArray)lineStyles +-(nullable CPTLineStyleArray *)lineStyles { return [self cachedArrayForKey:CPTTradingRangePlotBindingLineStyles]; } --(void)setLineStyles:(nullable CPTLineStyleArray)newLineStyles +-(void)setLineStyles:(nullable CPTLineStyleArray *)newLineStyles { [self cacheArray:newLineStyles forKey:CPTTradingRangePlotBindingLineStyles]; [self setNeedsDisplay]; } --(nullable CPTLineStyleArray)increaseLineStyles +-(nullable CPTLineStyleArray *)increaseLineStyles { return [self cachedArrayForKey:CPTTradingRangePlotBindingIncreaseLineStyles]; } --(void)setIncreaseLineStyles:(nullable CPTLineStyleArray)newLineStyles +-(void)setIncreaseLineStyles:(nullable CPTLineStyleArray *)newLineStyles { [self cacheArray:newLineStyles forKey:CPTTradingRangePlotBindingIncreaseLineStyles]; [self setNeedsDisplay]; } --(nullable CPTLineStyleArray)decreaseLineStyles +-(nullable CPTLineStyleArray *)decreaseLineStyles { return [self cachedArrayForKey:CPTTradingRangePlotBindingDecreaseLineStyles]; } --(void)setDecreaseLineStyles:(nullable CPTLineStyleArray)newLineStyles +-(void)setDecreaseLineStyles:(nullable CPTLineStyleArray *)newLineStyles { [self cacheArray:newLineStyles forKey:CPTTradingRangePlotBindingDecreaseLineStyles]; [self setNeedsDisplay]; diff --git a/framework/Source/CPTUtilities.h b/framework/Source/CPTUtilities.h index fe41b4dd6..691923cec 100644 --- a/framework/Source/CPTUtilities.h +++ b/framework/Source/CPTUtilities.h @@ -133,6 +133,7 @@ CGRect CPTAlignBorderedRectToUserSpace(__nonnull CGContextRef context, CGRect re NSString *__nonnull CPTStringFromPoint(CGPoint point); NSString *__nonnull CPTStringFromSize(CGSize size); NSString *__nonnull CPTStringFromRect(CGRect rect); +NSString *__nonnull CPTStringFromVector(CGVector vector); /// @} diff --git a/framework/Source/CPTUtilities.m b/framework/Source/CPTUtilities.m index 9b268e58e..1a4641de6 100644 --- a/framework/Source/CPTUtilities.m +++ b/framework/Source/CPTUtilities.m @@ -40,7 +40,17 @@ int16_t CPTDecimalShortValue(NSDecimal decimalNumber) **/ int32_t CPTDecimalLongValue(NSDecimal decimalNumber) { - return (int32_t)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].longValue; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (int32_t)d.longValue; } /** @@ -50,7 +60,17 @@ int32_t CPTDecimalLongValue(NSDecimal decimalNumber) **/ int64_t CPTDecimalLongLongValue(NSDecimal decimalNumber) { - return (int64_t)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].longLongValue; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (int64_t)d.longLongValue; } /** @@ -70,7 +90,17 @@ int CPTDecimalIntValue(NSDecimal decimalNumber) **/ NSInteger CPTDecimalIntegerValue(NSDecimal decimalNumber) { - return (NSInteger)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].integerValue; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (NSInteger)d.integerValue; } /** @@ -100,7 +130,17 @@ uint16_t CPTDecimalUnsignedShortValue(NSDecimal decimalNumber) **/ uint32_t CPTDecimalUnsignedLongValue(NSDecimal decimalNumber) { - return (uint32_t)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].unsignedLongValue; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (uint32_t)d.unsignedLongValue; } /** @@ -110,7 +150,17 @@ uint32_t CPTDecimalUnsignedLongValue(NSDecimal decimalNumber) **/ uint64_t CPTDecimalUnsignedLongLongValue(NSDecimal decimalNumber) { - return (uint64_t)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].unsignedLongLongValue; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (uint64_t)d.unsignedLongLongValue; } /** @@ -130,7 +180,17 @@ unsigned int CPTDecimalUnsignedIntValue(NSDecimal decimalNumber) **/ NSUInteger CPTDecimalUnsignedIntegerValue(NSDecimal decimalNumber) { - return (NSUInteger)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].unsignedIntegerValue; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (NSUInteger)d.unsignedIntegerValue; } /** @@ -162,7 +222,6 @@ CGFloat CPTDecimalCGFloatValue(NSDecimal decimalNumber) { #if CGFLOAT_IS_DOUBLE return (CGFloat)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].doubleValue; - #else return (CGFloat)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] floatValue]; #endif @@ -188,7 +247,7 @@ CGFloat CPTDecimalCGFloatValue(NSDecimal decimalNumber) **/ NSDecimal CPTDecimalFromChar(int8_t anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%hhd", anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -211,7 +270,7 @@ NSDecimal CPTDecimalFromChar(int8_t anInt) **/ NSDecimal CPTDecimalFromShort(int16_t anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%hd", anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -234,7 +293,7 @@ NSDecimal CPTDecimalFromShort(int16_t anInt) **/ NSDecimal CPTDecimalFromLong(int32_t anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%d", anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -257,7 +316,7 @@ NSDecimal CPTDecimalFromLong(int32_t anInt) **/ NSDecimal CPTDecimalFromLongLong(int64_t anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%lld", anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -280,7 +339,7 @@ NSDecimal CPTDecimalFromLongLong(int64_t anInt) **/ NSDecimal CPTDecimalFromInt(int anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%d", anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -303,7 +362,7 @@ NSDecimal CPTDecimalFromInt(int anInt) **/ NSDecimal CPTDecimalFromInteger(NSInteger anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%ld", (long)anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -464,7 +523,7 @@ NSDecimal CPTDecimalFromUnsignedInteger(NSUInteger anInt) **/ NSDecimal CPTDecimalFromFloat(float aFloat) { - if ( isnan(aFloat) ) { + if ( isnan(aFloat) || isinf(aFloat)) { return CPTDecimalNaN(); } else { @@ -482,7 +541,7 @@ NSDecimal CPTDecimalFromFloat(float aFloat) **/ NSDecimal CPTDecimalFromDouble(double aDouble) { - if ( isnan(aDouble) ) { + if ( isnan(aDouble) || isinf(aDouble)) { return CPTDecimalNaN(); } else { @@ -500,7 +559,7 @@ NSDecimal CPTDecimalFromDouble(double aDouble) **/ NSDecimal CPTDecimalFromCGFloat(CGFloat aCGFloat) { - if ( isnan(aCGFloat) ) { + if ( isnan(aCGFloat) || isinf(aCGFloat)) { return CPTDecimalNaN(); } else { @@ -684,7 +743,13 @@ NSDecimal CPTDecimalNaN(void) **/ NSDecimal CPTDecimalMin(NSDecimal leftOperand, NSDecimal rightOperand) { - if ( NSDecimalCompare(&leftOperand, &rightOperand) == NSOrderedAscending ) { + if ( NSDecimalIsNotANumber(&leftOperand)) { + return rightOperand; + } + else if ( NSDecimalIsNotANumber(&rightOperand)) { + return leftOperand; + } + else if ( NSDecimalCompare(&leftOperand, &rightOperand) == NSOrderedAscending ) { return leftOperand; } else { @@ -700,7 +765,13 @@ NSDecimal CPTDecimalMin(NSDecimal leftOperand, NSDecimal rightOperand) **/ NSDecimal CPTDecimalMax(NSDecimal leftOperand, NSDecimal rightOperand) { - if ( NSDecimalCompare(&leftOperand, &rightOperand) == NSOrderedDescending ) { + if ( NSDecimalIsNotANumber(&leftOperand)) { + return rightOperand; + } + else if ( NSDecimalIsNotANumber(&rightOperand)) { + return leftOperand; + } + else if ( NSDecimalCompare(&leftOperand, &rightOperand) == NSOrderedDescending ) { return leftOperand; } else { @@ -715,11 +786,11 @@ NSDecimal CPTDecimalMax(NSDecimal leftOperand, NSDecimal rightOperand) **/ NSDecimal CPTDecimalAbs(NSDecimal value) { - if ( CPTDecimalGreaterThanOrEqualTo( value, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalGreaterThanOrEqualTo(value, CPTDecimalFromInteger(0))) { return value; } else { - return CPTDecimalMultiply( value, CPTDecimalFromInteger(-1) ); + return CPTDecimalMultiply(value, CPTDecimalFromInteger(-1)); } } @@ -741,7 +812,7 @@ NSRange CPTExpandedRange(NSRange range, NSInteger expandBy) NSInteger lowerExpansion = (NSInteger)range.location - loc; NSInteger length = MAX(0, (NSInteger)range.length + lowerExpansion + expandBy); - return NSMakeRange( (NSUInteger)loc, (NSUInteger)length ); + return NSMakeRange((NSUInteger)loc, (NSUInteger)length); } #pragma mark - @@ -816,7 +887,7 @@ CGPoint CPTAlignPointToUserSpace(__nonnull CGContextRef context, CGPoint point) // Ensure that coordinates are at exactly the corner // of a device pixel. - point.x = round( point.x - CPTFloat(0.5) ) + CPTFloat(0.5); + point.x = round(point.x - CPTFloat(0.5)) + CPTFloat(0.5); point.y = ceil(point.y) - CPTFloat(0.5); // Convert the device aligned coordinate back to user space. @@ -863,11 +934,11 @@ CGRect CPTAlignRectToUserSpace(__nonnull CGContextRef context, CGRect rect) CGPoint oldOrigin = rect.origin; - rect.origin.x = round( rect.origin.x - CPTFloat(0.5) ); - rect.size.width = round( oldOrigin.x + rect.size.width - CPTFloat(0.5) ) - rect.origin.x; + rect.origin.x = round(rect.origin.x - CPTFloat(0.5)); + rect.size.width = round(oldOrigin.x + rect.size.width - CPTFloat(0.5)) - rect.origin.x; rect.origin.x += CPTFloat(0.5); - rect.origin.y = ceil( CGRectGetMaxY(rect) ) - CPTFloat(0.5); + rect.origin.y = ceil(CGRectGetMaxY(rect)) - CPTFloat(0.5); rect.size.height = ceil(oldOrigin.y - CPTFloat(0.5) - rect.origin.y); return CGContextConvertRectToUserSpace(context, rect); @@ -890,7 +961,7 @@ CGPoint CPTAlignIntegralPointToUserSpace(__nonnull CGContextRef context, CGPoint point = CGContextConvertPointToDeviceSpace(context, point); point.x = round(point.x); - point.y = ceil( point.y - CPTFloat(0.5) ); + point.y = ceil(point.y - CPTFloat(0.5)); return CGContextConvertPointToUserSpace(context, point); } @@ -914,7 +985,7 @@ CGRect CPTAlignIntegralRectToUserSpace(__nonnull CGContextRef context, CGRect re rect.origin.x = round(rect.origin.x); rect.size.width = round(oldOrigin.x + rect.size.width) - rect.origin.x; - rect.origin.y = ceil( CGRectGetMaxY(rect) - CPTFloat(0.5) ); + rect.origin.y = ceil(CGRectGetMaxY(rect) - CPTFloat(0.5)); rect.size.height = ceil(oldOrigin.y - CPTFloat(0.5) - rect.origin.y); return CGContextConvertRectToUserSpace(context, rect); @@ -925,14 +996,14 @@ CGRect CPTAlignBorderedRectToUserSpace(__nonnull CGContextRef context, CGRect re CGRect borderRect; CGFloat contextScale = CPTFloat(1.0); - if ( rect.size.height != CPTFloat(0.0) ) { + if ( rect.size.height != CPTFloat(0.0)) { CGRect deviceRect = CGContextConvertRectToDeviceSpace(context, rect); contextScale = deviceRect.size.height / rect.size.height; } - if ( contextScale != CPTFloat(1.0) ) { + if ( contextScale != CPTFloat(1.0)) { CGFloat borderWidth = borderLineStyle.lineWidth; - if ( ( borderWidth > CPTFloat(0.0) ) && ( borderWidth == round(borderWidth) ) ) { + if ((borderWidth > CPTFloat(0.0)) && (borderWidth == round(borderWidth))) { borderRect = CPTAlignIntegralRectToUserSpace(context, rect); } else { @@ -953,7 +1024,7 @@ CGRect CPTAlignBorderedRectToUserSpace(__nonnull CGContextRef context, CGRect re * @param point The point. * @return A string with the format {x, y}. **/ -NSString * __nonnull CPTStringFromPoint(CGPoint point) +NSString *__nonnull CPTStringFromPoint(CGPoint point) { return [NSString stringWithFormat:@"{%g, %g}", (double)point.x, (double)point.y]; } @@ -976,6 +1047,15 @@ CGRect CPTAlignBorderedRectToUserSpace(__nonnull CGContextRef context, CGRect re return [NSString stringWithFormat:@"{{%g, %g}, {%g, %g}}", (double)rect.origin.x, (double)rect.origin.y, (double)rect.size.width, (double)rect.size.height]; } +/** @brief Creates a string representation of the given vector. + * @param vector The vector. + * @return A string with the format {dx, dy}. + **/ +NSString *__nonnull CPTStringFromVector(CGVector vector) +{ + return [NSString stringWithFormat:@"{%g, %g}", (double)vector.dx, (double)vector.dy]; +} + #pragma mark - #pragma mark CGPoint utilities @@ -1057,7 +1137,7 @@ BOOL CPTEdgeInsetsEqualToEdgeInsets(CPTEdgeInsets insets1, CPTEdgeInsets insets2 if ( value != 0.0 ) { double sign = (signbit(value) ? -1.0 : +1.0); - return sign * (pow( 10.0, fabs(value) ) - 1.0); + return sign * (pow(10.0, fabs(value)) - 1.0); } else { return 0.0; diff --git a/framework/Source/CPTUtilitiesTests.m b/framework/Source/CPTUtilitiesTests.m index c2d99d839..c8335a100 100644 --- a/framework/Source/CPTUtilitiesTests.m +++ b/framework/Source/CPTUtilitiesTests.m @@ -15,7 +15,7 @@ -(void)setUp const size_t height = 50; const size_t bitsPerComponent = 8; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); #else CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); @@ -50,7 +50,7 @@ -(void)testCPTDecimalIntegerValue XCTAssertEqual(CPTDecimalIntegerValue([d decimalValue]), (NSInteger)42, @"Result incorrect"); d = [NSDecimalNumber decimalNumberWithString:@"42.1"]; - XCTAssertEqual( (NSInteger)CPTDecimalIntegerValue([d decimalValue]), (NSInteger)42, @"Result incorrect" ); + XCTAssertEqual((NSInteger)CPTDecimalIntegerValue([d decimalValue]), (NSInteger)42, @"Result incorrect"); } -(void)testCPTDecimalFloatValue @@ -82,7 +82,7 @@ -(void)testToDecimalConversion XCTAssertEqualObjects([NSDecimalNumber decimalNumberWithString:@"100"], [NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromInteger(i)], @"NSInteger to NSDecimal conversion failed"); XCTAssertEqualObjects([NSDecimalNumber decimalNumberWithString:@"100"], [NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromUnsignedInteger(unsignedI)], @"NSUInteger to NSDecimal conversion failed"); - XCTAssertEqualWithAccuracy([@(f)floatValue], [[NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromFloat(f)] floatValue], 1.0e-7f, @"float to NSDecimal conversion failed"); + XCTAssertEqualWithAccuracy([@(f) floatValue], [[NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromFloat(f)] floatValue], 1.0e-7f, @"float to NSDecimal conversion failed"); XCTAssertEqualObjects(@(d), [NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromDouble(d)], @"double to NSDecimal conversion failed."); } @@ -122,6 +122,130 @@ -(void)testConvertNegativeOne XCTAssertTrue(NSDecimalCompare(&testValue, &negativeOne) == NSOrderedSame, @"%@", errMessage); } +#pragma mark - +#pragma mark Decimal utilities + +-(void)testDecimalMax +{ + NSDecimal zero = CPTDecimalFromInteger(0); + NSDecimal one = CPTDecimalFromInteger(1); + NSDecimal dNAN = CPTDecimalNaN(); + + NSDecimal testValue; + NSString *errMessage; + + testValue = CPTDecimalMin(zero, one); + errMessage = [NSString stringWithFormat:@"test min(0, 1), expected %@", NSDecimalString(&zero, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &zero) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMin(one, zero); + errMessage = [NSString stringWithFormat:@"test min(1, 0), expected %@", NSDecimalString(&zero, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &zero) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMin(one, dNAN); + errMessage = [NSString stringWithFormat:@"test min(1, NAN), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMin(dNAN, one); + errMessage = [NSString stringWithFormat:@"test min(NAN, 1), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMin(dNAN, dNAN); + errMessage = [NSString stringWithFormat:@"test min(NAN, NAN), expected %@", NSDecimalString(&dNAN, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &dNAN) == NSOrderedSame, @"%@", errMessage); +} + +-(void)testDecimalMin +{ + NSDecimal zero = CPTDecimalFromInteger(0); + NSDecimal one = CPTDecimalFromInteger(1); + NSDecimal dNAN = CPTDecimalNaN(); + + NSDecimal testValue; + NSString *errMessage; + + testValue = CPTDecimalMax(zero, one); + errMessage = [NSString stringWithFormat:@"test min(0, 1), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMax(one, zero); + errMessage = [NSString stringWithFormat:@"test min(1, 0), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMax(one, dNAN); + errMessage = [NSString stringWithFormat:@"test min(1, NAN), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMax(dNAN, one); + errMessage = [NSString stringWithFormat:@"test min(NAN, 1), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMin(dNAN, dNAN); + errMessage = [NSString stringWithFormat:@"test min(NAN, NAN), expected %@", NSDecimalString(&dNAN, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &dNAN) == NSOrderedSame, @"%@", errMessage); +} + +-(void)testDecimalAbs +{ + NSDecimal zero = CPTDecimalFromInteger(0); + NSDecimal one = CPTDecimalFromInteger(1); + NSDecimal negativeOne = CPTDecimalFromInteger(-1); + + NSDecimal testValue; + NSString *errMessage; + + testValue = CPTDecimalAbs(one); + errMessage = [NSString stringWithFormat:@"test value was %@, expected %@", NSDecimalString(&testValue, nil), NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalAbs(zero); + errMessage = [NSString stringWithFormat:@"test value was %@, expected %@", NSDecimalString(&testValue, nil), NSDecimalString(&zero, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &zero) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalAbs(negativeOne); + errMessage = [NSString stringWithFormat:@"test value was %@, expected %@", NSDecimalString(&testValue, nil), NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); +} + +#pragma mark - +#pragma mark NSDecimalNumber tests + +// Fix issues with incorrect values when converting NSDecimalNumber to non-double values (due to bugs in NSDecimalNumber, see radar #32520109) +-(void)testNSDecimalNumberBugFix +{ + NSArray *strings = + @[ + @"0", // validation tests + @"1", + @"1.8446744073709551615", // 64/65 bit tests (radar 32520109) + @"1.8446744073709551616", + @"9.821426272392280061", // radar 25465729 tests + @"9.821426272392280060", + ]; + + for ( NSString *string in strings ) { + NSDecimalNumber *v = [NSDecimalNumber decimalNumberWithString:string]; + NSDecimal d = v.decimalValue; + double expectedDouble = v.doubleValue; + + XCTAssertEqual(CPTDecimalCharValue(d), (char)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedCharValue(d), (unsigned char)expectedDouble); + XCTAssertEqual(CPTDecimalShortValue(d), (short)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedShortValue(d), (unsigned short)expectedDouble); + XCTAssertEqual(CPTDecimalIntValue(d), (int)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedIntValue(d), (unsigned int)expectedDouble); + XCTAssertEqual(CPTDecimalLongValue(d), (long)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedLongValue(d), (unsigned long)expectedDouble); + XCTAssertEqual(CPTDecimalLongLongValue(d), (long long)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedLongLongValue(d), (unsigned long long)expectedDouble); + + XCTAssertEqual(CPTDecimalFloatValue(d), (float)expectedDouble); + + XCTAssertEqual(CPTDecimalIntegerValue(d), (NSInteger)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedIntegerValue(d), (NSUInteger)expectedDouble); + } +} + #pragma mark - #pragma mark Cached values @@ -595,11 +719,11 @@ -(void)testInverseLogModulus { XCTAssertEqual(CPTInverseLogModulus(0.0), 0.0, @"CPTInverseLogModulus(0.0)"); - XCTAssertEqualWithAccuracy(CPTInverseLogModulus( log10(11.0) ), 10.0, 1.0e-7, @"CPTInverseLogModulus(log10(11.0))"); - XCTAssertEqualWithAccuracy(CPTInverseLogModulus( -log10(11.0) ), -10.0, 1.0e-7, @"CPTInverseLogModulus(-log10(11.0))"); + XCTAssertEqualWithAccuracy(CPTInverseLogModulus(log10(11.0)), 10.0, 1.0e-7, @"CPTInverseLogModulus(log10(11.0))"); + XCTAssertEqualWithAccuracy(CPTInverseLogModulus(-log10(11.0)), -10.0, 1.0e-7, @"CPTInverseLogModulus(-log10(11.0))"); - XCTAssertEqualWithAccuracy(CPTInverseLogModulus( log10(101.0) ), 100.0, 1.0e-7, @"CPTInverseLogModulus(log10(101.0))"); - XCTAssertEqualWithAccuracy(CPTInverseLogModulus( -log10(101.0) ), -100.0, 1.0e-7, @"CPTInverseLogModulus(-log10(101.0))"); + XCTAssertEqualWithAccuracy(CPTInverseLogModulus(log10(101.0)), 100.0, 1.0e-7, @"CPTInverseLogModulus(log10(101.0))"); + XCTAssertEqualWithAccuracy(CPTInverseLogModulus(-log10(101.0)), -100.0, 1.0e-7, @"CPTInverseLogModulus(-log10(101.0))"); } /// @endcond diff --git a/framework/Source/CPTXYAxis.m b/framework/Source/CPTXYAxis.m index ad212088d..9b0c117a4 100644 --- a/framework/Source/CPTXYAxis.m +++ b/framework/Source/CPTXYAxis.m @@ -16,11 +16,13 @@ /// @cond @interface CPTXYAxis() --(void)drawTicksInContext:(nonnull CGContextRef)context atLocations:(nullable CPTNumberSet)locations withLength:(CGFloat)length inRange:(nullable CPTPlotRange *)labeledRange isMajor:(BOOL)major; +-(void)drawTicksInContext:(nonnull CGContextRef)context atLocations:(nullable CPTNumberSet *)locations withLength:(CGFloat)length inRange:(nullable CPTPlotRange *)labeledRange isMajor:(BOOL)major; -(void)orthogonalCoordinateViewLowerBound:(nonnull CGFloat *)lower upperBound:(nonnull CGFloat *)upper; -(CGPoint)viewPointForOrthogonalCoordinate:(nullable NSNumber *)orthogonalCoord axisCoordinate:(nullable NSNumber *)coordinateValue; +-(NSUInteger)initialBandIndexForSortedLocations:(nonnull CPTNumberArray *)sortedLocations inRange:(nullable CPTMutablePlotRange *)range; + @end /// @endcond @@ -65,7 +67,7 @@ @implementation CPTXYAxis **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { orthogonalPosition = @0.0; axisConstraints = nil; self.tickDirection = CPTSignNone; @@ -79,7 +81,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTXYAxis *theLayer = (CPTXYAxis *)layer; orthogonalPosition = theLayer->orthogonalPosition; @@ -105,15 +107,29 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - orthogonalPosition = [coder decodeObjectForKey:@"CPTXYAxis.orthogonalPosition"]; - axisConstraints = [coder decodeObjectForKey:@"CPTXYAxis.axisConstraints"]; + if ((self = [super initWithCoder:coder])) { + orthogonalPosition = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTXYAxis.orthogonalPosition"]; + axisConstraints = [coder decodeObjectOfClass:[CPTConstraints class] + forKey:@"CPTXYAxis.axisConstraints"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Coordinate Transforms @@ -189,13 +205,13 @@ -(CGPoint)viewPointForCoordinateValue:(nullable NSNumber *)coordinateValue } } - if ( isnan(point.x) || isnan(point.y) ) { - NSLog( @"[CPTXYAxis viewPointForCoordinateValue:%@] was %@", coordinateValue, CPTStringFromPoint(point) ); + if ( isnan(point.x) || isnan(point.y)) { + NSLog(@"[CPTXYAxis viewPointForCoordinateValue:%@] was %@", coordinateValue, CPTStringFromPoint(point)); - if ( isnan(point.x) ) { + if ( isnan(point.x)) { point.x = CPTFloat(0.0); } - if ( isnan(point.y) ) { + if ( isnan(point.y)) { point.y = CPTFloat(0.0); } } @@ -210,7 +226,7 @@ -(CGPoint)viewPointForCoordinateValue:(nullable NSNumber *)coordinateValue /// @cond --(void)drawTicksInContext:(nonnull CGContextRef)context atLocations:(nullable CPTNumberSet)locations withLength:(CGFloat)length inRange:(nullable CPTPlotRange *)labeledRange isMajor:(BOOL)major +-(void)drawTicksInContext:(nonnull CGContextRef)context atLocations:(nullable CPTNumberSet *)locations withLength:(CGFloat)length inRange:(nullable CPTPlotRange *)labeledRange isMajor:(BOOL)major { CPTLineStyle *lineStyle = (major ? self.majorTickLineStyle : self.minorTickLineStyle); @@ -221,7 +237,7 @@ -(void)drawTicksInContext:(nonnull CGContextRef)context atLocations:(nullable CP CGFloat lineWidth = lineStyle.lineWidth; CPTAlignPointFunction alignmentFunction = NULL; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } else { @@ -332,7 +348,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CPTAlignPointFunction alignmentFunction = CPTAlignPointToUserSpace; if ( theLineStyle ) { CGFloat lineWidth = theLineStyle.lineWidth; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } @@ -390,7 +406,7 @@ -(void)drawGridLinesInContext:(nonnull CGContextRef)context isMajor:(BOOL)major [self relabel]; CPTPlotSpace *thePlotSpace = self.plotSpace; - CPTNumberSet locations = (major ? self.majorTickLocations : self.minorTickLocations); + CPTNumberSet *locations = (major ? self.majorTickLocations : self.minorTickLocations); CPTCoordinate selfCoordinate = self.coordinate; CPTCoordinate orthogonalCoordinate = CPTOrthogonalCoordinate(selfCoordinate); CPTMutablePlotRange *orthogonalRange = [[thePlotSpace plotRangeForCoordinate:orthogonalCoordinate] mutableCopy]; @@ -427,7 +443,7 @@ -(void)drawGridLinesInContext:(nonnull CGContextRef)context isMajor:(BOOL)major CGFloat lineWidth = lineStyle.lineWidth; CPTAlignPointFunction alignmentFunction = NULL; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } else { @@ -478,13 +494,110 @@ -(void)drawGridLinesInContext:(nonnull CGContextRef)context isMajor:(BOOL)major /// @cond +-(NSUInteger)initialBandIndexForSortedLocations:(CPTNumberArray *)sortedLocations inRange:(CPTMutablePlotRange *)range +{ + NSUInteger bandIndex = 0; + + NSNumber *bandAnchor = self.alternatingBandAnchor; + NSUInteger bandCount = self.alternatingBandFills.count; + + if ( bandAnchor && (bandCount > 0)) { + NSDecimal anchor = bandAnchor.decimalValue; + + CPTPlotRange *theVisibleRange = self.visibleRange; + if ( theVisibleRange ) { + [range intersectionPlotRange:theVisibleRange]; + } + + NSDecimal rangeStart; + if ( range.lengthDouble >= 0.0 ) { + rangeStart = range.minLimitDecimal; + } + else { + rangeStart = range.maxLimitDecimal; + } + + NSDecimal origin = self.labelingOrigin.decimalValue; + NSDecimal offset = CPTDecimalSubtract(anchor, origin); + NSDecimalRound(&offset, &offset, 0, NSRoundDown); + + const NSDecimal zero = CPTDecimalFromInteger(0); + + // Set starting coord--should be the smallest value >= rangeMin that is a whole multiple of majorInterval away from the alternatingBandAnchor + NSDecimal coord = zero; + NSDecimal majorInterval = zero; + + switch ( self.labelingPolicy ) { + case CPTAxisLabelingPolicyAutomatic: + case CPTAxisLabelingPolicyEqualDivisions: + if ( sortedLocations.count > 1 ) { + if ( range.lengthDouble >= 0.0 ) { + majorInterval = CPTDecimalSubtract(sortedLocations[1].decimalValue, sortedLocations[0].decimalValue); + } + else { + majorInterval = CPTDecimalSubtract(sortedLocations[0].decimalValue, sortedLocations[1].decimalValue); + } + } + break; + + case CPTAxisLabelingPolicyFixedInterval: + { + majorInterval = self.majorIntervalLength.decimalValue; + } + break; + + case CPTAxisLabelingPolicyLocationsProvided: + case CPTAxisLabelingPolicyNone: + { + // user provided tick locations; they're not guaranteed to be evenly spaced, but band drawing always starts with the first location + if ( range.lengthDouble >= 0.0 ) { + for ( NSNumber *location in sortedLocations ) { + if ( CPTDecimalLessThan(anchor, location.decimalValue)) { + break; + } + + bandIndex++; + } + } + else { + for ( NSNumber *location in sortedLocations ) { + if ( CPTDecimalGreaterThanOrEqualTo(anchor, location.decimalValue)) { + break; + } + + bandIndex++; + } + } + + bandIndex = bandIndex % bandCount; + } + break; + } + + if ( !CPTDecimalEquals(majorInterval, zero)) { + coord = CPTDecimalDivide(CPTDecimalSubtract(rangeStart, origin), majorInterval); + NSDecimalRound(&coord, &coord, 0, NSRoundUp); + NSInteger stepCount = CPTDecimalIntegerValue(coord) + CPTDecimalIntegerValue(offset) + 1; + + if ( stepCount >= 0 ) { + bandIndex = (NSUInteger)(stepCount % (NSInteger)bandCount); + } + else { + bandIndex = (NSUInteger)(-stepCount % (NSInteger)bandCount); + } + } + } + + return bandIndex; +} + -(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context { - CPTFillArray bandArray = self.alternatingBandFills; - NSUInteger bandCount = bandArray.count; + CPTFillArray *bandArray = self.alternatingBandFills; + NSUInteger bandCount = bandArray.count; if ( bandCount > 0 ) { - CPTNumberArray locations = self.majorTickLocations.allObjects; + CPTNumberArray *locations = self.majorTickLocations.allObjects; if ( locations.count > 0 ) { CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -506,10 +619,10 @@ -(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context [orthogonalRange intersectionPlotRange:theGridLineRange]; } - NSDecimal zero = CPTDecimalFromInteger(0); + const NSDecimal zero = CPTDecimalFromInteger(0); NSSortDescriptor *sortDescriptor = nil; if ( range ) { - if ( CPTDecimalGreaterThanOrEqualTo(range.lengthDecimal, zero) ) { + if ( CPTDecimalGreaterThanOrEqualTo(range.lengthDecimal, zero)) { sortDescriptor = [[NSSortDescriptor alloc] initWithKey:nil ascending:YES]; } else { @@ -521,8 +634,10 @@ -(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context } locations = [locations sortedArrayUsingDescriptors:@[sortDescriptor]]; - NSUInteger bandIndex = 0; - id null = [NSNull null]; + NSUInteger bandIndex = [self initialBandIndexForSortedLocations:locations inRange:range]; + + const id null = [NSNull null]; + NSDecimal lastLocation; if ( range ) { lastLocation = range.locationDecimal; @@ -544,7 +659,7 @@ -(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context for ( NSDecimalNumber *location in locations ) { NSDecimal currentLocation = location.decimalValue; - if ( !CPTDecimalEquals(CPTDecimalSubtract(currentLocation, lastLocation), zero) ) { + if ( !CPTDecimalEquals(CPTDecimalSubtract(currentLocation, lastLocation), zero)) { CPTFill *bandFill = bandArray[bandIndex++]; bandIndex %= bandCount; @@ -558,10 +673,10 @@ -(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context CGPoint endViewPoint = [thePlotSpace plotAreaViewPointForPlotPoint:endPlotPoint numberOfCoordinates:2]; // Fill band - CGRect fillRect = CPTRectMake( MIN(startViewPoint.x, endViewPoint.x), - MIN(startViewPoint.y, endViewPoint.y), - ABS(endViewPoint.x - startViewPoint.x), - ABS(endViewPoint.y - startViewPoint.y) ); + CGRect fillRect = CPTRectMake(MIN(startViewPoint.x, endViewPoint.x), + MIN(startViewPoint.y, endViewPoint.y), + ABS(endViewPoint.x - startViewPoint.x), + ABS(endViewPoint.y - startViewPoint.y)); [bandFill fillRect:CPTAlignIntegralRectToUserSpace(context, fillRect) inContext:context]; } } @@ -577,7 +692,7 @@ -(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context else { endLocation = CPTDecimalNaN(); } - if ( !CPTDecimalEquals(lastLocation, endLocation) ) { + if ( !CPTDecimalEquals(lastLocation, endLocation)) { CPTFill *bandFill = bandArray[bandIndex]; if ( bandFill != null ) { @@ -590,10 +705,10 @@ -(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context CGPoint endViewPoint = [thePlotSpace plotAreaViewPointForPlotPoint:endPlotPoint numberOfCoordinates:2]; // Fill band - CGRect fillRect = CPTRectMake( MIN(startViewPoint.x, endViewPoint.x), - MIN(startViewPoint.y, endViewPoint.y), - ABS(endViewPoint.x - startViewPoint.x), - ABS(endViewPoint.y - startViewPoint.y) ); + CGRect fillRect = CPTRectMake(MIN(startViewPoint.x, endViewPoint.x), + MIN(startViewPoint.y, endViewPoint.y), + ABS(endViewPoint.x - startViewPoint.x), + ABS(endViewPoint.y - startViewPoint.y)); [bandFill fillRect:CPTAlignIntegralRectToUserSpace(context, fillRect) inContext:context]; } } @@ -603,7 +718,7 @@ -(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context -(void)drawBackgroundLimitsInContext:(nonnull CGContextRef)context { - CPTLimitBandArray limitArray = self.backgroundLimitBands; + CPTLimitBandArray *limitArray = self.backgroundLimitBands; if ( limitArray.count > 0 ) { CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -648,10 +763,10 @@ -(void)drawBackgroundLimitsInContext:(nonnull CGContextRef)context CGPoint endViewPoint = [thePlotSpace plotAreaViewPointForPlotPoint:endPlotPoint numberOfCoordinates:2]; // Fill band - CGRect fillRect = CPTRectMake( MIN(startViewPoint.x, endViewPoint.x), - MIN(startViewPoint.y, endViewPoint.y), - ABS(endViewPoint.x - startViewPoint.x), - ABS(endViewPoint.y - startViewPoint.y) ); + CGRect fillRect = CPTRectMake(MIN(startViewPoint.x, endViewPoint.x), + MIN(startViewPoint.y, endViewPoint.y), + ABS(endViewPoint.x - startViewPoint.x), + ABS(endViewPoint.y - startViewPoint.y)); [bandFill fillRect:CPTAlignIntegralRectToUserSpace(context, fillRect) inContext:context]; } } @@ -709,8 +824,8 @@ -(nonnull NSNumber *)defaultTitleLocation double loc = axisRange.locationDouble; double end = axisRange.endDouble; - if ( (loc > 0.0) && (end >= 0.0) ) { - location = @( pow(10.0, ( log10(loc) + log10(end) ) / 2.0) ); + if ((loc > 0.0) && (end >= 0.0)) { + location = @(pow(10.0, (log10(loc) + log10(end)) / 2.0)); } else { location = axisRange.midPoint; @@ -723,7 +838,7 @@ -(nonnull NSNumber *)defaultTitleLocation double loc = axisRange.locationDouble; double end = axisRange.endDouble; - location = @( CPTInverseLogModulus( ( CPTLogModulus(loc) + CPTLogModulus(end) ) / 2.0 ) ); + location = @(CPTInverseLogModulus((CPTLogModulus(loc) + CPTLogModulus(end)) / 2.0)); } break; diff --git a/framework/Source/CPTXYAxisSet.m b/framework/Source/CPTXYAxisSet.m index 4208dbb28..70c48c5bf 100644 --- a/framework/Source/CPTXYAxisSet.m +++ b/framework/Source/CPTXYAxisSet.m @@ -42,7 +42,7 @@ @implementation CPTXYAxisSet **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { CPTXYAxis *xAxis = [[CPTXYAxis alloc] initWithFrame:newFrame]; xAxis.coordinate = CPTCoordinateX; xAxis.tickDirection = CPTSignNegative; @@ -80,7 +80,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CGFloat radius = superlayer.cornerRadius; - if ( radius > CPTFloat(0.0) ) { + if ( radius > CPTFloat(0.0)) { CGContextBeginPath(context); CPTAddRoundedRectPath(context, borderRect, radius); @@ -121,8 +121,8 @@ -(void)layoutSublayers sublayerPosition = CGPointMake(-sublayerPosition.x, -sublayerPosition.y); CGRect subLayerFrame = CGRectMake(sublayerPosition.x, sublayerPosition.y, sublayerBounds.size.width, sublayerBounds.size.height); - CPTSublayerSet excludedSublayers = self.sublayersExcludedFromAutomaticLayout; - Class layerClass = [CPTLayer class]; + CPTSublayerSet *excludedSublayers = self.sublayersExcludedFromAutomaticLayout; + Class layerClass = [CPTLayer class]; for ( CALayer *subLayer in self.sublayers ) { if ( [subLayer isKindOfClass:layerClass] && ![excludedSublayers containsObject:subLayer] ) { subLayer.frame = subLayerFrame; diff --git a/framework/Source/CPTXYGraph.h b/framework/Source/CPTXYGraph.h index 503b0a19e..a761dbd88 100644 --- a/framework/Source/CPTXYGraph.h +++ b/framework/Source/CPTXYGraph.h @@ -6,6 +6,7 @@ /// @name Initialization /// @{ -(nonnull instancetype)initWithFrame:(CGRect)newFrame xScaleType:(CPTScaleType)newXScaleType yScaleType:(CPTScaleType)newYScaleType NS_DESIGNATED_INITIALIZER; + -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; -(nonnull instancetype)initWithLayer:(nonnull id)layer NS_DESIGNATED_INITIALIZER; /// @} diff --git a/framework/Source/CPTXYGraph.m b/framework/Source/CPTXYGraph.m index 0ceb46711..480c28bb6 100644 --- a/framework/Source/CPTXYGraph.m +++ b/framework/Source/CPTXYGraph.m @@ -47,7 +47,7 @@ @implementation CPTXYGraph **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame xScaleType:(CPTScaleType)newXScaleType yScaleType:(CPTScaleType)newYScaleType { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { xScaleType = newXScaleType; yScaleType = newYScaleType; } @@ -78,7 +78,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTXYGraph *theLayer = (CPTXYGraph *)layer; xScaleType = theLayer->xScaleType; @@ -104,7 +104,7 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { + if ((self = [super initWithCoder:coder])) { xScaleType = (CPTScaleType)[coder decodeIntegerForKey:@"CPTXYGraph.xScaleType"]; yScaleType = (CPTScaleType)[coder decodeIntegerForKey:@"CPTXYGraph.yScaleType"]; } @@ -113,6 +113,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Factory Methods diff --git a/framework/Source/CPTXYPlotSpace.m b/framework/Source/CPTXYPlotSpace.m index 8269b844f..3b2750488 100644 --- a/framework/Source/CPTXYPlotSpace.m +++ b/framework/Source/CPTXYPlotSpace.m @@ -17,7 +17,7 @@ #import /// @cond -typedef NSMutableArray *CPTMutableAnimationArray; +typedef NSMutableArray CPTMutableAnimationArray; @interface CPTXYPlotSpace() @@ -48,7 +48,7 @@ -(CGFloat)viewCoordinateForRange:(nullable CPTPlotRange *)range coordinate:(CPTC @property (nonatomic, readwrite) CGPoint lastDisplacement; @property (nonatomic, readwrite) NSTimeInterval lastDragTime; @property (nonatomic, readwrite) NSTimeInterval lastDeltaTime; -@property (nonatomic, readwrite, retain, nonnull) CPTMutableAnimationArray animations; +@property (nonatomic, readwrite, retain, nonnull) CPTMutableAnimationArray *animations; @end @@ -198,7 +198,7 @@ @implementation CPTXYPlotSpace **/ -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { xRange = [[CPTPlotRange alloc] initWithLocation:@0.0 length:@1.0]; yRange = [[CPTPlotRange alloc] initWithLocation:@0.0 length:@1.0]; globalXRange = nil; @@ -241,8 +241,8 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder [coder encodeInteger:self.yScaleType forKey:@"CPTXYPlotSpace.yScaleType"]; [coder encodeBool:self.allowsMomentumX forKey:@"CPTXYPlotSpace.allowsMomentumX"]; [coder encodeBool:self.allowsMomentumY forKey:@"CPTXYPlotSpace.allowsMomentumY"]; - [coder encodeInt:self.momentumAnimationCurve forKey:@"CPTXYPlotSpace.momentumAnimationCurve"]; - [coder encodeInt:self.bounceAnimationCurve forKey:@"CPTXYPlotSpace.bounceAnimationCurve"]; + [coder encodeInteger:self.momentumAnimationCurve forKey:@"CPTXYPlotSpace.momentumAnimationCurve"]; + [coder encodeInteger:self.bounceAnimationCurve forKey:@"CPTXYPlotSpace.bounceAnimationCurve"]; [coder encodeCGFloat:self.momentumAcceleration forKey:@"CPTXYPlotSpace.momentumAcceleration"]; [coder encodeCGFloat:self.bounceAcceleration forKey:@"CPTXYPlotSpace.bounceAcceleration"]; [coder encodeCGFloat:self.minimumDisplacementToDrag forKey:@"CPTXYPlotSpace.minimumDisplacementToDrag"]; @@ -257,19 +257,23 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - CPTPlotRange *range = [coder decodeObjectForKey:@"CPTXYPlotSpace.xRange"]; + if ((self = [super initWithCoder:coder])) { + CPTPlotRange *range = [coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTXYPlotSpace.xRange"]; if ( range ) { xRange = [range copy]; } - range = [coder decodeObjectForKey:@"CPTXYPlotSpace.yRange"]; + range = [coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTXYPlotSpace.yRange"]; if ( range ) { yRange = [range copy]; } - globalXRange = [[coder decodeObjectForKey:@"CPTXYPlotSpace.globalXRange"] copy]; - globalYRange = [[coder decodeObjectForKey:@"CPTXYPlotSpace.globalYRange"] copy]; - xScaleType = (CPTScaleType)[coder decodeIntegerForKey:@"CPTXYPlotSpace.xScaleType"]; - yScaleType = (CPTScaleType)[coder decodeIntegerForKey:@"CPTXYPlotSpace.yScaleType"]; + globalXRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTXYPlotSpace.globalXRange"] copy]; + globalYRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTXYPlotSpace.globalYRange"] copy]; + xScaleType = (CPTScaleType)[coder decodeIntegerForKey:@"CPTXYPlotSpace.xScaleType"]; + yScaleType = (CPTScaleType)[coder decodeIntegerForKey:@"CPTXYPlotSpace.yScaleType"]; if ( [coder containsValueForKey:@"CPTXYPlotSpace.allowsMomentum"] ) { self.allowsMomentum = [coder decodeBoolForKey:@"CPTXYPlotSpace.allowsMomentum"]; @@ -278,8 +282,8 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder allowsMomentumX = [coder decodeBoolForKey:@"CPTXYPlotSpace.allowsMomentumX"]; allowsMomentumY = [coder decodeBoolForKey:@"CPTXYPlotSpace.allowsMomentumY"]; } - momentumAnimationCurve = (CPTAnimationCurve)[coder decodeIntForKey:@"CPTXYPlotSpace.momentumAnimationCurve"]; - bounceAnimationCurve = (CPTAnimationCurve)[coder decodeIntForKey:@"CPTXYPlotSpace.bounceAnimationCurve"]; + momentumAnimationCurve = (CPTAnimationCurve)[coder decodeIntegerForKey:@"CPTXYPlotSpace.momentumAnimationCurve"]; + bounceAnimationCurve = (CPTAnimationCurve)[coder decodeIntegerForKey:@"CPTXYPlotSpace.bounceAnimationCurve"]; momentumAcceleration = [coder decodeCGFloatForKey:@"CPTXYPlotSpace.momentumAcceleration"]; bounceAcceleration = [coder decodeCGFloatForKey:@"CPTXYPlotSpace.bounceAcceleration"]; minimumDisplacementToDrag = [coder decodeCGFloatForKey:@"CPTXYPlotSpace.minimumDisplacementToDrag"]; @@ -295,6 +299,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Ranges @@ -402,14 +418,14 @@ -(void)setXRange:(nonnull CPTPlotRange *)range if ( xRange && constrainedRange ) { isScrolling = !CPTDecimalEquals(constrainedRange.locationDecimal, xRange.locationDecimal) && CPTDecimalEquals(constrainedRange.lengthDecimal, xRange.lengthDecimal); - if ( isScrolling && ( displacement == CPTFloat(0.0) ) ) { + if ( isScrolling && (displacement == CPTFloat(0.0))) { CPTGraph *theGraph = self.graph; CPTPlotArea *plotArea = theGraph.plotAreaFrame.plotArea; if ( plotArea ) { NSDecimal rangeLength = constrainedRange.lengthDecimal; - if ( !CPTDecimalEquals( rangeLength, CPTDecimalFromInteger(0) ) ) { + if ( !CPTDecimalEquals(rangeLength, CPTDecimalFromInteger(0))) { NSDecimal diff = CPTDecimalDivide(CPTDecimalSubtract(constrainedRange.locationDecimal, xRange.locationDecimal), rangeLength); displacement = plotArea.bounds.size.width * CPTDecimalCGFloatValue(diff); @@ -466,14 +482,14 @@ -(void)setYRange:(nonnull CPTPlotRange *)range if ( yRange && constrainedRange ) { isScrolling = !CPTDecimalEquals(constrainedRange.locationDecimal, yRange.locationDecimal) && CPTDecimalEquals(constrainedRange.lengthDecimal, yRange.lengthDecimal); - if ( isScrolling && ( displacement == CPTFloat(0.0) ) ) { + if ( isScrolling && (displacement == CPTFloat(0.0))) { CPTGraph *theGraph = self.graph; CPTPlotArea *plotArea = theGraph.plotAreaFrame.plotArea; if ( plotArea ) { NSDecimal rangeLength = constrainedRange.lengthDecimal; - if ( !CPTDecimalEquals( rangeLength, CPTDecimalFromInteger(0) ) ) { + if ( !CPTDecimalEquals(rangeLength, CPTDecimalFromInteger(0))) { NSDecimal diff = CPTDecimalDivide(CPTDecimalSubtract(constrainedRange.locationDecimal, yRange.locationDecimal), rangeLength); displacement = plotArea.bounds.size.height * CPTDecimalCGFloatValue(diff); @@ -515,7 +531,7 @@ -(nonnull CPTPlotRange *)constrainRange:(nonnull CPTPlotRange *)existingRange to CPTPlotRange *theGlobalRange = globalRange; - if ( CPTDecimalGreaterThanOrEqualTo(existingRange.lengthDecimal, theGlobalRange.lengthDecimal) ) { + if ( CPTDecimalGreaterThanOrEqualTo(existingRange.lengthDecimal, theGlobalRange.lengthDecimal)) { return [theGlobalRange copy]; } else { @@ -528,7 +544,7 @@ -(nonnull CPTPlotRange *)constrainRange:(nonnull CPTPlotRange *)existingRange to -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shift momentumTime:(CGFloat)momentumTime speed:(CGFloat)speed acceleration:(CGFloat)acceleration { - CPTMutableAnimationArray animationArray = self.animations; + CPTMutableAnimationArray *animationArray = self.animations; CPTAnimationOperation *op; NSString *property = nil; @@ -579,8 +595,8 @@ -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shif CPTPlotRange *constrainedRange = [self constrainRange:newRange toGlobalRange:globalRange]; if ( ![newRange isEqualToRange:constrainedRange] && ![globalRange containsRange:newRange] ) { - BOOL direction = ( CPTDecimalGreaterThan(shift, zero) && CPTDecimalGreaterThan(oldRange.lengthDecimal, zero) ) || - ( CPTDecimalLessThan(shift, zero) && CPTDecimalLessThan(oldRange.lengthDecimal, zero) ); + BOOL direction = (CPTDecimalGreaterThan(shift, zero) && CPTDecimalGreaterThan(oldRange.lengthDecimal, zero)) || + (CPTDecimalLessThan(shift, zero) && CPTDecimalLessThan(oldRange.lengthDecimal, zero)); // decelerate at the global range if ( hasShift ) { @@ -594,11 +610,11 @@ -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shif CGFloat brakingOffset = globalPoint - oldPoint; brakingDelay = CPTFirstPositiveRoot(acceleration, speed, brakingOffset); - if ( !isnan(brakingDelay) ) { + if ( !isnan(brakingDelay)) { speed -= brakingDelay * acceleration; // slow down quickly - while ( momentumTime > CPTFloat(0.1) ) { + while ( momentumTime > CPTFloat(0.1)) { acceleration *= CPTFloat(2.0); momentumTime = speed / (CPTFloat(2.0) * acceleration); } @@ -635,10 +651,10 @@ -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shif brakingDelay = CPTFloat(0.0); // slow down quickly - while ( momentumTime > CPTFloat(0.1) ) { + while ( momentumTime > CPTFloat(0.1)) { momentumTime *= CPTFloat(0.5); - shift = CPTDecimalDivide( shift, CPTDecimalFromInteger(2) ); + shift = CPTDecimalDivide(shift, CPTDecimalFromInteger(2)); } newRange = [oldRange mutableCopy]; @@ -646,7 +662,7 @@ -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shif newRange.locationDecimal = CPTDecimalAdd(newRange.locationDecimal, shift); } - if ( !isnan(brakingDelay) ) { + if ( !isnan(brakingDelay)) { op = [CPTAnimation animate:self property:property fromPlotRange:constrainedRange @@ -720,11 +736,11 @@ CGFloat CPTFirstPositiveRoot(CGFloat a, CGFloat b, CGFloat c) CGFloat root1 = (-b + discriminant) / (CPTFloat(2.0) * a); CGFloat root2 = (-b - discriminant) / (CPTFloat(2.0) * a); - if ( !isnan(root1) && !isnan(root2) ) { - if ( root1 >= CPTFloat(0.0) ) { + if ( !isnan(root1) && !isnan(root2)) { + if ( root1 >= CPTFloat(0.0)) { root = root1; } - if ( ( root2 >= CPTFloat(0.0) ) && ( isnan(root) || (root2 < root) ) ) { + if ((root2 >= CPTFloat(0.0)) && (isnan(root) || (root2 < root))) { root = root2; } } @@ -748,7 +764,7 @@ -(void)setGlobalYRange:(nullable CPTPlotRange *)newRange } } --(void)scaleToFitPlots:(nullable CPTPlotArray)plots +-(void)scaleToFitPlots:(nullable CPTPlotArray *)plots { if ( plots.count == 0 ) { return; @@ -773,13 +789,51 @@ -(void)scaleToFitPlots:(nullable CPTPlotArray)plots // Set range NSDecimal zero = CPTDecimalFromInteger(0); if ( unionXRange ) { - if ( CPTDecimalEquals(unionXRange.lengthDecimal, zero) ) { + if ( CPTDecimalEquals(unionXRange.lengthDecimal, zero)) { [unionXRange unionPlotRange:self.xRange]; } self.xRange = unionXRange; } if ( unionYRange ) { - if ( CPTDecimalEquals(unionYRange.lengthDecimal, zero) ) { + if ( CPTDecimalEquals(unionYRange.lengthDecimal, zero)) { + [unionYRange unionPlotRange:self.yRange]; + } + self.yRange = unionYRange; + } +} + +-(void)scaleToFitEntirePlots:(nullable CPTPlotArray *)plots +{ + if ( plots.count == 0 ) { + return; + } + + // Determine union of ranges + CPTMutablePlotRange *unionXRange = nil; + CPTMutablePlotRange *unionYRange = nil; + for ( CPTPlot *plot in plots ) { + CPTPlotRange *currentXRange = [plot plotRangeEnclosingCoordinate:CPTCoordinateX]; + CPTPlotRange *currentYRange = [plot plotRangeEnclosingCoordinate:CPTCoordinateY]; + if ( !unionXRange ) { + unionXRange = [currentXRange mutableCopy]; + } + if ( !unionYRange ) { + unionYRange = [currentYRange mutableCopy]; + } + [unionXRange unionPlotRange:currentXRange]; + [unionYRange unionPlotRange:currentYRange]; + } + + // Set range + NSDecimal zero = CPTDecimalFromInteger(0); + if ( unionXRange ) { + if ( CPTDecimalEquals(unionXRange.lengthDecimal, zero)) { + [unionXRange unionPlotRange:self.xRange]; + } + self.xRange = unionXRange; + } + if ( unionYRange ) { + if ( CPTDecimalEquals(unionYRange.lengthDecimal, zero)) { [unionYRange unionPlotRange:self.yRange]; } self.yRange = unionYRange; @@ -837,7 +891,7 @@ -(CGFloat)viewCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(non } NSDecimal factor = CPTDecimalDivide(CPTDecimalSubtract(plotCoord, range.locationDecimal), range.lengthDecimal); - if ( NSDecimalIsNotANumber(&factor) ) { + if ( NSDecimalIsNotANumber(&factor)) { factor = CPTDecimalFromInteger(0); } @@ -848,17 +902,17 @@ -(CGFloat)viewCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(non -(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength linearPlotRange:(nonnull CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord { - if ( !range || (range.lengthDouble == 0.0) ) { + if ( !range || (range.lengthDouble == 0.0)) { return CPTFloat(0.0); } - return viewLength * (CGFloat)( (plotCoord - range.locationDouble) / range.lengthDouble ); + return viewLength * (CGFloat)((plotCoord - range.locationDouble) / range.lengthDouble); } -(NSDecimal)plotCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(nonnull CPTPlotRange *)range boundsLength:(NSDecimal)boundsLength { const NSDecimal zero = CPTDecimalFromInteger(0); - if ( CPTDecimalEquals(boundsLength, zero) ) { + if ( CPTDecimalEquals(boundsLength, zero)) { return zero; } @@ -875,7 +929,7 @@ -(NSDecimal)plotCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(n -(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength linearPlotRange:(nonnull CPTPlotRange *)range boundsLength:(CGFloat)boundsLength { - if ( boundsLength == CPTFloat(0.0) ) { + if ( boundsLength == CPTFloat(0.0)) { return 0.0; } @@ -889,7 +943,7 @@ -(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength linearPl // Log (only one version since there are no transcendental functions for NSDecimal) -(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(nonnull CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord { - if ( (range.minLimitDouble <= 0.0) || (range.maxLimitDouble <= 0.0) || (plotCoord <= 0.0) ) { + if ((range.minLimitDouble <= 0.0) || (range.maxLimitDouble <= 0.0) || (plotCoord <= 0.0)) { return CPTFloat(0.0); } @@ -897,12 +951,12 @@ -(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(nonnull double logCoord = log10(plotCoord); double logEnd = log10(range.endDouble); - return viewLength * (CGFloat)( (logCoord - logLoc) / (logEnd - logLoc) ); + return viewLength * (CGFloat)((logCoord - logLoc) / (logEnd - logLoc)); } -(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(nonnull CPTPlotRange *)range boundsLength:(CGFloat)boundsLength { - if ( boundsLength == CPTFloat(0.0) ) { + if ( boundsLength == CPTFloat(0.0)) { return 0.0; } @@ -925,12 +979,12 @@ -(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength logModulusPlotRange:(n double logCoord = CPTLogModulus(plotCoord); double logEnd = CPTLogModulus(range.endDouble); - return viewLength * (CGFloat)( (logCoord - logLoc) / (logEnd - logLoc) ); + return viewLength * (CGFloat)((logCoord - logLoc) / (logEnd - logLoc)); } -(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength logModulusPlotRange:(nonnull CPTPlotRange *)range boundsLength:(CGFloat)boundsLength { - if ( boundsLength == CPTFloat(0.0) ) { + if ( boundsLength == CPTFloat(0.0)) { return 0.0; } @@ -954,7 +1008,7 @@ -(NSUInteger)numberOfCoordinates } // Plot area view point for plot point --(CGPoint)plotAreaViewPointForPlotPoint:(nonnull CPTNumberArray)plotPoint +-(CGPoint)plotAreaViewPointForPlotPoint:(nonnull CPTNumberArray *)plotPoint { CGPoint viewPoint = [super plotAreaViewPointForPlotPoint:plotPoint]; @@ -1137,9 +1191,9 @@ -(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(nonnull double *)plotPoi } // Plot point for view point --(nullable CPTNumberArray)plotPointForPlotAreaViewPoint:(CGPoint)point +-(nullable CPTNumberArray *)plotPointForPlotAreaViewPoint:(CGPoint)point { - CPTMutableNumberArray plotPoint = [[super plotPointForPlotAreaViewPoint:point] mutableCopy]; + CPTMutableNumberArray *plotPoint = [[super plotPointForPlotAreaViewPoint:point] mutableCopy]; CGSize boundsSize; CPTGraph *theGraph = self.graph; @@ -1318,7 +1372,7 @@ -(CGPoint)plotAreaViewPointForEvent:(nonnull CPTNativeEvent *)event CPTPlotArea *thePlotArea = theGraph.plotAreaFrame.plotArea; if ( theHostingView && thePlotArea ) { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGPoint interactionPoint = [[[event touchesForView:theHostingView] anyObject] locationInView:theHostingView]; if ( theHostingView.collapsesLayers ) { interactionPoint.y = theHostingView.frame.size.height - interactionPoint.y; @@ -1337,7 +1391,7 @@ -(CGPoint)plotAreaViewPointForEvent:(nonnull CPTNativeEvent *)event } // Plot point for event --(nullable CPTNumberArray)plotPointForEvent:(nonnull CPTNativeEvent *)event +-(nullable CPTNumberArray *)plotPointForEvent:(nonnull CPTNativeEvent *)event { return [self plotPointForPlotAreaViewPoint:[self plotAreaViewPointForEvent:event]]; } @@ -1364,7 +1418,7 @@ -(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)plotAreaPoint CPTGraph *theGraph = self.graph; CPTPlotArea *plotArea = theGraph.plotAreaFrame.plotArea; - if ( !plotArea || ( interactionScale <= CPTFloat(1.e-6) ) ) { + if ( !plotArea || (interactionScale <= CPTFloat(1.e-6))) { return; } if ( ![plotArea containsPoint:plotAreaPoint] ) { @@ -1397,7 +1451,7 @@ -(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)plotAreaPoint // New locations NSDecimal newLocationX; - if ( CPTDecimalGreaterThanOrEqualTo( oldRangeX.lengthDecimal, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalGreaterThanOrEqualTo(oldRangeX.lengthDecimal, CPTDecimalFromInteger(0))) { NSDecimal oldFirstLengthX = CPTDecimalSubtract(plotInteractionPoint[CPTCoordinateX], oldRangeX.minLimitDecimal); // x - minX NSDecimal newFirstLengthX = CPTDecimalDivide(oldFirstLengthX, decimalScale); // (x - minX) / scale newLocationX = CPTDecimalSubtract(plotInteractionPoint[CPTCoordinateX], newFirstLengthX); @@ -1409,7 +1463,7 @@ -(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)plotAreaPoint } NSDecimal newLocationY; - if ( CPTDecimalGreaterThanOrEqualTo( oldRangeY.lengthDecimal, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalGreaterThanOrEqualTo(oldRangeY.lengthDecimal, CPTDecimalFromInteger(0))) { NSDecimal oldFirstLengthY = CPTDecimalSubtract(plotInteractionPoint[CPTCoordinateY], oldRangeY.minLimitDecimal); // y - minY NSDecimal newFirstLengthY = CPTDecimalDivide(oldFirstLengthY, decimalScale); // (y - minY) / scale newLocationY = CPTDecimalSubtract(plotInteractionPoint[CPTCoordinateY], newFirstLengthY); @@ -1486,7 +1540,7 @@ -(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint) self.lastDeltaTime = 0.0; // Clear any previous animations - CPTMutableAnimationArray animationArray = self.animations; + CPTMutableAnimationArray *animationArray = self.animations; for ( CPTAnimationOperation *op in animationArray ) { [[CPTAnimation sharedInstance] removeAnimationOperation:op]; } @@ -1547,7 +1601,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in NSTimeInterval deltaT = event.timestamp - self.lastDragTime; NSTimeInterval lastDeltaT = self.lastDeltaTime; - if ( (deltaT > 0.0) && (deltaT < 0.05) && (lastDeltaT > 0.0) ) { + if ((deltaT > 0.0) && (deltaT < 0.05) && (lastDeltaT > 0.0)) { CGPoint pointInPlotArea = [theGraph convertPoint:interactionPoint toLayer:plotArea]; CGPoint displacement = self.lastDisplacement; @@ -1555,7 +1609,7 @@ -(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)in speed = sqrt(displacement.x * displacement.x + displacement.y * displacement.y) / CPTFloat(lastDeltaT); momentumTime = speed / (CPTFloat(2.0) * acceleration); CGFloat distanceTraveled = speed * momentumTime - CPTFloat(0.5) * acceleration * momentumTime * momentumTime; - distanceTraveled = MAX( distanceTraveled, CPTFloat(0.0) ); + distanceTraveled = MAX(distanceTraveled, CPTFloat(0.0)); CGFloat theta = atan2(displacement.y, displacement.x); scaleX = cos(theta); @@ -1701,13 +1755,13 @@ -(nullable CPTPlotRange *)shiftRange:(nonnull CPTPlotRange *)oldRange by:(NSDeci // reduce the shift as we get farther outside the global range NSDecimal rangeLength = newRange.lengthDecimal; - if ( !CPTDecimalEquals( rangeLength, CPTDecimalFromInteger(0) ) ) { + if ( !CPTDecimalEquals(rangeLength, CPTDecimalFromInteger(0))) { NSDecimal diff = CPTDecimalDivide(CPTDecimalSubtract(constrainedRange.locationDecimal, newRange.locationDecimal), rangeLength); - diff = CPTDecimalMax( CPTDecimalMin( CPTDecimalMultiply( diff, CPTDecimalFromDouble(2.5) ), CPTDecimalFromInteger(1) ), CPTDecimalFromInteger(-1) ); + diff = CPTDecimalMax(CPTDecimalMin(CPTDecimalMultiply(diff, CPTDecimalFromDouble(2.5)), CPTDecimalFromInteger(1)), CPTDecimalFromInteger(-1)); - newRange.locationDecimal = CPTDecimalSubtract( newRange.locationDecimal, CPTDecimalMultiply( shift, CPTDecimalAbs(diff) ) ); + newRange.locationDecimal = CPTDecimalSubtract(newRange.locationDecimal, CPTDecimalMultiply(shift, CPTDecimalAbs(diff))); - *displacement = *displacement * ( CPTFloat(1.0) - ABS( CPTDecimalCGFloatValue(diff) ) ); + *displacement = *displacement * (CPTFloat(1.0) - ABS(CPTDecimalCGFloatValue(diff))); } } } @@ -1791,6 +1845,7 @@ -(BOOL)scrollWheelEvent:(nonnull CPTNativeEvent *)event fromPoint:(CGPoint)fromP return YES; } + #endif /** diff --git a/framework/Source/CPTXYPlotSpaceTests.m b/framework/Source/CPTXYPlotSpaceTests.m index af2da6092..888b6045d 100644 --- a/framework/Source/CPTXYPlotSpaceTests.m +++ b/framework/Source/CPTXYPlotSpaceTests.m @@ -49,7 +49,7 @@ -(void)testViewPointForPlotPointArrayLinear plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@10.0]; - CPTNumberArray plotPoint = @[@5.0, @5.0]; + CPTNumberArray *plotPoint = @[@5.0, @5.0]; CGPoint viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint]; @@ -146,7 +146,7 @@ -(void)testViewPointForPlotPointArrayLog plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@9.0]; - CPTNumberArray plotPoint = @[@( sqrt(10.0) ), @( sqrt(10.0) )]; + CPTNumberArray *plotPoint = @[@(sqrt(10.0)), @(sqrt(10.0))]; CGPoint viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint]; @@ -177,8 +177,8 @@ -(void)testViewPointForPlotPointLog length:@9.0]; NSDecimal plotPoint[2]; - plotPoint[CPTCoordinateX] = CPTDecimalFromDouble( sqrt(10.0) ); - plotPoint[CPTCoordinateY] = CPTDecimalFromDouble( sqrt(10.0) ); + plotPoint[CPTCoordinateX] = CPTDecimalFromDouble(sqrt(10.0)); + plotPoint[CPTCoordinateY] = CPTDecimalFromDouble(sqrt(10.0)); CGPoint viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; @@ -310,14 +310,14 @@ -(void)testPlotPointArrayForViewPointLinear plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@10.0]; - CGPoint viewPoint = CPTPointMake(50.0, 25.0); - CPTNumberArray plotPoint = [plotSpace plotPointForPlotAreaViewPoint:viewPoint]; + CGPoint viewPoint = CPTPointMake(50.0, 25.0); + CPTNumberArray *plotPoint = [plotSpace plotPointForPlotAreaViewPoint:viewPoint]; NSString *errMessage; errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %@", plotPoint[CPTCoordinateX]]; - XCTAssertTrue(CPTDecimalEquals( [plotPoint[CPTCoordinateX] decimalValue], CPTDecimalFromDouble(5.0) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals([plotPoint[CPTCoordinateX] decimalValue], CPTDecimalFromDouble(5.0)), @"%@", errMessage); errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %@", plotPoint[CPTCoordinateY]]; - XCTAssertTrue(CPTDecimalEquals( [plotPoint[CPTCoordinateY] decimalValue], CPTDecimalFromDouble(5.0) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals([plotPoint[CPTCoordinateY] decimalValue], CPTDecimalFromDouble(5.0)), @"%@", errMessage); } -(void)testPlotPointForViewPointLinear @@ -339,9 +339,9 @@ -(void)testPlotPointForViewPointLinear [plotSpace plotPoint:plotPoint numberOfCoordinates:2 forPlotAreaViewPoint:viewPoint]; errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %@", NSDecimalString(&plotPoint[CPTCoordinateX], nil)]; - XCTAssertTrue(CPTDecimalEquals( plotPoint[CPTCoordinateX], CPTDecimalFromDouble(5.0) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateX], CPTDecimalFromDouble(5.0)), @"%@", errMessage); errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %@", NSDecimalString(&plotPoint[CPTCoordinateY], nil)]; - XCTAssertTrue(CPTDecimalEquals( plotPoint[CPTCoordinateY], CPTDecimalFromDouble(5.0) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateY], CPTDecimalFromDouble(5.0)), @"%@", errMessage); } -(void)testDoublePrecisionPlotPointForViewPointLinear @@ -383,8 +383,8 @@ -(void)testPlotPointArrayForViewPointLog plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@9.0]; - CGPoint viewPoint = CPTPointMake(50.0, 25.0); - CPTNumberArray plotPoint = [plotSpace plotPointForPlotAreaViewPoint:viewPoint]; + CGPoint viewPoint = CPTPointMake(50.0, 25.0); + CPTNumberArray *plotPoint = [plotSpace plotPointForPlotAreaViewPoint:viewPoint]; NSString *errMessage; [plotSpace plotPointForPlotAreaViewPoint:viewPoint]; @@ -414,9 +414,9 @@ -(void)testPlotPointForViewPointLog [plotSpace plotPoint:plotPoint numberOfCoordinates:2 forPlotAreaViewPoint:viewPoint]; errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %@", NSDecimalString(&plotPoint[CPTCoordinateX], nil)]; - XCTAssertTrue(CPTDecimalEquals( plotPoint[CPTCoordinateX], CPTDecimalFromDouble( sqrt(10.0) ) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateX], CPTDecimalFromDouble(sqrt(10.0))), @"%@", errMessage); errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %@", NSDecimalString(&plotPoint[CPTCoordinateY], nil)]; - XCTAssertTrue(CPTDecimalEquals( plotPoint[CPTCoordinateY], CPTDecimalFromDouble( sqrt(10.0) ) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateY], CPTDecimalFromDouble(sqrt(10.0))), @"%@", errMessage); } -(void)testDoublePrecisionPlotPointForViewPointLog @@ -465,7 +465,7 @@ -(void)testPlotPointArrayForViewPointLogModulus [plotSpace plotPointForPlotAreaViewPoint:viewPoint]; errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %@", plotPoint[CPTCoordinateX]]; - XCTAssertEqualWithAccuracy([plotPoint[CPTCoordinateX] doubleValue], CPTInverseLogModulus(1.0), CPTFloat(0.01), @"%@", errMessage); + XCTAssertEqualWithAccuracy([plotPoint[CPTCoordinateX] doubleValue], CPTInverseLogModulus(1.0), 0.01, @"%@", errMessage); errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %@", plotPoint[CPTCoordinateY]]; XCTAssertEqual([plotPoint[CPTCoordinateY] doubleValue], 0.0, @"%@", errMessage); } @@ -489,9 +489,9 @@ -(void)testPlotPointForViewPointLogModulus [plotSpace plotPoint:plotPoint numberOfCoordinates:2 forPlotAreaViewPoint:viewPoint]; errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %@", NSDecimalString(&plotPoint[CPTCoordinateX], nil)]; - XCTAssertTrue(CPTDecimalEquals( plotPoint[CPTCoordinateX], CPTDecimalFromInteger(0) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateX], CPTDecimalFromInteger(0)), @"%@", errMessage); errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %@", NSDecimalString(&plotPoint[CPTCoordinateY], nil)]; - XCTAssertTrue(CPTDecimalEquals( plotPoint[CPTCoordinateY], CPTDecimalFromInteger(0) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateY], CPTDecimalFromInteger(0)), @"%@", errMessage); } -(void)testDoublePrecisionPlotPointForViewPointLogModulus @@ -513,7 +513,7 @@ -(void)testDoublePrecisionPlotPointForViewPointLogModulus [plotSpace doublePrecisionPlotPoint:plotPoint numberOfCoordinates:2 forPlotAreaViewPoint:viewPoint]; errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %g", plotPoint[CPTCoordinateX]]; - XCTAssertEqualWithAccuracy(plotPoint[CPTCoordinateX], CPTInverseLogModulus(1.0), CPTFloat(0.01), @"%@", errMessage); + XCTAssertEqualWithAccuracy(plotPoint[CPTCoordinateX], CPTInverseLogModulus(1.0), 0.01, @"%@", errMessage); errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %g", plotPoint[CPTCoordinateY]]; XCTAssertEqual(plotPoint[CPTCoordinateY], 0.0, @"%@", errMessage); } @@ -610,7 +610,7 @@ -(void)testScaleByAboutPoint1 CGRect myBounds = self.graph.bounds; - [plotSpace scaleBy:0.5 aboutPoint:CGPointMake( CGRectGetMidX(myBounds), CGRectGetMidY(myBounds) )]; + [plotSpace scaleBy:0.5 aboutPoint:CGPointMake(CGRectGetMidX(myBounds), CGRectGetMidY(myBounds))]; CPTPlotRange *expectedRangeX = [CPTPlotRange plotRangeWithLocation:@(-5.0) length:@20.0]; @@ -637,7 +637,7 @@ -(void)testScaleByAboutPoint2 CGRect myBounds = self.graph.bounds; - [plotSpace scaleBy:2.0 aboutPoint:CGPointMake( CGRectGetMidX(myBounds), CGRectGetMidY(myBounds) )]; + [plotSpace scaleBy:2.0 aboutPoint:CGPointMake(CGRectGetMidX(myBounds), CGRectGetMidY(myBounds))]; CPTPlotRange *expectedRangeX = [CPTPlotRange plotRangeWithLocation:@2.5 length:@5.0]; @@ -663,7 +663,7 @@ -(void)testKeyedArchivingRoundTrip plotSpace.globalYRange = [CPTPlotRange plotRangeWithLocation:@10.0 length:@(-10.0)]; - CPTXYPlotSpace *newPlotSpace = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:plotSpace]]; + CPTXYPlotSpace *newPlotSpace = [self archiveRoundTrip:plotSpace]; NSString *errMessage = [NSString stringWithFormat:@"xRange was %@, expected %@", plotSpace.xRange, newPlotSpace.xRange]; XCTAssertTrue([plotSpace.xRange isEqualToRange:newPlotSpace.xRange], @"%@", errMessage); diff --git a/framework/Source/NSCoderExtensions.m b/framework/Source/NSCoderExtensions.m index 5da2ab060..cfa40b7f7 100644 --- a/framework/Source/NSCoderExtensions.m +++ b/framework/Source/NSCoderExtensions.m @@ -72,13 +72,27 @@ -(void)encodeCPTRect:(CGRect)rect forKey:(nonnull NSString *)key * @param key The key to associate with the color space. * @note The current implementation only works with named color spaces. **/ +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#endif -(void)encodeCGColorSpace:(nullable CGColorSpaceRef)colorSpace forKey:(nonnull NSString *)key { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE NSLog(@"Color space encoding is not supported on iOS. Decoding will return a generic RGB color space."); +#pragma clang diagnostic pop #else if ( colorSpace ) { - CFDataRef iccProfile = CGColorSpaceCopyICCProfile(colorSpace); + CFDataRef iccProfile = NULL; + + // CGColorSpaceCopyICCProfile() is deprecated as of macOS 10.13 + if ( CGColorSpaceCopyICCData ) { + iccProfile = CGColorSpaceCopyICCData(colorSpace); + } + else { + iccProfile = CGColorSpaceCopyICCProfile(colorSpace); + } + [self encodeObject:(__bridge NSData *)iccProfile forKey:key]; CFRelease(iccProfile); } @@ -138,7 +152,7 @@ -(void)encodeCGPath:(nullable CGPathRef)path forKey:(nonnull NSString *)key for ( NSUInteger i = 0; i < dataCount; i++ ) { NSDictionary *elementData = pathData[i]; - CGPathElementType type = (CGPathElementType)(elementData[@"type"]).intValue; + CGPathElementType type = (CGPathElementType)elementData[@"type"].intValue; newKey = [[NSString alloc] initWithFormat:@"%@[%lu].type", key, (unsigned long)i]; [self encodeInt:type forKey:newKey]; @@ -228,7 +242,7 @@ -(void)encodeCGImage:(nullable CGImageRef)image forKey:(nonnull NSString *)key [self encodeBool:CGImageGetShouldInterpolate(image) forKey:newKey]; newKey = [[NSString alloc] initWithFormat:@"%@.renderingIntent", key]; - [self encodeInt:CGImageGetRenderingIntent(image) forKey:newKey]; + [self encodeInt32:CGImageGetRenderingIntent(image) forKey:newKey]; } /** @brief Encodes an @ref NSDecimal and associates it with the string @par{key}. @@ -253,7 +267,6 @@ -(CGFloat)decodeCGFloatForKey:(nonnull NSString *)key { #if CGFLOAT_IS_DOUBLE return [self decodeDoubleForKey:key]; - #else return [self decodeFloatForKey:key]; #endif @@ -326,17 +339,29 @@ -(CGRect)decodeCPTRectForKey:(nonnull NSString *)key * @return The new path. * @note The current implementation only works with named color spaces. **/ +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#endif -(nullable CGColorSpaceRef)newCGColorSpaceDecodeForKey:(nonnull NSString *)key { CGColorSpaceRef colorSpace = NULL; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE NSLog(@"Color space decoding is not supported on iOS. Using generic RGB color space."); colorSpace = CGColorSpaceCreateDeviceRGB(); +#pragma clang diagnostic pop #else - NSData *iccProfile = [self decodeObjectForKey:key]; + NSData *iccProfile = [self decodeObjectOfClass:[NSData class] + forKey:key]; if ( iccProfile ) { - colorSpace = CGColorSpaceCreateWithICCProfile( (__bridge CFDataRef)iccProfile ); + // CGColorSpaceCreateWithICCProfile() is deprecated as of macOS 10.13 + if ( CGColorSpaceCreateWithICCData ) { + colorSpace = CGColorSpaceCreateWithICCData((__bridge CFDataRef)iccProfile); + } + else { + colorSpace = CGColorSpaceCreateWithICCProfile((__bridge CFDataRef)iccProfile); + } } else { NSLog(@"Color space not available for key '%@'. Using generic RGB color space.", key); @@ -446,14 +471,15 @@ -(nullable CGImageRef)newCGImageDecodeForKey:(nonnull NSString *)key const CGBitmapInfo *bitmapInfo = (const void *)[self decodeBytesForKey:newKey returnedLength:&length]; newKey = [[NSString alloc] initWithFormat:@"%@.provider", key]; - CGDataProviderRef provider = CGDataProviderCreateWithCFData( (__bridge CFDataRef)[self decodeObjectForKey:newKey] ); + CGDataProviderRef provider = CGDataProviderCreateWithCFData((__bridge CFDataRef)[self decodeObjectOfClass:[NSData class] + forKey:newKey]); newKey = [[NSString alloc] initWithFormat:@"%@.numberOfComponents", key]; size_t numberOfComponents = (size_t)[self decodeInt64ForKey:newKey]; CGFloat *decodeArray = NULL; if ( numberOfComponents ) { - decodeArray = malloc( numberOfComponents * 2 * sizeof(CGFloat) ); + decodeArray = calloc((numberOfComponents * 2), sizeof(CGFloat)); for ( size_t i = 0; i < numberOfComponents; i++ ) { newKey = [[NSString alloc] initWithFormat:@"%@.decode[%zu].lower", key, i]; @@ -468,7 +494,7 @@ -(nullable CGImageRef)newCGImageDecodeForKey:(nonnull NSString *)key bool shouldInterpolate = [self decodeBoolForKey:newKey]; newKey = [[NSString alloc] initWithFormat:@"%@.renderingIntent", key]; - CGColorRenderingIntent intent = (CGColorRenderingIntent)[self decodeIntForKey:newKey]; + CGColorRenderingIntent intent = (CGColorRenderingIntent)[self decodeInt32ForKey:newKey]; CGImageRef newImage = CGImageCreate(width, height, @@ -501,7 +527,8 @@ -(NSDecimal)decodeDecimalForKey:(nonnull NSString *)key { NSDecimal result; - NSNumber *number = [self decodeObjectForKey:key]; + NSNumber *number = [self decodeObjectOfClass:[NSDecimalNumber class] + forKey:key]; if ( [number respondsToSelector:@selector(decimalValue)] ) { result = number.decimalValue; diff --git a/framework/Source/NSNumberExtensions.m b/framework/Source/NSNumberExtensions.m index 3f49c824f..a9ee47ab0 100644 --- a/framework/Source/NSNumberExtensions.m +++ b/framework/Source/NSNumberExtensions.m @@ -18,7 +18,6 @@ -(CGFloat)cgFloatValue { #if CGFLOAT_IS_DOUBLE return self.doubleValue; - #else return [self floatValue]; #endif @@ -32,7 +31,6 @@ -(nonnull instancetype)initWithCGFloat:(CGFloat)number { #if CGFLOAT_IS_DOUBLE return [self initWithDouble:number]; - #else return [self initWithFloat:number]; #endif diff --git a/framework/Source/_CPTAnimationCGFloatPeriod.m b/framework/Source/_CPTAnimationCGFloatPeriod.m index 3d5cde004..1bcf82cea 100644 --- a/framework/Source/_CPTAnimationCGFloatPeriod.m +++ b/framework/Source/_CPTAnimationCGFloatPeriod.m @@ -31,7 +31,7 @@ CGFloat CPTCurrentFloatValue(id __nonnull boundObject, SEL __nonnull boundGetter -(void)setStartValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { - self.startValue = @( CPTCurrentFloatValue(boundObject, boundGetter) ); + self.startValue = @(CPTCurrentFloatValue(boundObject, boundGetter)); } -(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter @@ -47,7 +47,7 @@ -(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnu [self.startValue getValue:&start]; [self.endValue getValue:&end]; - return ( (current >= start) && (current <= end) ) || ( (current >= end) && (current <= start) ); + return ((current >= start) && (current <= end)) || ((current >= end) && (current <= start)); } -(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress diff --git a/framework/Source/_CPTAnimationCGPointPeriod.m b/framework/Source/_CPTAnimationCGPointPeriod.m index 62a825574..bb6246379 100644 --- a/framework/Source/_CPTAnimationCGPointPeriod.m +++ b/framework/Source/_CPTAnimationCGPointPeriod.m @@ -47,8 +47,8 @@ -(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnu [self.startValue getValue:&start]; [self.endValue getValue:&end]; - return ( ( (current.x >= start.x) && (current.x <= end.x) ) || ( (current.x >= end.x) && (current.x <= start.x) ) ) && - ( ( (current.y >= start.y) && (current.y <= end.y) ) || ( (current.y >= end.y) && (current.y <= start.y) ) ); + return (((current.x >= start.x) && (current.x <= end.x)) || ((current.x >= end.x) && (current.x <= start.x))) && + (((current.y >= start.y) && (current.y <= end.y)) || ((current.y >= end.y) && (current.y <= start.y))); } -(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress diff --git a/framework/Source/_CPTAnimationCGRectPeriod.m b/framework/Source/_CPTAnimationCGRectPeriod.m index 2ab3fde6a..1e05bf9b8 100644 --- a/framework/Source/_CPTAnimationCGRectPeriod.m +++ b/framework/Source/_CPTAnimationCGRectPeriod.m @@ -47,10 +47,10 @@ -(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnu [self.startValue getValue:&start]; [self.endValue getValue:&end]; - return ( ( (current.origin.x >= start.origin.x) && (current.origin.x <= end.origin.x) ) || ( (current.origin.x >= end.origin.x) && (current.origin.x <= start.origin.x) ) ) && - ( ( (current.origin.y >= start.origin.y) && (current.origin.y <= end.origin.y) ) || ( (current.origin.y >= end.origin.y) && (current.origin.y <= start.origin.y) ) ) && - ( ( (current.size.width >= start.size.width) && (current.size.width <= end.size.width) ) || ( (current.size.width >= end.size.width) && (current.size.width <= start.size.width) ) ) && - ( ( (current.size.height >= start.size.height) && (current.size.height <= end.size.height) ) || ( (current.size.height >= end.size.height) && (current.size.height <= start.size.height) ) ); + return (((current.origin.x >= start.origin.x) && (current.origin.x <= end.origin.x)) || ((current.origin.x >= end.origin.x) && (current.origin.x <= start.origin.x))) && + (((current.origin.y >= start.origin.y) && (current.origin.y <= end.origin.y)) || ((current.origin.y >= end.origin.y) && (current.origin.y <= start.origin.y))) && + (((current.size.width >= start.size.width) && (current.size.width <= end.size.width)) || ((current.size.width >= end.size.width) && (current.size.width <= start.size.width))) && + (((current.size.height >= start.size.height) && (current.size.height <= end.size.height)) || ((current.size.height >= end.size.height) && (current.size.height <= start.size.height))); } -(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress diff --git a/framework/Source/_CPTAnimationCGSizePeriod.m b/framework/Source/_CPTAnimationCGSizePeriod.m index 89499b687..e0b54f48e 100644 --- a/framework/Source/_CPTAnimationCGSizePeriod.m +++ b/framework/Source/_CPTAnimationCGSizePeriod.m @@ -47,8 +47,8 @@ -(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnu [self.startValue getValue:&start]; [self.endValue getValue:&end]; - return ( ( (current.width >= start.width) && (current.width <= end.width) ) || ( (current.width >= end.width) && (current.width <= start.width) ) ) && - ( ( (current.height >= start.height) && (current.height <= end.height) ) || ( (current.height >= end.height) && (current.height <= start.height) ) ); + return (((current.width >= start.width) && (current.width <= end.width)) || ((current.width >= end.width) && (current.width <= start.width))) && + (((current.height >= start.height) && (current.height <= end.height)) || ((current.height >= end.height) && (current.height <= start.height))); } -(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress diff --git a/framework/Source/_CPTAnimationNSDecimalPeriod.m b/framework/Source/_CPTAnimationNSDecimalPeriod.m index f70877093..bcf36e651 100644 --- a/framework/Source/_CPTAnimationNSDecimalPeriod.m +++ b/framework/Source/_CPTAnimationNSDecimalPeriod.m @@ -43,20 +43,20 @@ -(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnu } NSDecimal current = CPTCurrentDecimalValue(boundObject, boundGetter); - NSDecimal start = ( (NSDecimalNumber *)self.startValue ).decimalValue; - NSDecimal end = ( (NSDecimalNumber *)self.endValue ).decimalValue; + NSDecimal start = ((NSDecimalNumber *)self.startValue).decimalValue; + NSDecimal end = ((NSDecimalNumber *)self.endValue).decimalValue; - return ( CPTDecimalGreaterThanOrEqualTo(current, start) && CPTDecimalLessThanOrEqualTo(current, end) ) || - ( CPTDecimalGreaterThanOrEqualTo(current, end) && CPTDecimalLessThanOrEqualTo(current, start) ); + return (CPTDecimalGreaterThanOrEqualTo(current, start) && CPTDecimalLessThanOrEqualTo(current, end)) || + (CPTDecimalGreaterThanOrEqualTo(current, end) && CPTDecimalLessThanOrEqualTo(current, start)); } -(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress { - NSDecimal start = ( (NSDecimalNumber *)self.startValue ).decimalValue; - NSDecimal end = ( (NSDecimalNumber *)self.endValue ).decimalValue; + NSDecimal start = ((NSDecimalNumber *)self.startValue).decimalValue; + NSDecimal end = ((NSDecimalNumber *)self.endValue).decimalValue; NSDecimal length = CPTDecimalSubtract(end, start); - NSDecimal tweenedValue = CPTDecimalAdd( start, CPTDecimalMultiply(CPTDecimalFromCGFloat(progress), length) ); + NSDecimal tweenedValue = CPTDecimalAdd(start, CPTDecimalMultiply(CPTDecimalFromCGFloat(progress), length)); return [NSDecimalNumber decimalNumberWithDecimal:tweenedValue]; } diff --git a/framework/Source/_CPTAnimationNSNumberPeriod.h b/framework/Source/_CPTAnimationNSNumberPeriod.h new file mode 100644 index 000000000..dfe744ba3 --- /dev/null +++ b/framework/Source/_CPTAnimationNSNumberPeriod.h @@ -0,0 +1,5 @@ +#import "CPTAnimationPeriod.h" + +@interface _CPTAnimationNSNumberPeriod : CPTAnimationPeriod + +@end diff --git a/framework/Source/_CPTAnimationNSNumberPeriod.m b/framework/Source/_CPTAnimationNSNumberPeriod.m new file mode 100644 index 000000000..e4692f041 --- /dev/null +++ b/framework/Source/_CPTAnimationNSNumberPeriod.m @@ -0,0 +1,74 @@ +#import "_CPTAnimationNSNumberPeriod.h" + +#import "CPTUtilities.h" + +@implementation _CPTAnimationNSNumberPeriod + +-(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +{ + typedef NSNumber *(*GetterType)(id, SEL); + GetterType getterMethod = (GetterType)[boundObject methodForSelector:boundGetter]; + + self.startValue = getterMethod(boundObject, boundGetter); +} + +-(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +{ + if ( !self.startValue ) { + [self setStartValueFromObject:boundObject propertyGetter:boundGetter]; + } + + typedef NSNumber *(*GetterType)(id, SEL); + GetterType getterMethod = (GetterType)[boundObject methodForSelector:boundGetter]; + + NSNumber *current = getterMethod(boundObject, boundGetter); + NSNumber *start = (NSNumber *)self.startValue; + NSNumber *end = (NSNumber *)self.endValue; + + Class decimalClass = [NSDecimalNumber class]; + + if ( [start isKindOfClass:decimalClass] || [end isKindOfClass:decimalClass] ) { + NSDecimal currentDecimal = current.decimalValue; + NSDecimal startDecimal = start.decimalValue; + NSDecimal endDecimal = end.decimalValue; + + return (CPTDecimalGreaterThanOrEqualTo(currentDecimal, startDecimal) && CPTDecimalLessThanOrEqualTo(currentDecimal, endDecimal)) || + (CPTDecimalGreaterThanOrEqualTo(currentDecimal, endDecimal) && CPTDecimalLessThanOrEqualTo(currentDecimal, startDecimal)); + } + else { + double currentDouble = current.doubleValue; + double startDouble = start.doubleValue; + double endDouble = end.doubleValue; + + return ((currentDouble >= startDouble) && (currentDouble <= endDouble)) || + ((currentDouble >= endDouble) && (currentDouble <= startDouble)); + } +} + +-(NSValue *)tweenedValueForProgress:(CGFloat)progress +{ + NSNumber *start = (NSNumber *)self.startValue; + NSNumber *end = (NSNumber *)self.endValue; + + Class decimalClass = [NSDecimalNumber class]; + + if ( [start isKindOfClass:decimalClass] || [end isKindOfClass:decimalClass] ) { + NSDecimal startDecimal = start.decimalValue; + NSDecimal endDecimal = end.decimalValue; + + NSDecimal length = CPTDecimalSubtract(endDecimal, startDecimal); + NSDecimal tweenedValue = CPTDecimalAdd(startDecimal, CPTDecimalMultiply(CPTDecimalFromCGFloat(progress), length)); + + return [NSDecimalNumber decimalNumberWithDecimal:tweenedValue]; + } + else { + double startDouble = start.doubleValue; + double endDouble = end.doubleValue; + + double tweenedValue = startDouble + (double)progress * (endDouble - startDouble); + + return @(tweenedValue); + } +} + +@end diff --git a/framework/Source/_CPTAnimationPlotRangePeriod.m b/framework/Source/_CPTAnimationPlotRangePeriod.m index fdcabbb21..857d65506 100644 --- a/framework/Source/_CPTAnimationPlotRangePeriod.m +++ b/framework/Source/_CPTAnimationPlotRangePeriod.m @@ -30,8 +30,8 @@ -(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnu NSDecimal startLoc = start.locationDecimal; NSDecimal endLoc = end.locationDecimal; - return ( CPTDecimalGreaterThanOrEqualTo(currentLoc, startLoc) && CPTDecimalLessThanOrEqualTo(currentLoc, endLoc) ) || - ( CPTDecimalGreaterThanOrEqualTo(currentLoc, endLoc) && CPTDecimalLessThanOrEqualTo(currentLoc, startLoc) ); + return (CPTDecimalGreaterThanOrEqualTo(currentLoc, startLoc) && CPTDecimalLessThanOrEqualTo(currentLoc, endLoc)) || + (CPTDecimalGreaterThanOrEqualTo(currentLoc, endLoc) && CPTDecimalLessThanOrEqualTo(currentLoc, startLoc)); } -(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress @@ -42,10 +42,10 @@ -(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress NSDecimal progressDecimal = CPTDecimalFromCGFloat(progress); NSDecimal locationDiff = CPTDecimalSubtract(end.locationDecimal, start.locationDecimal); - NSDecimal tweenedLocation = CPTDecimalAdd( start.locationDecimal, CPTDecimalMultiply(progressDecimal, locationDiff) ); + NSDecimal tweenedLocation = CPTDecimalAdd(start.locationDecimal, CPTDecimalMultiply(progressDecimal, locationDiff)); NSDecimal lengthDiff = CPTDecimalSubtract(end.lengthDecimal, start.lengthDecimal); - NSDecimal tweenedLength = CPTDecimalAdd( start.lengthDecimal, CPTDecimalMultiply(progressDecimal, lengthDiff) ); + NSDecimal tweenedLength = CPTDecimalAdd(start.lengthDecimal, CPTDecimalMultiply(progressDecimal, lengthDiff)); return (NSValue *)[CPTPlotRange plotRangeWithLocationDecimal:tweenedLocation lengthDecimal:tweenedLength]; } diff --git a/framework/Source/_CPTAnimationTimingFunctions.m b/framework/Source/_CPTAnimationTimingFunctions.m index a50417ad6..36b20aa6e 100644 --- a/framework/Source/_CPTAnimationTimingFunctions.m +++ b/framework/Source/_CPTAnimationTimingFunctions.m @@ -15,13 +15,13 @@ **/ CGFloat CPTAnimationTimingFunctionLinear(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -41,17 +41,17 @@ CGFloat CPTAnimationTimingFunctionBackIn(CGFloat elapsedTime, CGFloat duration) { const CGFloat s = CPTFloat(1.70158); - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return elapsedTime * elapsedTime * ( ( s + CPTFloat(1.0) ) * elapsedTime - s ); + return elapsedTime * elapsedTime * ((s + CPTFloat(1.0)) * elapsedTime - s); } /** @@ -64,17 +64,17 @@ CGFloat CPTAnimationTimingFunctionBackOut(CGFloat elapsedTime, CGFloat duration) { const CGFloat s = CPTFloat(1.70158); - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime = elapsedTime / duration - CPTFloat(1.0); - if ( elapsedTime >= CPTFloat(0.0) ) { + if ( elapsedTime >= CPTFloat(0.0)) { return CPTFloat(1.0); } - return elapsedTime * elapsedTime * ( ( s + CPTFloat(1.0) ) * elapsedTime + s ) + CPTFloat(1.0); + return elapsedTime * elapsedTime * ((s + CPTFloat(1.0)) * elapsedTime + s) + CPTFloat(1.0); } /** @@ -87,23 +87,23 @@ CGFloat CPTAnimationTimingFunctionBackInOut(CGFloat elapsedTime, CGFloat duratio { const CGFloat s = CPTFloat(1.70158 * 1.525); - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { - return CPTFloat(0.5) * ( elapsedTime * elapsedTime * ( ( s + CPTFloat(1.0) ) * elapsedTime - s ) ); + if ( elapsedTime < CPTFloat(1.0)) { + return CPTFloat(0.5) * (elapsedTime * elapsedTime * ((s + CPTFloat(1.0)) * elapsedTime - s)); } else { elapsedTime -= CPTFloat(2.0); - return CPTFloat(0.5) * ( elapsedTime * elapsedTime * ( ( s + CPTFloat(1.0) ) * elapsedTime + s ) + CPTFloat(2.0) ); + return CPTFloat(0.5) * (elapsedTime * elapsedTime * ((s + CPTFloat(1.0)) * elapsedTime + s) + CPTFloat(2.0)); } } @@ -129,25 +129,25 @@ CGFloat CPTAnimationTimingFunctionBounceIn(CGFloat elapsedTime, CGFloat duration **/ CGFloat CPTAnimationTimingFunctionBounceOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0 / 2.75) ) { + if ( elapsedTime < CPTFloat(1.0 / 2.75)) { return CPTFloat(7.5625) * elapsedTime * elapsedTime; } - else if ( elapsedTime < CPTFloat(2.0 / 2.75) ) { + else if ( elapsedTime < CPTFloat(2.0 / 2.75)) { elapsedTime -= CPTFloat(1.5 / 2.75); return CPTFloat(7.5625) * elapsedTime * elapsedTime + CPTFloat(0.75); } - else if ( elapsedTime < CPTFloat(2.5 / 2.75) ) { + else if ( elapsedTime < CPTFloat(2.5 / 2.75)) { elapsedTime -= CPTFloat(2.25 / 2.75); return CPTFloat(7.5625) * elapsedTime * elapsedTime + CPTFloat(0.9375); @@ -167,7 +167,7 @@ CGFloat CPTAnimationTimingFunctionBounceOut(CGFloat elapsedTime, CGFloat duratio **/ CGFloat CPTAnimationTimingFunctionBounceInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime < duration * CPTFloat(0.5) ) { + if ( elapsedTime < duration * CPTFloat(0.5)) { return CPTAnimationTimingFunctionBounceIn(elapsedTime * CPTFloat(2.0), duration) * CPTFloat(0.5); } else { @@ -187,17 +187,17 @@ CGFloat CPTAnimationTimingFunctionBounceInOut(CGFloat elapsedTime, CGFloat durat **/ CGFloat CPTAnimationTimingFunctionCircularIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return -( sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) - CPTFloat(1.0) ); + return -(sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) - CPTFloat(1.0)); } /** @@ -208,13 +208,13 @@ CGFloat CPTAnimationTimingFunctionCircularIn(CGFloat elapsedTime, CGFloat durati **/ CGFloat CPTAnimationTimingFunctionCircularOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime = elapsedTime / duration - CPTFloat(1.0); - if ( elapsedTime >= CPTFloat(0.0) ) { + if ( elapsedTime >= CPTFloat(0.0)) { return CPTFloat(1.0); } @@ -229,23 +229,23 @@ CGFloat CPTAnimationTimingFunctionCircularOut(CGFloat elapsedTime, CGFloat durat **/ CGFloat CPTAnimationTimingFunctionCircularInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { - return CPTFloat(-0.5) * ( sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) - CPTFloat(1.0) ); + if ( elapsedTime < CPTFloat(1.0)) { + return CPTFloat(-0.5) * (sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) - CPTFloat(1.0)); } else { elapsedTime -= CPTFloat(2.0); - return CPTFloat(0.5) * ( sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) + CPTFloat(1.0) ); + return CPTFloat(0.5) * (sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) + CPTFloat(1.0)); } } @@ -260,13 +260,13 @@ CGFloat CPTAnimationTimingFunctionCircularInOut(CGFloat elapsedTime, CGFloat dur **/ CGFloat CPTAnimationTimingFunctionElasticIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -275,7 +275,7 @@ CGFloat CPTAnimationTimingFunctionElasticIn(CGFloat elapsedTime, CGFloat duratio elapsedTime -= CPTFloat(1.0); - return -( pow(CPTFloat(2.0), CPTFloat(10.0) * elapsedTime) * sin( (elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period ) ); + return -(pow(CPTFloat(2.0), CPTFloat(10.0) * elapsedTime) * sin((elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period)); } /** @@ -286,20 +286,20 @@ CGFloat CPTAnimationTimingFunctionElasticIn(CGFloat elapsedTime, CGFloat duratio **/ CGFloat CPTAnimationTimingFunctionElasticOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } CGFloat period = duration * CPTFloat(0.3); CGFloat s = period * CPTFloat(0.25); - return pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) * sin( (elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period ) + CPTFloat(1.0); + return pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) * sin((elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period) + CPTFloat(1.0); } /** @@ -310,13 +310,13 @@ CGFloat CPTAnimationTimingFunctionElasticOut(CGFloat elapsedTime, CGFloat durati **/ CGFloat CPTAnimationTimingFunctionElasticInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } @@ -325,11 +325,11 @@ CGFloat CPTAnimationTimingFunctionElasticInOut(CGFloat elapsedTime, CGFloat dura elapsedTime -= CPTFloat(1.0); - if ( elapsedTime < CPTFloat(0.0) ) { - return CPTFloat(-0.5) * ( pow(CPTFloat(2.0), CPTFloat(10.0) * elapsedTime) * sin( (elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period ) ); + if ( elapsedTime < CPTFloat(0.0)) { + return CPTFloat(-0.5) * (pow(CPTFloat(2.0), CPTFloat(10.0) * elapsedTime) * sin((elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period)); } else { - return pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) * sin( (elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period ) * CPTFloat(0.5) + CPTFloat(1.0); + return pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) * sin((elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period) * CPTFloat(0.5) + CPTFloat(1.0); } } @@ -344,17 +344,17 @@ CGFloat CPTAnimationTimingFunctionElasticInOut(CGFloat elapsedTime, CGFloat dura **/ CGFloat CPTAnimationTimingFunctionExponentialIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return pow( CPTFloat(2.0), CPTFloat(10.0) * ( elapsedTime - CPTFloat(1.0) ) ); + return pow(CPTFloat(2.0), CPTFloat(10.0) * (elapsedTime - CPTFloat(1.0))); } /** @@ -365,13 +365,13 @@ CGFloat CPTAnimationTimingFunctionExponentialIn(CGFloat elapsedTime, CGFloat dur **/ CGFloat CPTAnimationTimingFunctionExponentialOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -386,22 +386,22 @@ CGFloat CPTAnimationTimingFunctionExponentialOut(CGFloat elapsedTime, CGFloat du **/ CGFloat CPTAnimationTimingFunctionExponentialInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); elapsedTime -= CPTFloat(1.0); - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(0.0) ) { + if ( elapsedTime < CPTFloat(0.0)) { return CPTFloat(0.5) * pow(CPTFloat(2.0), CPTFloat(10.0) * elapsedTime); } else { - return CPTFloat(0.5) * ( -pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) + CPTFloat(2.0) ); + return CPTFloat(0.5) * (-pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) + CPTFloat(2.0)); } } @@ -416,17 +416,17 @@ CGFloat CPTAnimationTimingFunctionExponentialInOut(CGFloat elapsedTime, CGFloat **/ CGFloat CPTAnimationTimingFunctionSinusoidalIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return -cos( elapsedTime * CPTFloat(M_PI_2) ) + CPTFloat(1.0); + return -cos(elapsedTime * CPTFloat(M_PI_2)) + CPTFloat(1.0); } /** @@ -437,17 +437,17 @@ CGFloat CPTAnimationTimingFunctionSinusoidalIn(CGFloat elapsedTime, CGFloat dura **/ CGFloat CPTAnimationTimingFunctionSinusoidalOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return sin( elapsedTime * CPTFloat(M_PI_2) ); + return sin(elapsedTime * CPTFloat(M_PI_2)); } /** @@ -458,17 +458,17 @@ CGFloat CPTAnimationTimingFunctionSinusoidalOut(CGFloat elapsedTime, CGFloat dur **/ CGFloat CPTAnimationTimingFunctionSinusoidalInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return CPTFloat(-0.5) * ( cos(CPTFloat(M_PI) * elapsedTime) - CPTFloat(1.0) ); + return CPTFloat(-0.5) * (cos(CPTFloat(M_PI) * elapsedTime) - CPTFloat(1.0)); } #pragma mark - @@ -482,13 +482,13 @@ CGFloat CPTAnimationTimingFunctionSinusoidalInOut(CGFloat elapsedTime, CGFloat d **/ CGFloat CPTAnimationTimingFunctionCubicIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -503,13 +503,13 @@ CGFloat CPTAnimationTimingFunctionCubicIn(CGFloat elapsedTime, CGFloat duration) **/ CGFloat CPTAnimationTimingFunctionCubicOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime = elapsedTime / duration - CPTFloat(1.0); - if ( elapsedTime >= CPTFloat(0.0) ) { + if ( elapsedTime >= CPTFloat(0.0)) { return CPTFloat(1.0); } @@ -524,23 +524,23 @@ CGFloat CPTAnimationTimingFunctionCubicOut(CGFloat elapsedTime, CGFloat duration **/ CGFloat CPTAnimationTimingFunctionCubicInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { + if ( elapsedTime < CPTFloat(1.0)) { return CPTFloat(0.5) * elapsedTime * elapsedTime * elapsedTime; } else { elapsedTime -= CPTFloat(2.0); - return CPTFloat(0.5) * ( elapsedTime * elapsedTime * elapsedTime + CPTFloat(2.0) ); + return CPTFloat(0.5) * (elapsedTime * elapsedTime * elapsedTime + CPTFloat(2.0)); } } @@ -555,13 +555,13 @@ CGFloat CPTAnimationTimingFunctionCubicInOut(CGFloat elapsedTime, CGFloat durati **/ CGFloat CPTAnimationTimingFunctionQuadraticIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -576,17 +576,17 @@ CGFloat CPTAnimationTimingFunctionQuadraticIn(CGFloat elapsedTime, CGFloat durat **/ CGFloat CPTAnimationTimingFunctionQuadraticOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return -elapsedTime * ( elapsedTime - CPTFloat(2.0) ); + return -elapsedTime * (elapsedTime - CPTFloat(2.0)); } /** @@ -597,23 +597,23 @@ CGFloat CPTAnimationTimingFunctionQuadraticOut(CGFloat elapsedTime, CGFloat dura **/ CGFloat CPTAnimationTimingFunctionQuadraticInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { + if ( elapsedTime < CPTFloat(1.0)) { return CPTFloat(0.5) * elapsedTime * elapsedTime; } else { elapsedTime -= CPTFloat(1.0); - return CPTFloat(-0.5) * ( elapsedTime * ( elapsedTime - CPTFloat(2.0) ) - CPTFloat(1.0) ); + return CPTFloat(-0.5) * (elapsedTime * (elapsedTime - CPTFloat(2.0)) - CPTFloat(1.0)); } } @@ -628,13 +628,13 @@ CGFloat CPTAnimationTimingFunctionQuadraticInOut(CGFloat elapsedTime, CGFloat du **/ CGFloat CPTAnimationTimingFunctionQuarticIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -649,17 +649,17 @@ CGFloat CPTAnimationTimingFunctionQuarticIn(CGFloat elapsedTime, CGFloat duratio **/ CGFloat CPTAnimationTimingFunctionQuarticOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime = elapsedTime / duration - CPTFloat(1.0); - if ( elapsedTime >= CPTFloat(0.0) ) { + if ( elapsedTime >= CPTFloat(0.0)) { return CPTFloat(1.0); } - return -( elapsedTime * elapsedTime * elapsedTime * elapsedTime - CPTFloat(1.0) ); + return -(elapsedTime * elapsedTime * elapsedTime * elapsedTime - CPTFloat(1.0)); } /** @@ -670,23 +670,23 @@ CGFloat CPTAnimationTimingFunctionQuarticOut(CGFloat elapsedTime, CGFloat durati **/ CGFloat CPTAnimationTimingFunctionQuarticInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { + if ( elapsedTime < CPTFloat(1.0)) { return CPTFloat(0.5) * elapsedTime * elapsedTime * elapsedTime * elapsedTime; } else { elapsedTime -= CPTFloat(2.0); - return CPTFloat(-0.5) * ( elapsedTime * elapsedTime * elapsedTime * elapsedTime - CPTFloat(2.0) ); + return CPTFloat(-0.5) * (elapsedTime * elapsedTime * elapsedTime * elapsedTime - CPTFloat(2.0)); } } @@ -701,13 +701,13 @@ CGFloat CPTAnimationTimingFunctionQuarticInOut(CGFloat elapsedTime, CGFloat dura **/ CGFloat CPTAnimationTimingFunctionQuinticIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -722,13 +722,13 @@ CGFloat CPTAnimationTimingFunctionQuinticIn(CGFloat elapsedTime, CGFloat duratio **/ CGFloat CPTAnimationTimingFunctionQuinticOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime = elapsedTime / duration - CPTFloat(1.0); - if ( elapsedTime >= CPTFloat(0.0) ) { + if ( elapsedTime >= CPTFloat(0.0)) { return CPTFloat(1.0); } @@ -743,22 +743,22 @@ CGFloat CPTAnimationTimingFunctionQuinticOut(CGFloat elapsedTime, CGFloat durati **/ CGFloat CPTAnimationTimingFunctionQuinticInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { + if ( elapsedTime < CPTFloat(1.0)) { return CPTFloat(0.5) * elapsedTime * elapsedTime * elapsedTime * elapsedTime * elapsedTime; } else { elapsedTime -= CPTFloat(2.0); - return CPTFloat(0.5) * ( elapsedTime * elapsedTime * elapsedTime * elapsedTime * elapsedTime + CPTFloat(2.0) ); + return CPTFloat(0.5) * (elapsedTime * elapsedTime * elapsedTime * elapsedTime * elapsedTime + CPTFloat(2.0)); } } diff --git a/framework/Source/_CPTBorderLayer.m b/framework/Source/_CPTBorderLayer.m index 2915afe91..009fa48eb 100644 --- a/framework/Source/_CPTBorderLayer.m +++ b/framework/Source/_CPTBorderLayer.m @@ -33,7 +33,7 @@ @implementation CPTBorderLayer **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { maskedLayer = nil; self.needsDisplayOnBoundsChange = YES; @@ -47,7 +47,7 @@ -(nonnull instancetype)initWithFrame:(CGRect)newFrame -(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTBorderLayer *theLayer = (CPTBorderLayer *)layer; maskedLayer = theLayer->maskedLayer; @@ -71,14 +71,27 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - maskedLayer = [coder decodeObjectForKey:@"CPTBorderLayer.maskedLayer"]; + if ((self = [super initWithCoder:coder])) { + maskedLayer = [coder decodeObjectOfClass:[CPTBorderedLayer class] + forKey:@"CPTBorderLayer.maskedLayer"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing @@ -130,12 +143,12 @@ -(void)layoutSublayers } } --(nullable CPTSublayerSet)sublayersExcludedFromAutomaticLayout +-(nullable CPTSublayerSet *)sublayersExcludedFromAutomaticLayout { CPTBorderedLayer *excludedLayer = self.maskedLayer; if ( excludedLayer ) { - CPTMutableSublayerSet excludedSublayers = [super.sublayersExcludedFromAutomaticLayout mutableCopy]; + CPTMutableSublayerSet *excludedSublayers = [super.sublayersExcludedFromAutomaticLayout mutableCopy]; if ( !excludedSublayers ) { excludedSublayers = [NSMutableSet set]; } @@ -164,7 +177,7 @@ -(void)setMaskedLayer:(nullable CPTBorderedLayer *)newLayer -(void)setBounds:(CGRect)newBounds { - if ( !CGRectEqualToRect(newBounds, self.bounds) ) { + if ( !CGRectEqualToRect(newBounds, self.bounds)) { super.bounds = newBounds; [self setNeedsLayout]; } diff --git a/framework/Source/_CPTConstraintsFixed.m b/framework/Source/_CPTConstraintsFixed.m index e6ffb0467..7cef014bc 100644 --- a/framework/Source/_CPTConstraintsFixed.m +++ b/framework/Source/_CPTConstraintsFixed.m @@ -32,7 +32,7 @@ @implementation _CPTConstraintsFixed **/ -(nonnull instancetype)initWithLowerOffset:(CGFloat)newOffset { - if ( (self = [super init]) ) { + if ((self = [super init])) { offset = newOffset; isFixedToLower = YES; } @@ -46,7 +46,7 @@ -(nonnull instancetype)initWithLowerOffset:(CGFloat)newOffset **/ -(nonnull instancetype)initWithUpperOffset:(CGFloat)newOffset { - if ( (self = [super init]) ) { + if ((self = [super init])) { offset = newOffset; isFixedToLower = NO; } @@ -62,8 +62,8 @@ -(BOOL)isEqualToConstraint:(nullable CPTConstraints *)otherConstraint if ( [self class] != [otherConstraint class] ) { return NO; } - return (self.offset == ( (_CPTConstraintsFixed *)otherConstraint ).offset) && - (self.isFixedToLower == ( (_CPTConstraintsFixed *)otherConstraint ).isFixedToLower); + return (self.offset == ((_CPTConstraintsFixed *)otherConstraint).offset) && + (self.isFixedToLower == ((_CPTConstraintsFixed *)otherConstraint).isFixedToLower); } #pragma mark - @@ -131,11 +131,23 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { offset = [coder decodeCGFloatForKey:@"_CPTConstraintsFixed.offset"]; isFixedToLower = [coder decodeBoolForKey:@"_CPTConstraintsFixed.isFixedToLower"]; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/_CPTConstraintsRelative.m b/framework/Source/_CPTConstraintsRelative.m index 40a93b59b..533e204ed 100644 --- a/framework/Source/_CPTConstraintsRelative.m +++ b/framework/Source/_CPTConstraintsRelative.m @@ -35,7 +35,7 @@ @implementation _CPTConstraintsRelative **/ -(nonnull instancetype)initWithRelativeOffset:(CGFloat)newOffset { - if ( (self = [super init]) ) { + if ((self = [super init])) { offset = newOffset; } @@ -50,7 +50,7 @@ -(BOOL)isEqualToConstraint:(nullable CPTConstraints *)otherConstraint if ( [self class] != [otherConstraint class] ) { return NO; } - return self.offset == ( (_CPTConstraintsRelative *)otherConstraint ).offset; + return self.offset == ((_CPTConstraintsRelative *)otherConstraint).offset; } #pragma mark - @@ -109,10 +109,22 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { offset = [coder decodeCGFloatForKey:@"_CPTConstraintsRelative.offset"]; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/_CPTDarkGradientTheme.m b/framework/Source/_CPTDarkGradientTheme.m index 34c2f40c6..e15eaf091 100644 --- a/framework/Source/_CPTDarkGradientTheme.m +++ b/framework/Source/_CPTDarkGradientTheme.m @@ -12,16 +12,7 @@ #import "CPTXYAxisSet.h" #import "CPTXYGraph.h" -NSString *const kCPTDarkGradientTheme = @"Dark Gradients"; - -/// @cond -@interface _CPTDarkGradientTheme() - --(void)applyThemeToAxis:(CPTXYAxis *)axis usingMajorLineStyle:(nonnull CPTLineStyle *)majorLineStyle minorLineStyle:(nonnull CPTLineStyle *)minorLineStyle textStyle:(nonnull CPTMutableTextStyle *)textStyle minorTickTextStyle:(nonnull CPTMutableTextStyle *)minorTickTextStyle; - -@end - -/// @endcond +CPTThemeName const kCPTDarkGradientTheme = @"Dark Gradients"; #pragma mark - @@ -42,23 +33,6 @@ +(nonnull NSString *)name #pragma mark - --(void)applyThemeToAxis:(CPTXYAxis *)axis usingMajorLineStyle:(nonnull CPTLineStyle *)majorLineStyle minorLineStyle:(nonnull CPTLineStyle *)minorLineStyle textStyle:(nonnull CPTMutableTextStyle *)textStyle minorTickTextStyle:(nonnull CPTMutableTextStyle *)minorTickTextStyle -{ - axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - axis.majorIntervalLength = @0.5; - axis.orthogonalPosition = @0.0; - axis.tickDirection = CPTSignNone; - axis.minorTicksPerInterval = 4; - axis.majorTickLineStyle = majorLineStyle; - axis.minorTickLineStyle = minorLineStyle; - axis.axisLineStyle = majorLineStyle; - axis.majorTickLength = CPTFloat(7.0); - axis.minorTickLength = CPTFloat(5.0); - axis.labelTextStyle = textStyle; - axis.minorTickLabelTextStyle = minorTickTextStyle; - axis.titleTextStyle = textStyle; -} - -(void)applyThemeToBackground:(nonnull CPTGraph *)graph { CPTColor *endColor = [CPTColor colorWithGenericGray:CPTFloat(0.1)]; @@ -108,7 +82,19 @@ -(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet whiteMinorTickTextStyle.fontSize = CPTFloat(12.0); for ( CPTXYAxis *axis in axisSet.axes ) { - [self applyThemeToAxis:axis usingMajorLineStyle:majorLineStyle minorLineStyle:minorLineStyle textStyle:whiteTextStyle minorTickTextStyle:whiteMinorTickTextStyle]; + axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; + axis.majorIntervalLength = @0.5; + axis.orthogonalPosition = @0.0; + axis.tickDirection = CPTSignNone; + axis.minorTicksPerInterval = 4; + axis.majorTickLineStyle = majorLineStyle; + axis.minorTickLineStyle = minorLineStyle; + axis.axisLineStyle = majorLineStyle; + axis.majorTickLength = CPTFloat(7.0); + axis.minorTickLength = CPTFloat(5.0); + axis.labelTextStyle = whiteTextStyle; + axis.minorTickLabelTextStyle = whiteMinorTickTextStyle; + axis.titleTextStyle = whiteTextStyle; } } diff --git a/framework/Source/_CPTFillColor.h b/framework/Source/_CPTFillColor.h index 768ade7ef..b04943ae2 100644 --- a/framework/Source/_CPTFillColor.h +++ b/framework/Source/_CPTFillColor.h @@ -1,6 +1,6 @@ #import "CPTFill.h" -@interface _CPTFillColor : CPTFill +@interface _CPTFillColor : CPTFill /// @name Initialization /// @{ diff --git a/framework/Source/_CPTFillColor.m b/framework/Source/_CPTFillColor.m index 8acec91b7..628f5b6d1 100644 --- a/framework/Source/_CPTFillColor.m +++ b/framework/Source/_CPTFillColor.m @@ -32,7 +32,7 @@ @implementation _CPTFillColor **/ -(nonnull instancetype)initWithColor:(nonnull CPTColor *)aColor { - if ( (self = [super init]) ) { + if ((self = [super init])) { fillColor = aColor; } return self; @@ -119,8 +119,9 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - CPTColor *color = [coder decodeObjectForKey:@"_CPTFillColor.fillColor"]; + if ((self = [super init])) { + CPTColor *color = [coder decodeObjectOfClass:[CPTColor class] + forKey:@"_CPTFillColor.fillColor"]; if ( color ) { fillColor = color; @@ -132,4 +133,16 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/_CPTFillGradient.h b/framework/Source/_CPTFillGradient.h index 6e9e1279e..5344bf7fb 100644 --- a/framework/Source/_CPTFillGradient.h +++ b/framework/Source/_CPTFillGradient.h @@ -2,7 +2,7 @@ @class CPTGradient; -@interface _CPTFillGradient : CPTFill +@interface _CPTFillGradient : CPTFill /// @name Initialization /// @{ diff --git a/framework/Source/_CPTFillGradient.m b/framework/Source/_CPTFillGradient.m index 122dac2f8..c7d0aa70c 100644 --- a/framework/Source/_CPTFillGradient.m +++ b/framework/Source/_CPTFillGradient.m @@ -32,7 +32,7 @@ @implementation _CPTFillGradient **/ -(nonnull instancetype)initWithGradient:(nonnull CPTGradient *)aGradient { - if ( (self = [super init]) ) { + if ((self = [super init])) { fillGradient = aGradient; } return self; @@ -105,8 +105,9 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - CPTGradient *gradient = [coder decodeObjectForKey:@"_CPTFillGradient.fillGradient"]; + if ((self = [super init])) { + CPTGradient *gradient = [coder decodeObjectOfClass:[CPTGradient class] + forKey:@"_CPTFillGradient.fillGradient"]; if ( gradient ) { fillGradient = gradient; @@ -118,4 +119,16 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/_CPTFillImage.h b/framework/Source/_CPTFillImage.h index b370ce012..49bbb205f 100644 --- a/framework/Source/_CPTFillImage.h +++ b/framework/Source/_CPTFillImage.h @@ -2,7 +2,7 @@ @class CPTImage; -@interface _CPTFillImage : CPTFill +@interface _CPTFillImage : CPTFill /// @name Initialization /// @{ diff --git a/framework/Source/_CPTFillImage.m b/framework/Source/_CPTFillImage.m index 4ccda0aab..48614de11 100644 --- a/framework/Source/_CPTFillImage.m +++ b/framework/Source/_CPTFillImage.m @@ -32,7 +32,7 @@ @implementation _CPTFillImage **/ -(nonnull instancetype)initWithImage:(nonnull CPTImage *)anImage { - if ( (self = [super init]) ) { + if ((self = [super init])) { fillImage = anImage; } return self; @@ -111,8 +111,9 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder */ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - CPTImage *image = [coder decodeObjectForKey:@"_CPTFillImage.fillImage"]; + if ((self = [super init])) { + CPTImage *image = [coder decodeObjectOfClass:[CPTImage class] + forKey:@"_CPTFillImage.fillImage"]; if ( image ) { fillImage = image; @@ -124,4 +125,16 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/_CPTMaskLayer.m b/framework/Source/_CPTMaskLayer.m index d4cceba9f..14e3dc603 100644 --- a/framework/Source/_CPTMaskLayer.m +++ b/framework/Source/_CPTMaskLayer.m @@ -18,7 +18,7 @@ @implementation CPTMaskLayer **/ -(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { self.needsDisplayOnBoundsChange = YES; } return self; @@ -36,7 +36,7 @@ -(void)renderAsVectorInContext:(nonnull CGContextRef)context CPTLayer *theMaskedLayer = (CPTLayer *)self.superlayer; if ( theMaskedLayer ) { - CGContextSetRGBFillColor( context, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0) ); + CGContextSetRGBFillColor(context, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0)); if ( [theMaskedLayer isKindOfClass:[CPTLayer class]] ) { CGPathRef maskingPath = theMaskedLayer.sublayerMaskingPath; diff --git a/framework/Source/_CPTPlainBlackTheme.m b/framework/Source/_CPTPlainBlackTheme.m index ad52aa0b8..05783b4f1 100644 --- a/framework/Source/_CPTPlainBlackTheme.m +++ b/framework/Source/_CPTPlainBlackTheme.m @@ -11,7 +11,7 @@ #import "CPTXYAxisSet.h" #import "CPTXYGraph.h" -NSString *const kCPTPlainBlackTheme = @"Plain Black"; +CPTThemeName const kCPTPlainBlackTheme = @"Plain Black"; /** * @brief Creates a CPTXYGraph instance formatted with black backgrounds and white lines. @@ -49,7 +49,6 @@ -(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *)plotAreaFrame -(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet { - CPTXYAxisSet *xyAxisSet = (CPTXYAxisSet *)axisSet; CPTMutableLineStyle *majorLineStyle = [CPTMutableLineStyle lineStyle]; majorLineStyle.lineCap = kCGLineCapRound; @@ -60,42 +59,29 @@ -(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet minorLineStyle.lineColor = [CPTColor whiteColor]; minorLineStyle.lineWidth = CPTFloat(3.0); - CPTXYAxis *x = xyAxisSet.xAxis; CPTMutableTextStyle *whiteTextStyle = [[CPTMutableTextStyle alloc] init]; whiteTextStyle.color = [CPTColor whiteColor]; whiteTextStyle.fontSize = CPTFloat(14.0); + CPTMutableTextStyle *minorTickWhiteTextStyle = [[CPTMutableTextStyle alloc] init]; minorTickWhiteTextStyle.color = [CPTColor whiteColor]; minorTickWhiteTextStyle.fontSize = CPTFloat(12.0); - x.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - x.majorIntervalLength = @0.5; - x.orthogonalPosition = @0.0; - x.tickDirection = CPTSignNone; - x.minorTicksPerInterval = 4; - x.majorTickLineStyle = majorLineStyle; - x.minorTickLineStyle = minorLineStyle; - x.axisLineStyle = majorLineStyle; - x.majorTickLength = CPTFloat(7.0); - x.minorTickLength = CPTFloat(5.0); - x.labelTextStyle = whiteTextStyle; - x.minorTickLabelTextStyle = whiteTextStyle; - x.titleTextStyle = whiteTextStyle; - - CPTXYAxis *y = xyAxisSet.yAxis; - y.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - y.majorIntervalLength = @0.5; - y.minorTicksPerInterval = 4; - y.orthogonalPosition = @0.0; - y.tickDirection = CPTSignNone; - y.majorTickLineStyle = majorLineStyle; - y.minorTickLineStyle = minorLineStyle; - y.axisLineStyle = majorLineStyle; - y.majorTickLength = CPTFloat(7.0); - y.minorTickLength = CPTFloat(5.0); - y.labelTextStyle = whiteTextStyle; - y.minorTickLabelTextStyle = minorTickWhiteTextStyle; - y.titleTextStyle = whiteTextStyle; + for ( CPTXYAxis *axis in axisSet.axes ) { + axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; + axis.majorIntervalLength = @0.5; + axis.orthogonalPosition = @0.0; + axis.tickDirection = CPTSignNone; + axis.minorTicksPerInterval = 4; + axis.majorTickLineStyle = majorLineStyle; + axis.minorTickLineStyle = minorLineStyle; + axis.axisLineStyle = majorLineStyle; + axis.majorTickLength = CPTFloat(7.0); + axis.minorTickLength = CPTFloat(5.0); + axis.labelTextStyle = whiteTextStyle; + axis.minorTickLabelTextStyle = whiteTextStyle; + axis.titleTextStyle = whiteTextStyle; + } } #pragma mark - diff --git a/framework/Source/_CPTPlainWhiteTheme.m b/framework/Source/_CPTPlainWhiteTheme.m index 485475e47..5a8ed24f2 100644 --- a/framework/Source/_CPTPlainWhiteTheme.m +++ b/framework/Source/_CPTPlainWhiteTheme.m @@ -11,7 +11,7 @@ #import "CPTXYAxisSet.h" #import "CPTXYGraph.h" -NSString *const kCPTPlainWhiteTheme = @"Plain White"; +CPTThemeName const kCPTPlainWhiteTheme = @"Plain White"; /** * @brief Creates a CPTXYGraph instance formatted with white backgrounds and black lines. @@ -49,7 +49,6 @@ -(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *)plotAreaFrame -(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet { - CPTXYAxisSet *xyAxisSet = (CPTXYAxisSet *)axisSet; CPTMutableLineStyle *majorLineStyle = [CPTMutableLineStyle lineStyle]; majorLineStyle.lineCap = kCGLineCapButt; @@ -69,35 +68,21 @@ -(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet minorTickBlackTextStyle.color = [CPTColor blackColor]; minorTickBlackTextStyle.fontSize = CPTFloat(12.0); - CPTXYAxis *x = xyAxisSet.xAxis; - x.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - x.majorIntervalLength = @0.5; - x.orthogonalPosition = @0.0; - x.tickDirection = CPTSignNone; - x.minorTicksPerInterval = 4; - x.majorTickLineStyle = majorLineStyle; - x.minorTickLineStyle = minorLineStyle; - x.axisLineStyle = majorLineStyle; - x.majorTickLength = CPTFloat(7.0); - x.minorTickLength = CPTFloat(5.0); - x.labelTextStyle = blackTextStyle; - x.minorTickLabelTextStyle = blackTextStyle; - x.titleTextStyle = blackTextStyle; - - CPTXYAxis *y = xyAxisSet.yAxis; - y.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - y.majorIntervalLength = @0.5; - y.minorTicksPerInterval = 4; - y.orthogonalPosition = @0.0; - y.tickDirection = CPTSignNone; - y.majorTickLineStyle = majorLineStyle; - y.minorTickLineStyle = minorLineStyle; - y.axisLineStyle = majorLineStyle; - y.majorTickLength = CPTFloat(7.0); - y.minorTickLength = CPTFloat(5.0); - y.labelTextStyle = blackTextStyle; - y.minorTickLabelTextStyle = minorTickBlackTextStyle; - y.titleTextStyle = blackTextStyle; + for ( CPTXYAxis *axis in axisSet.axes ) { + axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; + axis.majorIntervalLength = @0.5; + axis.orthogonalPosition = @0.0; + axis.tickDirection = CPTSignNone; + axis.minorTicksPerInterval = 4; + axis.majorTickLineStyle = majorLineStyle; + axis.minorTickLineStyle = minorLineStyle; + axis.axisLineStyle = majorLineStyle; + axis.majorTickLength = CPTFloat(7.0); + axis.minorTickLength = CPTFloat(5.0); + axis.labelTextStyle = blackTextStyle; + axis.minorTickLabelTextStyle = blackTextStyle; + axis.titleTextStyle = blackTextStyle; + } } #pragma mark - diff --git a/framework/Source/_CPTSlateTheme.m b/framework/Source/_CPTSlateTheme.m index 35cff032b..c357e48a9 100644 --- a/framework/Source/_CPTSlateTheme.m +++ b/framework/Source/_CPTSlateTheme.m @@ -12,16 +12,7 @@ #import "CPTXYAxisSet.h" #import "CPTXYGraph.h" -NSString *const kCPTSlateTheme = @"Slate"; - -/// @cond -@interface _CPTSlateTheme() - --(void)applyThemeToAxis:(CPTXYAxis *)axis usingMajorLineStyle:(nonnull CPTLineStyle *)majorLineStyle minorLineStyle:(nonnull CPTLineStyle *)minorLineStyle textStyle:(nonnull CPTMutableTextStyle *)textStyle minorTickTextStyle:(nonnull CPTMutableTextStyle *)minorTickTextStyle; - -@end - -/// @endcond +CPTThemeName const kCPTSlateTheme = @"Slate"; #pragma mark - @@ -42,23 +33,6 @@ +(nonnull NSString *)name #pragma mark - --(void)applyThemeToAxis:(CPTXYAxis *)axis usingMajorLineStyle:(nonnull CPTLineStyle *)majorLineStyle minorLineStyle:(nonnull CPTLineStyle *)minorLineStyle textStyle:(nonnull CPTMutableTextStyle *)textStyle minorTickTextStyle:(nonnull CPTMutableTextStyle *)minorTickTextStyle -{ - axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - axis.majorIntervalLength = @0.5; - axis.orthogonalPosition = @0.0; - axis.tickDirection = CPTSignNone; - axis.minorTicksPerInterval = 4; - axis.majorTickLineStyle = majorLineStyle; - axis.minorTickLineStyle = minorLineStyle; - axis.axisLineStyle = majorLineStyle; - axis.majorTickLength = CPTFloat(7.0); - axis.minorTickLength = CPTFloat(5.0); - axis.labelTextStyle = textStyle; - axis.minorTickLabelTextStyle = minorTickTextStyle; - axis.titleTextStyle = textStyle; -} - -(void)applyThemeToBackground:(nonnull CPTGraph *)graph { CPTGradient *gradient = [CPTGradient gradientWithBeginningColor:[CPTColor colorWithComponentRed:CPTFloat(0.43) green:CPTFloat(0.51) blue:CPTFloat(0.63) alpha:CPTFloat(1.0)] @@ -107,7 +81,19 @@ -(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet minorTickBlackTextStyle.fontSize = CPTFloat(12.0); for ( CPTXYAxis *axis in axisSet.axes ) { - [self applyThemeToAxis:axis usingMajorLineStyle:majorLineStyle minorLineStyle:minorLineStyle textStyle:blackTextStyle minorTickTextStyle:minorTickBlackTextStyle]; + axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; + axis.majorIntervalLength = @0.5; + axis.orthogonalPosition = @0.0; + axis.tickDirection = CPTSignNone; + axis.minorTicksPerInterval = 4; + axis.majorTickLineStyle = majorLineStyle; + axis.minorTickLineStyle = minorLineStyle; + axis.axisLineStyle = majorLineStyle; + axis.majorTickLength = CPTFloat(7.0); + axis.minorTickLength = CPTFloat(5.0); + axis.labelTextStyle = blackTextStyle; + axis.minorTickLabelTextStyle = minorTickBlackTextStyle; + axis.titleTextStyle = blackTextStyle; } } diff --git a/framework/Source/_CPTStocksTheme.m b/framework/Source/_CPTStocksTheme.m index 83d2dc92d..4e3dcf0bc 100644 --- a/framework/Source/_CPTStocksTheme.m +++ b/framework/Source/_CPTStocksTheme.m @@ -12,7 +12,7 @@ #import "CPTXYAxisSet.h" #import "CPTXYGraph.h" -NSString *const kCPTStocksTheme = @"Stocks"; +CPTThemeName const kCPTStocksTheme = @"Stocks"; /** * @brief Creates a CPTXYGraph instance formatted with a gradient background and white lines. @@ -62,7 +62,6 @@ -(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *)plotAreaFrame -(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet { - CPTXYAxisSet *xyAxisSet = (CPTXYAxisSet *)axisSet; CPTMutableLineStyle *majorLineStyle = [CPTMutableLineStyle lineStyle]; majorLineStyle.lineCap = kCGLineCapRound; @@ -81,35 +80,21 @@ -(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet minorTickWhiteTextStyle.color = [CPTColor whiteColor]; minorTickWhiteTextStyle.fontSize = CPTFloat(12.0); - CPTXYAxis *x = xyAxisSet.xAxis; - x.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - x.majorIntervalLength = @0.5; - x.orthogonalPosition = @0.0; - x.tickDirection = CPTSignNone; - x.minorTicksPerInterval = 4; - x.majorTickLineStyle = majorLineStyle; - x.minorTickLineStyle = minorLineStyle; - x.axisLineStyle = majorLineStyle; - x.majorTickLength = CPTFloat(7.0); - x.minorTickLength = CPTFloat(5.0); - x.labelTextStyle = whiteTextStyle; - x.minorTickLabelTextStyle = minorTickWhiteTextStyle; - x.titleTextStyle = whiteTextStyle; - - CPTXYAxis *y = xyAxisSet.yAxis; - y.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - y.majorIntervalLength = @0.5; - y.minorTicksPerInterval = 4; - y.orthogonalPosition = @0.0; - y.tickDirection = CPTSignNone; - y.majorTickLineStyle = majorLineStyle; - y.minorTickLineStyle = minorLineStyle; - y.axisLineStyle = majorLineStyle; - y.majorTickLength = CPTFloat(7.0); - y.minorTickLength = CPTFloat(5.0); - y.labelTextStyle = whiteTextStyle; - y.minorTickLabelTextStyle = minorTickWhiteTextStyle; - y.titleTextStyle = whiteTextStyle; + for ( CPTXYAxis *axis in axisSet.axes ) { + axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; + axis.majorIntervalLength = @0.5; + axis.orthogonalPosition = @0.0; + axis.tickDirection = CPTSignNone; + axis.minorTicksPerInterval = 4; + axis.majorTickLineStyle = majorLineStyle; + axis.minorTickLineStyle = minorLineStyle; + axis.axisLineStyle = majorLineStyle; + axis.majorTickLength = CPTFloat(7.0); + axis.minorTickLength = CPTFloat(5.0); + axis.labelTextStyle = whiteTextStyle; + axis.minorTickLabelTextStyle = minorTickWhiteTextStyle; + axis.titleTextStyle = whiteTextStyle; + } } #pragma mark - diff --git a/framework/Source/_CPTXYTheme.m b/framework/Source/_CPTXYTheme.m index 9bb2675ba..129d137aa 100644 --- a/framework/Source/_CPTXYTheme.m +++ b/framework/Source/_CPTXYTheme.m @@ -15,7 +15,7 @@ @implementation _CPTXYTheme -(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.graphClass = [CPTXYGraph class]; } return self; diff --git a/framework/Source/mainpage.h b/framework/Source/mainpage.h index b4e1287ad..06ec0e648 100644 --- a/framework/Source/mainpage.h +++ b/framework/Source/mainpage.h @@ -2,7 +2,7 @@ * * @section intro Introduction * - * Core Plot is a 2D plotting framework for Mac OS X and iOS. + * Core Plot is a 2D Cocoa plotting framework for macOS, iOS, and tvOS. * It is highly customizable and capable of drawing many types of plots. * See the Example Graphs * wiki page and the example applications @@ -38,7 +38,6 @@ * @subsection socialnetworks Social Networks * * - Twitter - * - App.net; Subscribe to the Announcements broadcast. * * @section contributingtocoreplot Contributing to Core Plot * @@ -56,8 +55,8 @@ * Nonetheless, in a project like Core Plot, with many developers contributing, it is worthwhile * defining a set of basic coding standards to prevent a mishmash of different styles which can * become frustrating when navigating the code base. See the file - * Coding Style.markdown - * found in the documentation + * CONTRIBUTING.md + * found in the .github * directory of the project source for specific guidelines. * * Core Plot includes a script diff --git a/framework/TestResources/CorePlotProbes.d b/framework/TestResources/CorePlotProbes.d deleted file mode 100644 index 05e68c33e..000000000 --- a/framework/TestResources/CorePlotProbes.d +++ /dev/null @@ -1,3 +0,0 @@ -provider CorePlot { - probe layer_position_change(char *, int, int, int, int); -}; \ No newline at end of file diff --git a/framework/English.lproj/InfoPlist.strings b/framework/en.lproj/InfoPlist.strings similarity index 100% rename from framework/English.lproj/InfoPlist.strings rename to framework/en.lproj/InfoPlist.strings diff --git a/framework/iPhoneOnly/CPTGraphHostingView.h b/framework/iPhoneOnly/CPTGraphHostingView.h index b98c5784e..17f7ec128 100644 --- a/framework/iPhoneOnly/CPTGraphHostingView.h +++ b/framework/iPhoneOnly/CPTGraphHostingView.h @@ -2,7 +2,7 @@ @class CPTGraph; -@interface CPTGraphHostingView : UIView +@interface CPTGraphHostingView : UIView @property (nonatomic, readwrite, strong, nullable) CPTGraph *hostedGraph; @property (nonatomic, readwrite, assign) BOOL collapsesLayers; diff --git a/framework/iPhoneOnly/CPTGraphHostingView.m b/framework/iPhoneOnly/CPTGraphHostingView.m index e74951a8f..0c9866702 100644 --- a/framework/iPhoneOnly/CPTGraphHostingView.m +++ b/framework/iPhoneOnly/CPTGraphHostingView.m @@ -9,10 +9,13 @@ /// @cond @interface CPTGraphHostingView() -@property (nonatomic, readwrite, nullable, cpt_weak_property) cpt_weak UIPinchGestureRecognizer *pinchGestureRecognizer; +#if (TARGET_OS_SIMULATOR || TARGET_OS_IPHONE) && !TARGET_OS_TV +@property (nonatomic, readwrite, nullable, cpt_weak_property) UIPinchGestureRecognizer *pinchGestureRecognizer; --(void)graphNeedsRedraw:(nonnull NSNotification *)notification; -(void)handlePinchGesture:(nonnull UIPinchGestureRecognizer *)aPinchGestureRecognizer; +#endif + +-(void)graphNeedsRedraw:(nonnull NSNotification *)notification; @end @@ -44,11 +47,15 @@ @implementation CPTGraphHostingView /// @cond +#if (TARGET_OS_SIMULATOR || TARGET_OS_IPHONE) && !TARGET_OS_TV + /** @internal - * @property nullable cpt_weak UIPinchGestureRecognizer *pinchGestureRecognizer + * @property nullable UIPinchGestureRecognizer *pinchGestureRecognizer * @brief The pinch gesture recognizer for this view. + * @since Not available on tvOS. **/ @synthesize pinchGestureRecognizer; +#endif /// @endcond @@ -72,17 +79,24 @@ -(void)commonInit self.allowPinchScaling = YES; // This undoes the normal coordinate space inversion that UIViews apply to their layers - self.layer.sublayerTransform = CATransform3DMakeScale( CPTFloat(1.0), CPTFloat(-1.0), CPTFloat(1.0) ); + self.layer.sublayerTransform = CATransform3DMakeScale(CPTFloat(1.0), CPTFloat(-1.0), CPTFloat(1.0)); } -(nonnull instancetype)initWithFrame:(CGRect)frame { - if ( (self = [super initWithFrame:frame]) ) { + if ((self = [super initWithFrame:frame])) { [self commonInit]; } return self; } +-(void)awakeFromNib +{ + [super awakeFromNib]; + + [self commonInit]; +} + -(void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -109,11 +123,12 @@ -(void)encodeWithCoder:(nonnull NSCoder *)coder -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { + if ((self = [super initWithCoder:coder])) { [self commonInit]; collapsesLayers = [coder decodeBoolForKey:@"CPTGraphHostingView.collapsesLayers"]; - self.hostedGraph = [coder decodeObjectForKey:@"CPTGraphHostingView.hostedGraph"]; // setup layers + self.hostedGraph = [coder decodeObjectOfClass:[CPTGraph class] + forKey:@"CPTGraphHostingView.hostedGraph"]; // setup layers if ( [coder containsValueForKey:@"CPTGraphHostingView.allowPinchScaling"] ) { self.allowPinchScaling = [coder decodeBoolForKey:@"CPTGraphHostingView.allowPinchScaling"]; // set gesture recognizer if needed @@ -124,6 +139,18 @@ -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Touch handling @@ -210,7 +237,7 @@ -(void)touchesEnded:(nonnull NSSet *)touches withEvent:(nullable UIEv } } --(void)touchesCancelled:(nullable NSSet *)touches withEvent:(nullable UIEvent *)event +-(void)touchesCancelled:(nonnull NSSet *)touches withEvent:(nullable UIEvent *)event { BOOL handled = NO; @@ -231,6 +258,7 @@ -(void)touchesCancelled:(nullable NSSet *)touches withEvent:(nullable /// @cond +#if (TARGET_OS_SIMULATOR || TARGET_OS_IPHONE) && !TARGET_OS_TV -(void)setAllowPinchScaling:(BOOL)allowScaling { if ( allowPinchScaling != allowScaling ) { @@ -281,6 +309,24 @@ -(void)handlePinchGesture:(nonnull UIPinchGestureRecognizer *)aPinchGestureRecog pinchRecognizer.scale = 1.0; } +#endif + +/// @endcond + +#pragma mark - +#pragma mark TV Focus + +/// @cond + +#if TARGET_OS_TV + +-(BOOL)canBecomeFocused +{ + return YES; +} + +#endif + /// @endcond #pragma mark - @@ -288,7 +334,7 @@ -(void)handlePinchGesture:(nonnull UIPinchGestureRecognizer *)aPinchGestureRecog /// @cond --(void)drawRect:(CGRect)rect +-(void)drawRect:(CGRect __unused)rect { if ( self.collapsesLayers ) { CGContextRef context = UIGraphicsGetCurrentContext(); @@ -301,11 +347,18 @@ -(void)drawRect:(CGRect)rect } } --(void)graphNeedsRedraw:(nonnull NSNotification *)notification +-(void)graphNeedsRedraw:(nonnull NSNotification *__unused)notification { [self setNeedsDisplay]; } +-(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection +{ + [super traitCollectionDidChange:previousTraitCollection]; + + [self.hostedGraph setNeedsDisplayAllLayers]; +} + /// @endcond #pragma mark - @@ -315,7 +368,7 @@ -(void)graphNeedsRedraw:(nonnull NSNotification *)notification -(void)setHostedGraph:(nullable CPTGraph *)newLayer { - NSParameterAssert( (newLayer == nil) || [newLayer isKindOfClass:[CPTGraph class]] ); + NSParameterAssert((newLayer == nil) || [newLayer isKindOfClass:[CPTGraph class]]); if ( newLayer == hostedGraph ) { return; diff --git a/framework/iPhoneOnly/CPTImagePlatformSpecific.m b/framework/iPhoneOnly/CPTImagePlatformSpecific.m index 21ad7a51e..20c73f03d 100644 --- a/framework/iPhoneOnly/CPTImagePlatformSpecific.m +++ b/framework/iPhoneOnly/CPTImagePlatformSpecific.m @@ -14,7 +14,7 @@ @implementation CPTImage(CPTPlatformSpecificImageExtensions) **/ -(nonnull instancetype)initWithNativeImage:(nullable CPTNativeImage *)anImage { - if ( (self = [self initWithCGImage:NULL scale:anImage.scale]) ) { + if ((self = [self initWithCGImage:NULL scale:anImage.scale])) { self.nativeImage = anImage; UIEdgeInsets insets = anImage.capInsets; @@ -45,7 +45,7 @@ -(nonnull instancetype)initForPNGFile:(nonnull NSString *)path imageScale = MAX(imageScale, screen.scale); } - if ( imageScale > CPTFloat(1.0) ) { + if ( imageScale > CPTFloat(1.0)) { NSMutableString *hiDpiPath = [path mutableCopy]; NSUInteger replaceCount = [hiDpiPath replaceOccurrencesOfString:@".png" withString:[NSString stringWithFormat:@"@%dx.png", (int)imageScale] diff --git a/framework/iPhoneOnly/CPTPlatformSpecificCategories.h b/framework/iPhoneOnly/CPTPlatformSpecificCategories.h index 06cd3ec67..efa9ffffc 100644 --- a/framework/iPhoneOnly/CPTPlatformSpecificCategories.h +++ b/framework/iPhoneOnly/CPTPlatformSpecificCategories.h @@ -2,17 +2,6 @@ #import "CPTLayer.h" #import "CPTPlatformSpecificDefines.h" -#pragma mark CPTColor - -/** @category CPTColor(CPTPlatformSpecificColorExtensions) - * @brief Platform-specific extensions to CPTColor. - **/ -@interface CPTColor(CPTPlatformSpecificColorExtensions) - -@property (nonatomic, readonly, nonnull) UIColor *uiColor; - -@end - #pragma mark - CPTLayer /** @category CPTLayer(CPTPlatformSpecificLayerExtensions) @@ -53,4 +42,9 @@ -(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context; /// @} +/// @name Measurement +/// @{ +-(CGSize)sizeAsDrawn; +/// @} + @end diff --git a/framework/iPhoneOnly/CPTPlatformSpecificCategories.m b/framework/iPhoneOnly/CPTPlatformSpecificCategories.m index c3b42aace..cad04a6f3 100644 --- a/framework/iPhoneOnly/CPTPlatformSpecificCategories.m +++ b/framework/iPhoneOnly/CPTPlatformSpecificCategories.m @@ -1,22 +1,7 @@ #import "CPTPlatformSpecificCategories.h" #import "CPTPlatformSpecificFunctions.h" - -#pragma mark CPTColor - -@implementation CPTColor(CPTPlatformSpecificColorExtensions) - -/** @property uiColor - * @brief Gets the color value as a UIColor. - **/ -@dynamic uiColor; - --(nonnull UIColor *)uiColor -{ - return [UIColor colorWithCGColor:self.cgColor]; -} - -@end +#import "tgmath.h" #pragma mark - CPTLayer @@ -29,14 +14,14 @@ -(nullable CPTNativeImage *)imageOfLayer { CGSize boundsSize = self.bounds.size; - UIGraphicsBeginImageContextWithOptions( boundsSize, self.opaque, CPTFloat(0.0) ); + UIGraphicsBeginImageContextWithOptions(boundsSize, self.opaque, CPTFloat(0.0)); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSaveGState(context); CGContextSetAllowsAntialiasing(context, true); CGContextTranslateCTM(context, CPTFloat(0.0), boundsSize.height); - CGContextScaleCTM( context, CPTFloat(1.0), CPTFloat(-1.0) ); + CGContextScaleCTM(context, CPTFloat(1.0), CPTFloat(-1.0)); [self layoutAndRenderInContext:context]; CPTNativeImage *layerImage = UIGraphicsGetImageFromCurrentImageContext(); @@ -107,11 +92,28 @@ -(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context CPTPushCGContext(context); [self drawWithRect:rect - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine + options:CPTStringDrawingOptions context:nil]; CPTPopCGContext(); } } +/** + * @brief Computes the size of the styled text when drawn rounded up to the nearest whole number in each dimension. + **/ +-(CGSize)sizeAsDrawn +{ + CGRect rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions + context:nil]; + + CGSize textSize = rect.size; + + textSize.width = ceil(textSize.width); + textSize.height = ceil(textSize.height); + + return textSize; +} + @end diff --git a/framework/iPhoneOnly/CPTPlatformSpecificDefines.h b/framework/iPhoneOnly/CPTPlatformSpecificDefines.h index 9b84d0d86..471ca99d5 100644 --- a/framework/iPhoneOnly/CPTPlatformSpecificDefines.h +++ b/framework/iPhoneOnly/CPTPlatformSpecificDefines.h @@ -1,4 +1,6 @@ /// @file +typedef UIColor CPTNativeColor; ///< Platform-native color. typedef UIImage CPTNativeImage; ///< Platform-native image format. typedef UIEvent CPTNativeEvent; ///< Platform-native OS event. +typedef UIFont CPTNativeFont; ///< Platform-native font. diff --git a/framework/iPhoneOnly/CPTPlatformSpecificFunctions.m b/framework/iPhoneOnly/CPTPlatformSpecificFunctions.m index 922dc209d..737d400f5 100644 --- a/framework/iPhoneOnly/CPTPlatformSpecificFunctions.m +++ b/framework/iPhoneOnly/CPTPlatformSpecificFunctions.m @@ -18,7 +18,7 @@ void CPTPopCGContext(void) #pragma mark - #pragma mark Debugging -CPTNativeImage * __nonnull CPTQuickLookImage(CGRect rect, __nonnull CPTQuickLookImageBlock renderBlock) +CPTNativeImage *__nonnull CPTQuickLookImage(CGRect rect, __nonnull CPTQuickLookImageBlock renderBlock) { UIGraphicsBeginImageContextWithOptions(rect.size, YES, 1.0); CGContextRef context = UIGraphicsGetCurrentContext(); diff --git a/framework/iPhoneOnly/CPTTextStylePlatformSpecific.h b/framework/iPhoneOnly/CPTTextStylePlatformSpecific.h index 283e70583..b1e699720 100644 --- a/framework/iPhoneOnly/CPTTextStylePlatformSpecific.h +++ b/framework/iPhoneOnly/CPTTextStylePlatformSpecific.h @@ -10,18 +10,3 @@ typedef NS_ENUM (NSInteger, CPTTextAlignment) { CPTTextAlignmentJustified = NSTextAlignmentJustified, ///< Justified alignment. CPTTextAlignmentNatural = NSTextAlignmentNatural ///< Natural alignment of the text's script. }; - -// @cond -// for iOS SDK compatibility -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE -#if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000 -@interface NSString(CPTTextStylePlatformSpecificExtensions) - --(CGSize)sizeWithAttributes:(nonnull CPTDictionary)attrs; - -@end -#else -#endif -#endif - -/// @endcond diff --git a/framework/iPhoneOnly/CPTTextStylePlatformSpecific.m b/framework/iPhoneOnly/CPTTextStylePlatformSpecific.m index 5d31e2002..c2602bbc6 100644 --- a/framework/iPhoneOnly/CPTTextStylePlatformSpecific.m +++ b/framework/iPhoneOnly/CPTTextStylePlatformSpecific.m @@ -8,7 +8,7 @@ @implementation CPTTextStyle(CPTPlatformSpecificTextStyleExtensions) -/** @property nonnull CPTDictionary attributes +/** @property nonnull CPTDictionary *attributes * @brief A dictionary of standard text attributes suitable for formatting an NSAttributedString. * * The dictionary will contain values for the following keys that represent the receiver's text style: @@ -34,7 +34,7 @@ @implementation CPTTextStyle(CPTPlatformSpecificTextStyleExtensions) * @param attributes A dictionary of standard text attributes. * @return A new CPTTextStyle instance. **/ -+(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attributes ++(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary *)attributes { CPTMutableTextStyle *newStyle = [CPTMutableTextStyle textStyle]; @@ -42,6 +42,7 @@ +(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attribute UIFont *styleFont = attributes[NSFontAttributeName]; if ( styleFont ) { + newStyle.font = styleFont; newStyle.fontName = styleFont.fontName; newStyle.fontSize = styleFont.pointSize; } @@ -67,15 +68,15 @@ +(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attribute /// @cond --(nonnull CPTDictionary)attributes +-(nonnull CPTDictionary *)attributes { - CPTMutableDictionary myAttributes = [NSMutableDictionary dictionary]; + CPTMutableDictionary *myAttributes = [NSMutableDictionary dictionary]; // Font - UIFont *styleFont = nil; + UIFont *styleFont = self.font; NSString *fontName = self.fontName; - if ( fontName ) { + if ((styleFont == nil) && fontName ) { styleFont = [UIFont fontWithName:fontName size:self.fontSize]; } @@ -124,7 +125,7 @@ @implementation CPTMutableTextStyle(CPTPlatformSpecificMutableTextStyleExtension * @param attributes A dictionary of standard text attributes. * @return A new CPTMutableTextStyle instance. **/ -+(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attributes ++(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary *)attributes { CPTMutableTextStyle *newStyle = [CPTMutableTextStyle textStyle]; @@ -132,6 +133,7 @@ +(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary)attribute UIFont *styleFont = attributes[NSFontAttributeName]; if ( styleFont ) { + newStyle.font = styleFont; newStyle.fontName = styleFont.fontName; newStyle.fontSize = styleFont.pointSize; } @@ -169,31 +171,15 @@ @implementation NSString(CPTTextStyleExtensions) **/ -(CGSize)sizeWithTextStyle:(nullable CPTTextStyle *)style { - CGSize textSize; - - // -boundingRectWithSize:options:attributes:context: is available in iOS 7.0 and later - if ( [self respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)] ) { - CGRect rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine - attributes:style.attributes - context:nil]; - textSize = rect.size; - textSize.width = ceil(textSize.width); - textSize.height = ceil(textSize.height); - } - else { - UIFont *theFont = nil; - NSString *fontName = style.fontName; + CGRect rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions + attributes:style.attributes + context:nil]; - if ( fontName ) { - theFont = [UIFont fontWithName:fontName size:style.fontSize]; - } + CGSize textSize = rect.size; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - textSize = [self sizeWithFont:theFont constrainedToSize:CPTSizeMake(10000.0, 10000.0)]; -#pragma clang diagnostic pop - } + textSize.width = ceil(textSize.width); + textSize.height = ceil(textSize.height); return textSize; } @@ -220,11 +206,17 @@ -(void)drawInRect:(CGRect)rect withTextStyle:(nullable CPTTextStyle *)style inCo CPTPushCGContext(context); +#if TARGET_OS_SIMULATOR || TARGET_OS_TV + [self drawWithRect:rect + options:CPTStringDrawingOptions + attributes:style.attributes + context:nil]; +#else #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 // -drawWithRect:options:attributes:context: method is available in iOS 7.0 and later if ( [self respondsToSelector:@selector(drawWithRect:options:attributes:context:)] ) { [self drawWithRect:rect - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine + options:CPTStringDrawingOptions attributes:style.attributes context:nil]; } @@ -232,10 +224,10 @@ -(void)drawInRect:(CGRect)rect withTextStyle:(nullable CPTTextStyle *)style inCo UIColor *styleColor = style.attributes[NSForegroundColorAttributeName]; [styleColor set]; - UIFont *theFont = nil; + UIFont *theFont = style.font; NSString *fontName = style.fontName; - if ( fontName ) { + if ((theFont == nil) && fontName ) { theFont = [UIFont fontWithName:fontName size:style.fontSize]; } @@ -251,12 +243,16 @@ -(void)drawInRect:(CGRect)rect withTextStyle:(nullable CPTTextStyle *)style inCo UIColor *styleColor = style.attributes[NSForegroundColorAttributeName]; [styleColor set]; - UIFont *theFont = [UIFont fontWithName:style.fontName size:style.fontSize]; + UIFont *theFont = self.font; + if ( theFont == nil ) { + theFont = [UIFont fontWithName:style.fontName size:style.fontSize]; + } [self drawInRect:rect withFont:theFont lineBreakMode:style.lineBreakMode alignment:(NSTextAlignment)style.textAlignment]; +#endif #endif CGContextRestoreGState(context); diff --git a/framework/xcconfig/CorePlot.xcconfig b/framework/xcconfig/CorePlot.xcconfig index 44cbeb3c3..e7f5cc5f7 100644 --- a/framework/xcconfig/CorePlot.xcconfig +++ b/framework/xcconfig/CorePlot.xcconfig @@ -1,25 +1,36 @@ #include "CorePlotWarnings.xcconfig" ARCHS = $(ARCHS_STANDARD) -VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s +VALID_ARCHS[sdk=iphoneos*] = arm64 arm64e armv7 armv7s VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64 -VALID_ARCHS[sdk=macosx*] = i386 x86_64 +VALID_ARCHS[sdk=macosx*] = i386 x86_64 arm64 +VALID_ARCHS[sdk=appletvos*] = arm64 +VALID_ARCHS[sdk=appletvsimulator*] = i386 x86_64 + +IPHONEOS_DEPLOYMENT_TARGET = 8.0 +MACOSX_DEPLOYMENT_TARGET = 10.8 +TVOS_DEPLOYMENT_TARGET = 9.0 SYMROOT = $(PROJECT_DIR)/../build -DEBUG_INFORMATION_FORMAT = dwarf-with-dsym + +ALWAYS_SEARCH_USER_PATHS = NO +CLANG_ENABLE_OBJC_ARC = YES +CLANG_STATIC_ANALYZER_MODE = shallow +CLANG_STATIC_ANALYZER_MODE_ON_ANALYZE_ACTION = deep COMBINE_HIDPI_IMAGES = YES COPY_PHASE_STRIP = YES -STRIP_STYLE = debugging -SEPARATE_STRIP = YES -SKIP_INSTALL = YES +DEAD_CODE_STRIPPING = YES +DEBUG_INFORMATION_FORMAT = dwarf-with-dsym GCC_C_LANGUAGE_STANDARD = c99 GCC_DYNAMIC_NO_PIC = NO GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_PREFIX_HEADER = CorePlot_Prefix.pch -DEAD_CODE_STRIPPING = YES -CLANG_ENABLE_OBJC_ARC = YES LINKER_DISPLAYS_MANGLED_NAMES = NO -RUN_CLANG_STATIC_ANALYZER = YES -CLANG_STATIC_ANALYZER_MODE_ON_ANALYZE_ACTION = deep -CLANG_STATIC_ANALYZER_MODE = shallow OTHER_LDFLAGS = -ObjC +RUN_CLANG_STATIC_ANALYZER = YES +SEPARATE_STRIP = YES +SKIP_INSTALL = YES +STRIP_STYLE = debugging +STRIP_SWIFT_SYMBOLS = YES +SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule" +USE_HEADERMAP = NO diff --git a/framework/xcconfig/CorePlotDebug.xcconfig b/framework/xcconfig/CorePlotDebug.xcconfig index 3f9fd3ea8..b4bcbc7e7 100644 --- a/framework/xcconfig/CorePlotDebug.xcconfig +++ b/framework/xcconfig/CorePlotDebug.xcconfig @@ -5,3 +5,6 @@ VALIDATE_PRODUCT = NO DEPLOYMENT_POSTPROCESSING = NO STRIP_INSTALLED_PRODUCT = NO GCC_OPTIMIZATION_LEVEL = 0 +GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) +ENABLE_NS_ASSERTIONS = YES +COPY_PHASE_STRIP = NO diff --git a/framework/xcconfig/CorePlotRelease.xcconfig b/framework/xcconfig/CorePlotRelease.xcconfig index 37ae757b0..8d9600513 100644 --- a/framework/xcconfig/CorePlotRelease.xcconfig +++ b/framework/xcconfig/CorePlotRelease.xcconfig @@ -5,3 +5,5 @@ VALIDATE_PRODUCT = YES DEPLOYMENT_POSTPROCESSING = YES STRIP_INSTALLED_PRODUCT = YES GCC_OPTIMIZATION_LEVEL = s +ENABLE_NS_ASSERTIONS = NO +COPY_PHASE_STRIP = YES diff --git a/framework/xcconfig/CorePlotWarnings.xcconfig b/framework/xcconfig/CorePlotWarnings.xcconfig index 599c13467..8c11ec296 100644 --- a/framework/xcconfig/CorePlotWarnings.xcconfig +++ b/framework/xcconfig/CorePlotWarnings.xcconfig @@ -1,74 +1,103 @@ -GCC_TREAT_WARNINGS_AS_ERRORS = YES -GCC_WARN_CHECK_SWITCH_STATEMENTS = YES -CLANG_WARN_DOCUMENTATION_COMMENTS = YES -GCC_WARN_SHADOW = YES -GCC_WARN_64_TO_32_BIT_CONVERSION = YES -CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES -GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES -GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES -GCC_WARN_ABOUT_RETURN_TYPE = YES -GCC_WARN_MISSING_PARENTHESES = YES -GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES -GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES -GCC_WARN_ABOUT_MISSING_NEWLINE = YES -GCC_WARN_SIGN_COMPARE = YES -CLANG_WARN_EMPTY_BODY = YES -CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES -GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE -GCC_WARN_UNUSED_FUNCTION = YES -GCC_WARN_UNUSED_LABEL = YES -GCC_WARN_UNUSED_VALUE = YES -GCC_WARN_UNUSED_VARIABLE = YES -CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE -GCC_WARN_UNUSED_PARAMETER = YES -GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES -CLANG_WARN_ASSIGN_ENUM = YES -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES -CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES -GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO -CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES -GCC_WARN_UNDECLARED_SELECTOR = YES -CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES -CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES -CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES -CLANG_WARN_OBJC_RECEIVER_WEAK = YES -GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES -GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES -CLANG_WARN_BOOL_CONVERSION = YES -CLANG_WARN_CONSTANT_CONVERSION = YES -CLANG_WARN_ENUM_CONVERSION = YES -CLANG_WARN_INT_CONVERSION = YES -CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION = YES -GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES -GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES -GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES -GCC_WARN_UNKNOWN_PRAGMAS = YES -CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES -CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO -GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES -GCC_WARN_STRICT_SELECTOR_MATCH = NO -CLANG_WARN_OBJC_ROOT_CLASS = YES -CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES - -ENABLE_STRICT_OBJC_MSGSEND = YES +ASSETCATALOG_WARNINGS = YES CLANG_ANALYZER_DEADCODE_DEADSTORES = YES -CLANG_ANALYZER_MEMORY_MANAGEMENT = YES CLANG_ANALYZER_GCD = YES +CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES +CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES +CLANG_ANALYZER_MEMORY_MANAGEMENT = YES +CLANG_ANALYZER_NONNULL = YES CLANG_ANALYZER_OBJC_ATSYNC = YES -CLANG_ANALYZER_OBJC_NSCFERROR = YES -CLANG_ANALYZER_OBJC_INCOMP_METHOD_TYPES = YES CLANG_ANALYZER_OBJC_COLLECTIONS = YES -CLANG_ANALYZER_OBJC_UNUSED_IVARS = YES -CLANG_ANALYZER_OBJC_SELF_INIT = YES +CLANG_ANALYZER_OBJC_DEALLOC = YES +CLANG_ANALYZER_OBJC_GENERICS = YES +CLANG_ANALYZER_OBJC_INCOMP_METHOD_TYPES = YES +CLANG_ANALYZER_OBJC_NSCFERROR = YES CLANG_ANALYZER_OBJC_RETAIN_COUNT = YES +CLANG_ANALYZER_OBJC_SELF_INIT = YES +CLANG_ANALYZER_OBJC_UNUSED_IVARS = YES CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES -CLANG_ANALYZER_SECURITY_KEYCHAIN_API = YES -CLANG_ANALYZER_SECURITY_INSECUREAPI_UNCHECKEDRETURN = YES CLANG_ANALYZER_SECURITY_INSECUREAPI_GETPW_GETS = YES CLANG_ANALYZER_SECURITY_INSECUREAPI_MKSTEMP = YES CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES +CLANG_ANALYZER_SECURITY_INSECUREAPI_UNCHECKEDRETURN = YES CLANG_ANALYZER_SECURITY_INSECUREAPI_VFORK = YES +CLANG_ANALYZER_SECURITY_KEYCHAIN_API = YES + +CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_ASSIGN_ENUM = YES +CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES +CLANG_WARN_BOOL_CONVERSION = YES +CLANG_WARN_COMMA = YES +CLANG_WARN_CONSTANT_CONVERSION = YES +CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES +CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES +CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES +CLANG_WARN_DOCUMENTATION_COMMENTS = YES +CLANG_WARN_EMPTY_BODY = YES +CLANG_WARN_ENUM_CONVERSION = YES +CLANG_WARN_FLOAT_CONVERSION = YES +CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES +CLANG_WARN_INFINITE_RECURSION = YES +CLANG_WARN_INT_CONVERSION = YES +CLANG_WARN_MISSING_NOESCAPE = YES +CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES +CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION = YES +CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES +CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +CLANG_WARN_OBJC_INTERFACE_IVARS = YES +CLANG_WARN_OBJC_LITERAL_CONVERSION = YES +CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES +CLANG_WARN_OBJC_RECEIVER_WEAK = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_ROOT_CLASS = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_PRIVATE_MODULE = YES +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CLANG_WARN_RANGE_LOOP_ANALYSIS = YES +CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY =YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES +CLANG_WARN_SUSPICIOUS_MOVE = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE + +ENABLE_STRICT_OBJC_MSGSEND = YES + +GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES +GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES +GCC_TREAT_WARNINGS_AS_ERRORS = YES + +GCC_WARN_64_TO_32_BIT_CONVERSION = YES +GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES +GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES +GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES +GCC_WARN_ABOUT_MISSING_NEWLINE = YES +GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES +GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES +GCC_WARN_ABOUT_RETURN_TYPE = YES +GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES +GCC_WARN_CHECK_SWITCH_STATEMENTS = YES +GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES +GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES +GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES +GCC_WARN_MISSING_PARENTHESES = YES +GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO +GCC_WARN_SHADOW = YES +GCC_WARN_SIGN_COMPARE = YES +GCC_WARN_STRICT_SELECTOR_MATCH = NO +GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES +GCC_WARN_UNDECLARED_SELECTOR = YES +GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE +GCC_WARN_UNKNOWN_PRAGMAS = YES +GCC_WARN_UNUSED_FUNCTION = YES +GCC_WARN_UNUSED_LABEL = YES +GCC_WARN_UNUSED_PARAMETER = YES +GCC_WARN_UNUSED_VALUE = YES +GCC_WARN_UNUSED_VARIABLE = YES + +IBC_WARNINGS = YES -OTHER_CFLAGS = -Weverything -Wno-unused-parameter -Wno-undef -Wno-switch-enum -Wno-float-equal -Wno-padded -Wno-dollar-in-identifier-extension -Wno-custom-atomic-properties -Wno-gnu -Wno-assign-enum -Wno-pedantic -Wno-documentation -Wno-unknown-warning-option -Wno-cstring-format-directive -Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-incompatible-pointer-types-discards-qualifiers -Wno-partial-availability +WARNING_CFLAGS = -Weverything -Wno-undef -Wno-switch-enum -Wno-float-equal -Wno-custom-atomic-properties -Wno-pedantic -Wno-documentation -Wno-documentation-unknown-command -Wno-partial-availability -Wno-objc-messaging-id diff --git a/scripts/README Creating a release package.md b/scripts/README Creating a release package.md index 2ed55f5dd..bcfb6724c 100644 --- a/scripts/README Creating a release package.md +++ b/scripts/README Creating a release package.md @@ -5,8 +5,8 @@ Follow these steps to create a Core Plot release and post it to GitHub: 1. Ensure the following tools are installed on your development machine:
    -
  • Xcode 7
  • -
  • [Doxygen](http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc), version 1.8.10 or later, installed in /Applications
  • +
  • Xcode 11
  • +
  • [Doxygen](http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc), version 1.8.12 or later, installed in /Applications
  • [Graphviz](http://www.graphviz.org/Download_macos.php), version 2.36.0 or later
@@ -39,6 +39,7 @@ Follow these steps to create a Core Plot release and post it to GitHub:
  • Binaries/iOS/
  • Binaries/MacOS/
  • +
  • Binaries/tvOS/
  • Documentation/
  • READMEs/
  • Source/
  • @@ -98,5 +99,4 @@ Follow these steps to create a Core Plot release and post it to GitHub:
    • The Core Plot [discussion board](https://groups.google.com/forum/#!forum/coreplot-discuss)
    • [Twitter](https://twitter.com/CorePlot)
    • -
    • [App.net](https://alpha.app.net/coreplot)
    diff --git a/scripts/createrelease.py b/scripts/createrelease.py index 5e76c5ee2..9375881c2 100644 --- a/scripts/createrelease.py +++ b/scripts/createrelease.py @@ -58,8 +58,10 @@ def RunXcode(project, target): binariesDir = join(releaseRootDir, 'Binaries') macosDir = join(binariesDir, 'MacOS') iosDir = join(binariesDir, 'iOS') +tvosDir = join(binariesDir, 'tvOS') makedirs(macosDir) mkdir(iosDir) +mkdir(tvosDir) # Build Mac Framework chdir('framework') @@ -81,6 +83,12 @@ def RunXcode(project, target): iOSHeaderFile = join(join(projectRoot, 'build/Release-universal'), 'CorePlotHeaders') copytree(iOSHeaderFile, join(iosDir, 'CorePlotHeaders')) +# Build tvOS Framework +RunXcode('CorePlot.xcodeproj', 'Universal tvOS Framework') +tvOSProductsDir = join(projectRoot, 'build/Release-appletvuniversal') +tvOSFramework = join(tvOSProductsDir, 'CorePlot.framework') +copytree(tvOSFramework, join(tvosDir, 'CorePlot.framework'), symlinks=True) + # Build Docs RunXcode('CorePlot.xcodeproj', 'Documentation-Mac') RunXcode('CorePlot.xcodeproj', 'Documentation-iOS') @@ -88,7 +96,3 @@ def RunXcode(project, target): # Copy Docs docDir = join(releaseRootDir, 'Documentation') copytree(join(projectRoot, 'documentation'), docDir, ignore=ignore_patterns('*.orig','*.git')) -homeDir = environ['HOME'] -docsetsDir = join(homeDir, 'Library/Developer/Shared/Documentation/DocSets') -copytree(join(docsetsDir, 'com.CorePlot.Framework.docset'), join(docDir, 'com.CorePlot.Framework.docset')) -copytree(join(docsetsDir, 'com.CorePlotTouch.Framework.docset'), join(docDir, 'com.CorePlotTouch.Framework.docset')) diff --git a/scripts/uncrustify.cfg b/scripts/uncrustify.cfg index af6a1fc0b..adf13c0dd 100644 --- a/scripts/uncrustify.cfg +++ b/scripts/uncrustify.cfg @@ -1,507 +1,713 @@ -# Uncrustify 0.62 -newlines = auto -input_tab_size = 4 -output_tab_size = 4 -string_escape_char = 92 -string_escape_char2 = 0 -string_replace_tab_chars = false -tok_split_gte = false -disable_processing_cmt = "" -enable_processing_cmt = "" -enable_digraphs = false -utf8_bom = remove -utf8_byte = false -utf8_force = false -indent_columns = 4 -indent_continue = 0 -indent_with_tabs = 0 -indent_cmt_with_tabs = false -indent_align_string = true -indent_xml_string = 4 -indent_brace = 0 -indent_braces = false -indent_braces_no_func = false -indent_braces_no_class = false -indent_braces_no_struct = false -indent_brace_parent = false -indent_paren_open_brace = false -indent_namespace = false -indent_namespace_single_indent = false -indent_namespace_level = 0 -indent_namespace_limit = 0 -indent_extern = false -indent_class = true -indent_class_colon = false -indent_class_on_colon = false -indent_constr_colon = false -indent_ctor_init_leading = 2 -indent_ctor_init = 0 -indent_else_if = false -indent_var_def_blk = 0 -indent_var_def_cont = false -indent_shift = false -indent_func_def_force_col1 = false -indent_func_call_param = false -indent_func_def_param = false -indent_func_proto_param = false -indent_func_class_param = false -indent_func_ctor_var_param = false -indent_template_param = false -indent_func_param_double = false -indent_func_const = 1 -indent_func_throw = 1 -indent_member = 1 -indent_sing_line_comments = 0 -indent_relative_single_line_comments = true -indent_switch_case = 4 -indent_case_shift = 0 -indent_case_brace = 0 -indent_col1_comment = false -indent_label = 1 -indent_access_spec = 1 -indent_access_spec_body = false -indent_paren_nl = false -indent_paren_close = 1 -indent_comma_paren = false -indent_bool_paren = false -indent_first_bool_expr = false -indent_square_nl = false -indent_preserve_sql = true -indent_align_assign = true -indent_oc_block = true -indent_oc_block_msg = 0 -indent_oc_msg_colon = 0 -indent_oc_msg_prioritize_first_colon = true -indent_oc_block_msg_xcode_style = false -indent_oc_block_msg_from_keyword = false -indent_oc_block_msg_from_colon = false -indent_oc_block_msg_from_caret = false -indent_oc_block_msg_from_brace = false -indent_min_vbrace_open = 0 -indent_vbrace_open_on_tabstop = false -sp_arith = force -sp_assign = force -sp_cpp_lambda_assign = ignore -sp_cpp_lambda_paren = ignore -sp_assign_default = force -sp_before_assign = ignore -sp_after_assign = ignore -sp_enum_paren = force -sp_enum_assign = force -sp_enum_before_assign = ignore -sp_enum_after_assign = ignore -sp_pp_concat = force -sp_pp_stringify = remove -sp_before_pp_stringify = ignore -sp_bool = force -sp_compare = force -sp_inside_paren = remove -sp_paren_paren = remove -sp_cparen_oparen = remove -sp_balance_nested_parens = true -sp_paren_brace = force -sp_before_ptr_star = force -sp_before_unnamed_ptr_star = force -sp_between_ptr_star = remove -sp_after_ptr_star = remove -sp_after_ptr_star_qualifier = remove -sp_after_ptr_star_func = remove -sp_ptr_star_paren = remove -sp_before_ptr_star_func = force -sp_before_byref = force -sp_before_unnamed_byref = force -sp_after_byref = remove -sp_after_byref_func = remove -sp_before_byref_func = force -sp_after_type = force -sp_before_template_paren = ignore -sp_template_angle = force -sp_before_angle = remove -sp_inside_angle = remove -sp_after_angle = remove -sp_angle_paren = remove -sp_angle_word = force -sp_angle_shift = add -sp_permit_cpp11_shift = false -sp_before_sparen = force -sp_inside_sparen = force -sp_inside_sparen_close = ignore -sp_inside_sparen_open = ignore -sp_after_sparen = force -sp_sparen_brace = force -sp_invariant_paren = ignore -sp_after_invariant_paren = ignore -sp_special_semi = force -sp_before_semi = remove -sp_before_semi_for = remove -sp_before_semi_for_empty = remove -sp_after_semi = force -sp_after_semi_for = force -sp_after_semi_for_empty = force -sp_before_square = remove -sp_before_squares = remove -sp_inside_square = remove -sp_after_comma = force -sp_before_comma = remove -sp_after_mdatype_commas = remove -sp_before_mdatype_commas = remove -sp_between_mdatype_commas = remove -sp_paren_comma = force -sp_before_ellipsis = remove -sp_after_class_colon = force -sp_before_class_colon = force -sp_after_constr_colon = remove -sp_before_constr_colon = remove -sp_before_case_colon = remove -sp_after_operator = remove -sp_after_operator_sym = force -sp_after_cast = remove -sp_inside_paren_cast = remove -sp_cpp_cast_paren = remove -sp_sizeof_paren = remove -sp_after_tag = ignore -sp_inside_braces_enum = remove -sp_inside_braces_struct = remove -sp_inside_braces = force -sp_inside_braces_empty = remove -sp_type_func = force -sp_func_proto_paren = remove -sp_func_def_paren = remove -sp_inside_fparens = remove -sp_inside_fparen = remove -sp_inside_tparen = remove -sp_after_tparen_close = remove -sp_square_fparen = remove -sp_fparen_brace = force -sp_fparen_dbrace = ignore -sp_func_call_paren = remove -sp_func_call_paren_empty = ignore -sp_func_call_user_paren = remove -sp_func_class_paren = remove -sp_return_paren = force -sp_attribute_paren = remove -sp_defined_paren = remove -sp_throw_paren = force -sp_after_throw = force -sp_catch_paren = force -sp_version_paren = ignore -sp_scope_paren = ignore -sp_macro = force -sp_macro_func = force -sp_else_brace = force -sp_brace_else = force -sp_brace_typedef = force -sp_catch_brace = force -sp_brace_catch = force -sp_finally_brace = force -sp_brace_finally = force -sp_try_brace = force -sp_getset_brace = force -sp_word_brace = add -sp_word_brace_ns = add -sp_before_dc = remove -sp_after_dc = remove -sp_d_array_colon = remove -sp_not = remove -sp_inv = remove -sp_addr = remove -sp_member = remove -sp_deref = remove -sp_sign = remove -sp_incdec = remove -sp_before_nl_cont = force -sp_after_oc_scope = remove -sp_after_oc_colon = remove -sp_before_oc_colon = remove -sp_after_oc_dict_colon = force -sp_before_oc_dict_colon = remove -sp_after_send_oc_colon = remove -sp_before_send_oc_colon = remove -sp_after_oc_type = remove -sp_after_oc_return_type = remove -sp_after_oc_at_sel = remove -sp_after_oc_at_sel_parens = force -sp_inside_oc_at_sel_parens = remove -sp_before_oc_block_caret = force -sp_after_oc_block_caret = remove -sp_after_oc_msg_receiver = force -sp_after_oc_property = force -sp_cond_colon = force -sp_cond_colon_before = ignore -sp_cond_colon_after = ignore -sp_cond_question = force -sp_cond_question_before = ignore -sp_cond_question_after = ignore -sp_cond_ternary_short = ignore -sp_case_label = force -sp_range = ignore -sp_after_for_colon = ignore -sp_before_for_colon = ignore -sp_extern_paren = remove -sp_cmt_cpp_start = force -sp_cmt_cpp_doxygen = true -sp_cmt_cpp_qttr = false -sp_endif_cmt = force -sp_after_new = force -sp_between_new_paren = ignore -sp_before_tr_emb_cmt = force -sp_num_before_tr_emb_cmt = 1 -sp_annotation_paren = ignore -align_keep_tabs = false -align_with_tabs = false -align_on_tabstop = false -align_number_left = false -align_keep_extra_space = false -align_func_params = true -align_same_func_call_params = false -align_var_def_span = 0 -align_var_def_star_style = 1 -align_var_def_amp_style = 1 -align_var_def_thresh = 0 -align_var_def_gap = 0 -align_var_def_colon = true -align_var_def_attribute = true -align_var_def_inline = true -align_assign_span = 1 -align_assign_thresh = 0 -align_enum_equ_span = 1 -align_enum_equ_thresh = 0 -align_var_struct_span = 1 -align_var_struct_thresh = 0 -align_var_struct_gap = 1 -align_struct_init_span = 2 -align_typedef_gap = 1 -align_typedef_span = 2 -align_typedef_func = 0 -align_typedef_star_style = 1 -align_typedef_amp_style = 1 -align_right_cmt_span = 2 -align_right_cmt_mix = false -align_right_cmt_gap = 1 -align_right_cmt_at_col = 1 -align_func_proto_span = 2 -align_func_proto_gap = 1 -align_on_operator = true -align_mix_var_proto = true -align_single_line_func = true -align_single_line_brace = true -align_single_line_brace_gap = 1 -align_oc_msg_spec_span = 0 -align_nl_cont = false -align_pp_define_together = false -align_pp_define_gap = 1 -align_pp_define_span = 2 -align_left_shift = true -align_oc_msg_colon_span = 16 -align_oc_msg_colon_first = false -align_oc_decl_colon = true -nl_collapse_empty_body = false -nl_assign_leave_one_liners = true -nl_class_leave_one_liners = false -nl_enum_leave_one_liners = true -nl_getset_leave_one_liners = false -nl_func_leave_one_liners = true -nl_cpp_lambda_leave_one_liners = false -nl_if_leave_one_liners = false -nl_while_leave_one_liners = false -nl_oc_msg_leave_one_liner = false -nl_start_of_file = remove -nl_start_of_file_min = 0 -nl_end_of_file = force -nl_end_of_file_min = 1 -nl_assign_brace = remove -nl_assign_square = ignore -nl_after_square_assign = ignore -nl_func_var_def_blk = 1 -nl_typedef_blk_start = 0 -nl_typedef_blk_end = 0 -nl_typedef_blk_in = 0 -nl_var_def_blk_start = 0 -nl_var_def_blk_end = 0 -nl_var_def_blk_in = 0 -nl_fcall_brace = force -nl_enum_brace = remove -nl_struct_brace = remove -nl_union_brace = remove -nl_if_brace = remove -nl_brace_else = force -nl_elseif_brace = remove -nl_else_brace = remove -nl_else_if = remove -nl_brace_finally = force -nl_finally_brace = remove -nl_try_brace = remove -nl_getset_brace = force -nl_for_brace = remove -nl_catch_brace = remove -nl_brace_catch = force -nl_brace_square = ignore -nl_brace_fparen = ignore -nl_while_brace = remove -nl_scope_brace = ignore -nl_unittest_brace = ignore -nl_version_brace = ignore -nl_using_brace = ignore -nl_brace_brace = force -nl_do_brace = remove -nl_brace_while = force -nl_switch_brace = remove -nl_synchronized_brace = remove -nl_multi_line_cond = false -nl_multi_line_define = false -nl_before_case = true -nl_before_throw = force -nl_after_case = true -nl_case_colon_brace = force -nl_namespace_brace = force -nl_template_class = force -nl_class_brace = force -nl_class_init_args = force -nl_constr_init_args = ignore -nl_func_type_name = remove -nl_func_type_name_class = ignore -nl_func_scope_name = remove -nl_func_proto_type_name = remove -nl_func_paren = remove -nl_func_def_paren = remove -nl_func_decl_start = remove -nl_func_def_start = remove -nl_func_decl_start_single = ignore -nl_func_def_start_single = ignore -nl_func_decl_args = ignore -nl_func_def_args = ignore -nl_func_decl_end = remove -nl_func_def_end = remove -nl_func_decl_end_single = ignore -nl_func_def_end_single = ignore -nl_func_decl_empty = remove -nl_func_def_empty = remove -nl_oc_msg_args = false -nl_fdef_brace = force -nl_cpp_ldef_brace = ignore -nl_return_expr = remove -nl_after_semicolon = true -nl_paren_dbrace_open = ignore -nl_after_brace_open = true -nl_after_brace_open_cmt = false -nl_after_vbrace_open = true -nl_after_vbrace_open_empty = false -nl_after_brace_close = false -nl_after_vbrace_close = false -nl_brace_struct_var = force -nl_define_macro = false -nl_squeeze_ifdef = true -nl_before_if = ignore -nl_after_if = ignore -nl_before_for = ignore -nl_after_for = ignore -nl_before_while = ignore -nl_after_while = ignore -nl_before_switch = ignore -nl_after_switch = ignore -nl_before_synchronized = ignore -nl_after_synchronized = ignore -nl_before_do = ignore -nl_after_do = ignore -nl_ds_struct_enum_cmt = false -nl_ds_struct_enum_close_brace = false -nl_class_colon = remove -nl_constr_colon = ignore -nl_create_if_one_liner = true -nl_create_for_one_liner = false -nl_create_while_one_liner = false -pos_arith = trail -pos_assign = trail -pos_bool = trail -pos_compare = trail -pos_conditional = trail -pos_comma = trail -pos_class_comma = trail -pos_constr_comma = ignore -pos_class_colon = trail -pos_constr_colon = ignore -code_width = 0 -ls_for_split_full = true -ls_func_split_full = true -ls_code_width = false -nl_max = 2 -nl_after_func_proto = 1 -nl_after_func_proto_group = 2 -nl_after_func_body = 2 -nl_after_func_body_class = 0 -nl_after_func_body_one_liner = 1 -nl_before_block_comment = 2 -nl_before_c_comment = 2 -nl_before_cpp_comment = 1 -nl_after_multiline_comment = false -nl_after_label_colon = false -nl_after_struct = 0 -nl_after_class = 0 -nl_before_access_spec = 2 -nl_after_access_spec = 1 -nl_comment_func_def = 1 -nl_after_try_catch_finally = 1 -nl_around_cs_property = 1 -nl_between_get_set = 1 -nl_property_brace = ignore -eat_blanks_after_open_brace = true -eat_blanks_before_close_brace = true -nl_remove_extra_newlines = 0 -nl_before_return = false -nl_after_return = true -nl_after_annotation = ignore -nl_between_annotation = ignore -mod_full_brace_do = force -mod_full_brace_for = force -mod_full_brace_function = force -mod_full_brace_if = force -mod_full_brace_if_chain = false -mod_full_brace_nl = 1 -mod_full_brace_while = force -mod_full_brace_using = ignore -mod_paren_on_return = remove -mod_pawn_semicolon = true -mod_full_paren_if_bool = true -mod_remove_extra_semicolon = true -mod_add_long_function_closebrace_comment = 0 +# Uncrustify_d-0.70.1 +newlines = auto +input_tab_size = 4 +output_tab_size = 4 +string_escape_char = 92 +string_escape_char2 = 0 +string_replace_tab_chars = false +tok_split_gte = false +disable_processing_cmt = "" +enable_processing_cmt = "" +enable_digraphs = false +utf8_bom = remove +utf8_byte = false +utf8_force = false +sp_do_brace_open = ignore +sp_brace_close_while = ignore +sp_while_paren_open = ignore +sp_arith = force +sp_arith_additive = ignore +sp_assign = force +sp_cpp_lambda_assign = ignore +sp_cpp_lambda_square_paren = ignore +sp_cpp_lambda_square_brace = ignore +sp_cpp_lambda_paren_brace = ignore +sp_cpp_lambda_fparen = ignore +sp_assign_default = force +sp_before_assign = ignore +sp_after_assign = ignore +sp_enum_paren = force +sp_enum_assign = force +sp_enum_before_assign = ignore +sp_enum_after_assign = ignore +sp_enum_colon = ignore +sp_pp_concat = force +sp_pp_stringify = remove +sp_before_pp_stringify = ignore +sp_bool = force +sp_compare = force +sp_inside_paren = remove +sp_paren_paren = remove +sp_cparen_oparen = remove +sp_balance_nested_parens = false +sp_paren_brace = force +sp_brace_brace = force +sp_before_ptr_star = force +sp_before_unnamed_ptr_star = force +sp_between_ptr_star = remove +sp_after_ptr_star = remove +sp_after_ptr_block_caret = remove +sp_after_ptr_star_qualifier = remove +sp_after_ptr_star_func = remove +sp_ptr_star_paren = remove +sp_before_ptr_star_func = force +sp_before_byref = force +sp_before_unnamed_byref = force +sp_after_byref = remove +sp_after_byref_func = remove +sp_before_byref_func = force +sp_after_type = force +sp_after_decltype = ignore +sp_before_template_paren = ignore +sp_template_angle = force +sp_before_angle = remove +sp_inside_angle = remove +sp_inside_angle_empty = remove +sp_angle_colon = ignore +sp_after_angle = remove +sp_angle_paren = remove +sp_angle_paren_empty = remove +sp_angle_word = force +sp_angle_shift = add +sp_permit_cpp11_shift = false +sp_before_sparen = force +sp_inside_sparen = force +sp_inside_sparen_open = ignore +sp_inside_sparen_close = ignore +sp_after_sparen = force +sp_sparen_brace = force +sp_invariant_paren = ignore +sp_after_invariant_paren = ignore +sp_special_semi = force +sp_before_semi = remove +sp_before_semi_for = remove +sp_before_semi_for_empty = remove +sp_after_semi = force +sp_after_semi_for = force +sp_after_semi_for_empty = force +sp_before_square = remove +sp_before_vardef_square = remove +sp_before_square_asm_block = ignore +sp_before_squares = remove +sp_cpp_before_struct_binding = remove +sp_inside_square = remove +sp_inside_square_oc_array = remove +sp_after_comma = force +sp_before_comma = remove +sp_after_mdatype_commas = remove +sp_before_mdatype_commas = remove +sp_between_mdatype_commas = remove +sp_paren_comma = force +sp_before_ellipsis = remove +sp_type_ellipsis = remove +sp_type_question = remove +sp_paren_ellipsis = remove +sp_paren_qualifier = remove +sp_paren_noexcept = remove +sp_after_class_colon = force +sp_before_class_colon = force +sp_after_constr_colon = remove +sp_before_constr_colon = remove +sp_before_case_colon = remove +sp_after_operator = remove +sp_after_operator_sym = force +sp_after_operator_sym_empty = ignore +sp_after_cast = remove +sp_inside_paren_cast = remove +sp_cpp_cast_paren = remove +sp_sizeof_paren = remove +sp_sizeof_ellipsis = remove +sp_sizeof_ellipsis_paren = remove +sp_decltype_paren = remove +sp_after_tag = remove +sp_inside_braces_enum = remove +sp_inside_braces_struct = remove +sp_inside_braces_oc_dict = force +sp_after_type_brace_init_lst_open = ignore +sp_before_type_brace_init_lst_close = ignore +sp_inside_type_brace_init_lst = ignore +sp_inside_braces = force +sp_inside_braces_empty = remove +sp_trailing_return = remove +sp_type_func = force +sp_type_brace_init_lst = ignore +sp_func_proto_paren = remove +sp_func_proto_paren_empty = remove +sp_func_type_paren = remove +sp_func_def_paren = remove +sp_func_def_paren_empty = remove +sp_inside_fparens = remove +sp_inside_fparen = remove +sp_inside_tparen = remove +sp_after_tparen_close = remove +sp_square_fparen = remove +sp_fparen_brace = force +sp_fparen_brace_initializer = force +sp_fparen_dbrace = force +sp_func_call_paren = remove +sp_func_call_paren_empty = remove +sp_func_call_user_paren = remove +sp_func_call_user_inside_fparen = remove +sp_func_call_user_paren_paren = remove +sp_func_class_paren = remove +sp_func_class_paren_empty = remove +sp_return_paren = force +sp_return_brace = force +sp_attribute_paren = remove +sp_defined_paren = remove +sp_throw_paren = force +sp_after_throw = force +sp_catch_paren = force +sp_oc_catch_paren = force +sp_oc_classname_paren = force +sp_version_paren = ignore +sp_scope_paren = ignore +sp_super_paren = remove +sp_this_paren = remove +sp_macro = force +sp_macro_func = force +sp_else_brace = force +sp_brace_else = force +sp_brace_typedef = force +sp_catch_brace = force +sp_oc_catch_brace = force +sp_brace_catch = force +sp_oc_brace_catch = force +sp_finally_brace = force +sp_brace_finally = force +sp_try_brace = force +sp_getset_brace = force +sp_word_brace = add +sp_word_brace_ns = add +sp_before_dc = remove +sp_after_dc = remove +sp_d_array_colon = remove +sp_not = remove +sp_inv = remove +sp_addr = remove +sp_member = remove +sp_deref = remove +sp_sign = remove +sp_incdec = remove +sp_before_nl_cont = force +sp_after_oc_scope = remove +sp_after_oc_colon = remove +sp_before_oc_colon = remove +sp_after_oc_dict_colon = force +sp_before_oc_dict_colon = remove +sp_after_send_oc_colon = remove +sp_before_send_oc_colon = remove +sp_after_oc_type = remove +sp_after_oc_return_type = remove +sp_after_oc_at_sel = remove +sp_after_oc_at_sel_parens = force +sp_inside_oc_at_sel_parens = remove +sp_before_oc_block_caret = force +sp_after_oc_block_caret = remove +sp_after_oc_msg_receiver = force +sp_after_oc_property = force +sp_after_oc_synchronized = force +sp_cond_colon = force +sp_cond_colon_before = ignore +sp_cond_colon_after = ignore +sp_cond_question = force +sp_cond_question_before = ignore +sp_cond_question_after = ignore +sp_cond_ternary_short = ignore +sp_case_label = force +sp_range = ignore +sp_after_for_colon = ignore +sp_before_for_colon = ignore +sp_extern_paren = remove +sp_cmt_cpp_start = force +sp_cmt_cpp_doxygen = true +sp_cmt_cpp_qttr = false +sp_endif_cmt = force +sp_after_new = force +sp_between_new_paren = ignore +sp_after_newop_paren = ignore +sp_inside_newop_paren = ignore +sp_inside_newop_paren_open = ignore +sp_inside_newop_paren_close = ignore +sp_before_tr_emb_cmt = force +sp_num_before_tr_emb_cmt = 1 +sp_annotation_paren = ignore +sp_skip_vbrace_tokens = false +sp_after_noexcept = ignore +sp_vala_after_translation = ignore +force_tab_after_define = false +indent_columns = 4 +indent_continue = 0 +indent_continue_class_head = 0 +indent_single_newlines = false +indent_param = 0 +indent_with_tabs = 0 +indent_cmt_with_tabs = false +indent_align_string = true +indent_xml_string = 4 +indent_brace = 0 +indent_braces = false +indent_braces_no_func = false +indent_braces_no_class = false +indent_braces_no_struct = false +indent_brace_parent = false +indent_paren_open_brace = false +indent_cs_delegate_brace = false +indent_cs_delegate_body = false +indent_namespace = false +indent_namespace_single_indent = false +indent_namespace_level = 0 +indent_namespace_limit = 0 +indent_extern = false +indent_class = true +indent_class_colon = false +indent_class_on_colon = false +indent_constr_colon = false +indent_ctor_init_leading = 2 +indent_ctor_init = 0 +indent_else_if = false +indent_var_def_blk = 0 +indent_var_def_cont = false +indent_shift = false +indent_func_def_force_col1 = false +indent_func_call_param = false +indent_func_def_param = false +indent_func_def_param_paren_pos_threshold = 0 +indent_func_proto_param = false +indent_func_class_param = false +indent_func_ctor_var_param = false +indent_template_param = false +indent_func_param_double = false +indent_func_const = 1 +indent_func_throw = 1 +indent_macro_brace = true +indent_member = 1 +indent_member_single = false +indent_sing_line_comments = 0 +indent_relative_single_line_comments = true +indent_switch_case = 4 +indent_switch_break_with_case = false +indent_switch_pp = true +indent_case_shift = 0 +indent_case_brace = 0 +indent_col1_comment = false +indent_col1_multi_string_literal = false +indent_label = 1 +indent_access_spec = 1 +indent_access_spec_body = false +indent_paren_nl = false +indent_paren_close = 1 +indent_paren_after_func_def = false +indent_paren_after_func_decl = false +indent_paren_after_func_call = false +indent_comma_paren = false +indent_bool_paren = false +indent_semicolon_for_paren = false +indent_first_bool_expr = false +indent_first_for_expr = false +indent_square_nl = false +indent_preserve_sql = true +indent_align_assign = true +indent_align_paren = true +indent_oc_block = true +indent_oc_block_msg = 0 +indent_oc_msg_colon = 0 +indent_oc_msg_prioritize_first_colon = true +indent_oc_block_msg_xcode_style = false +indent_oc_block_msg_from_keyword = false +indent_oc_block_msg_from_colon = false +indent_oc_block_msg_from_caret = false +indent_oc_block_msg_from_brace = false +indent_min_vbrace_open = 0 +indent_vbrace_open_on_tabstop = false +indent_token_after_brace = true +indent_cpp_lambda_body = false +indent_using_block = true +indent_ternary_operator = 0 +indent_off_after_return_new = false +indent_single_after_return = false +indent_ignore_asm_block = false +nl_collapse_empty_body = false +nl_assign_leave_one_liners = true +nl_class_leave_one_liners = false +nl_enum_leave_one_liners = true +nl_getset_leave_one_liners = false +nl_cs_property_leave_one_liners = true +nl_func_leave_one_liners = true +nl_cpp_lambda_leave_one_liners = false +nl_if_leave_one_liners = false +nl_while_leave_one_liners = false +nl_for_leave_one_liners = false +nl_oc_msg_leave_one_liner = false +nl_oc_mdef_brace = force +nl_oc_block_brace = remove +nl_oc_before_interface = force +nl_oc_before_implementation = force +nl_oc_before_end = force +nl_oc_interface_brace = force +nl_oc_implementation_brace = force +nl_start_of_file = remove +nl_start_of_file_min = 0 +nl_end_of_file = force +nl_end_of_file_min = 1 +nl_assign_brace = remove +nl_assign_square = ignore +nl_tsquare_brace = ignore +nl_after_square_assign = ignore +nl_fcall_brace = force +nl_enum_brace = remove +nl_enum_class = ignore +nl_enum_class_identifier = ignore +nl_enum_identifier_colon = ignore +nl_enum_colon_type = ignore +nl_struct_brace = remove +nl_union_brace = remove +nl_if_brace = remove +nl_brace_else = force +nl_elseif_brace = remove +nl_else_brace = remove +nl_else_if = remove +nl_before_if_closing_paren = ignore +nl_brace_finally = force +nl_finally_brace = remove +nl_try_brace = remove +nl_getset_brace = force +nl_for_brace = remove +nl_catch_brace = remove +nl_oc_catch_brace = remove +nl_brace_catch = force +nl_oc_brace_catch = force +nl_brace_square = remove +nl_brace_fparen = remove +nl_while_brace = remove +nl_scope_brace = ignore +nl_unittest_brace = ignore +nl_version_brace = ignore +nl_using_brace = ignore +nl_brace_brace = force +nl_do_brace = remove +nl_brace_while = force +nl_switch_brace = remove +nl_synchronized_brace = remove +nl_multi_line_cond = false +nl_multi_line_sparen_open = ignore +nl_multi_line_sparen_close = ignore +nl_multi_line_define = false +nl_before_case = true +nl_after_case = true +nl_case_colon_brace = force +nl_before_throw = force +nl_namespace_brace = force +nl_template_class = force +nl_template_class_decl = force +nl_template_class_decl_special = force +nl_template_class_def = force +nl_template_class_def_special = force +nl_template_func = force +nl_template_func_decl = ignore +nl_template_func_decl_special = ignore +nl_template_func_def = force +nl_template_func_def_special = force +nl_template_var = ignore +nl_template_using = ignore +nl_class_brace = force +nl_class_init_args = force +nl_constr_init_args = ignore +nl_enum_own_lines = ignore +nl_func_type_name = remove +nl_func_type_name_class = ignore +nl_func_class_scope = ignore +nl_func_scope_name = remove +nl_func_proto_type_name = remove +nl_func_paren = remove +nl_func_paren_empty = ignore +nl_func_def_paren = remove +nl_func_def_paren_empty = ignore +nl_func_call_paren = ignore +nl_func_call_paren_empty = ignore +nl_func_decl_start = remove +nl_func_def_start = remove +nl_func_decl_start_single = ignore +nl_func_def_start_single = ignore +nl_func_decl_start_multi_line = false +nl_func_def_start_multi_line = false +nl_func_decl_args = ignore +nl_func_def_args = ignore +nl_func_decl_args_multi_line = false +nl_func_def_args_multi_line = false +nl_func_decl_end = remove +nl_func_def_end = remove +nl_func_decl_end_single = ignore +nl_func_def_end_single = ignore +nl_func_decl_end_multi_line = false +nl_func_def_end_multi_line = false +nl_func_decl_empty = remove +nl_func_def_empty = remove +nl_func_call_empty = ignore +nl_func_call_start = ignore +nl_func_call_start_multi_line = false +nl_func_call_args_multi_line = false +nl_func_call_end_multi_line = false +nl_template_start = false +nl_template_args = false +nl_template_end = false +nl_oc_msg_args = false +nl_fdef_brace = force +nl_fdef_brace_cond = force +nl_cpp_ldef_brace = ignore +nl_return_expr = remove +nl_after_semicolon = true +nl_paren_dbrace_open = ignore +nl_type_brace_init_lst = ignore +nl_type_brace_init_lst_open = ignore +nl_type_brace_init_lst_close = ignore +nl_after_brace_open = true +nl_after_brace_open_cmt = false +nl_after_vbrace_open = true +nl_after_vbrace_open_empty = false +nl_after_brace_close = false +nl_after_vbrace_close = false +nl_brace_struct_var = force +nl_define_macro = false +nl_squeeze_paren_close = false +nl_squeeze_ifdef = true +nl_squeeze_ifdef_top_level = false +nl_before_if = ignore +nl_after_if = ignore +nl_before_for = ignore +nl_after_for = ignore +nl_before_while = ignore +nl_after_while = ignore +nl_before_switch = ignore +nl_after_switch = ignore +nl_before_synchronized = ignore +nl_after_synchronized = ignore +nl_before_do = ignore +nl_after_do = ignore +nl_before_return = false +nl_after_return = true +nl_before_member = ignore +nl_after_member = ignore +nl_ds_struct_enum_cmt = false +nl_ds_struct_enum_close_brace = false +nl_class_colon = remove +nl_constr_colon = ignore +nl_namespace_two_to_one_liner = false +nl_create_if_one_liner = true +nl_create_for_one_liner = false +nl_create_while_one_liner = false +nl_create_func_def_one_liner = false +nl_create_list_one_liner = false +nl_split_if_one_liner = false +nl_split_for_one_liner = false +nl_split_while_one_liner = false +nl_max = 2 +nl_max_blank_in_func = 0 +nl_before_func_body_proto = 0 +nl_before_func_body_def = 0 +nl_before_func_class_proto = 0 +nl_before_func_class_def = 0 +nl_after_func_proto = 1 +nl_after_func_proto_group = 2 +nl_after_func_class_proto = 0 +nl_after_func_class_proto_group = 0 +nl_class_leave_one_liner_groups = false +nl_after_func_body = 2 +nl_after_func_body_class = 0 +nl_after_func_body_one_liner = 1 +nl_func_var_def_blk = 1 +nl_typedef_blk_start = 0 +nl_typedef_blk_end = 0 +nl_typedef_blk_in = 0 +nl_var_def_blk_start = 0 +nl_var_def_blk_end = 0 +nl_var_def_blk_in = 0 +nl_before_block_comment = 2 +nl_before_c_comment = 2 +nl_before_cpp_comment = 1 +nl_after_multiline_comment = false +nl_after_label_colon = false +nl_after_struct = 0 +nl_before_class = 0 +nl_after_class = 0 +nl_before_namespace = 0 +nl_inside_namespace = 0 +nl_after_namespace = 0 +nl_before_access_spec = 2 +nl_after_access_spec = 1 +nl_comment_func_def = 1 +nl_after_try_catch_finally = 1 +nl_around_cs_property = 1 +nl_between_get_set = 1 +nl_property_brace = ignore +eat_blanks_after_open_brace = true +eat_blanks_before_close_brace = true +nl_remove_extra_newlines = 0 +nl_after_annotation = ignore +nl_between_annotation = ignore +pos_arith = trail +pos_assign = trail +pos_bool = trail +pos_compare = trail +pos_conditional = trail +pos_comma = trail +pos_enum_comma = ignore +pos_class_comma = trail +pos_constr_comma = ignore +pos_class_colon = trail +pos_constr_colon = ignore +code_width = 0 +ls_for_split_full = true +ls_func_split_full = true +ls_code_width = false +align_keep_tabs = false +align_with_tabs = false +align_on_tabstop = false +align_number_right = false +align_keep_extra_space = false +align_func_params = true +align_func_params_span = 0 +align_func_params_thresh = 0 +align_func_params_gap = 0 +align_constr_value_span = 0 +align_constr_value_thresh = 0 +align_constr_value_gap = 0 +align_same_func_call_params = false +align_same_func_call_params_span = 0 +align_same_func_call_params_thresh = 0 +align_var_def_span = 0 +align_var_def_star_style = 1 +align_var_def_amp_style = 1 +align_var_def_thresh = 0 +align_var_def_gap = 0 +align_var_def_colon = true +align_var_def_colon_gap = 0 +align_var_def_attribute = true +align_var_def_inline = true +align_assign_span = 1 +align_assign_func_proto_span = 0 +align_assign_thresh = 0 +align_assign_decl_func = 0 +align_enum_equ_span = 1 +align_enum_equ_thresh = 0 +align_var_class_span = 0 +align_var_class_thresh = 0 +align_var_class_gap = 0 +align_var_struct_span = 1 +align_var_struct_thresh = 0 +align_var_struct_gap = 1 +align_struct_init_span = 2 +align_typedef_span = 2 +align_typedef_gap = 1 +align_typedef_func = 0 +align_typedef_star_style = 1 +align_typedef_amp_style = 1 +align_right_cmt_span = 2 +align_right_cmt_gap = 1 +align_right_cmt_mix = false +align_right_cmt_same_level = false +align_right_cmt_at_col = 1 +align_func_proto_span = 2 +align_func_proto_thresh = 0 +align_func_proto_gap = 1 +align_on_operator = true +align_mix_var_proto = true +align_single_line_func = true +align_single_line_brace = true +align_single_line_brace_gap = 1 +align_oc_msg_spec_span = 0 +align_nl_cont = false +align_pp_define_together = false +align_pp_define_span = 2 +align_pp_define_gap = 1 +align_left_shift = true +align_asm_colon = false +align_oc_msg_colon_span = 16 +align_oc_msg_colon_first = false +align_oc_decl_colon = true +cmt_width = 0 +cmt_reflow_mode = 0 +cmt_convert_tab_to_spaces = true +cmt_indent_multi = true +cmt_c_group = true +cmt_c_nl_start = true +cmt_c_nl_end = true +cmt_cpp_to_c = false +cmt_cpp_group = true +cmt_cpp_nl_start = true +cmt_cpp_nl_end = true +cmt_star_cont = true +cmt_sp_before_star_cont = 0 +cmt_sp_after_star_cont = 0 +cmt_multi_check_last = true +cmt_multi_first_len_minimum = 4 +cmt_insert_file_header = "" +cmt_insert_file_footer = "" +cmt_insert_func_header = "" +cmt_insert_class_header = "" +cmt_insert_oc_msg_header = "" +cmt_insert_before_preproc = false +cmt_insert_before_inlines = true +cmt_insert_before_ctor_dtor = false +mod_full_brace_do = force +mod_full_brace_for = force +mod_full_brace_function = force +mod_full_brace_if = force +mod_full_brace_if_chain = false +mod_full_brace_if_chain_only = false +mod_full_brace_while = force +mod_full_brace_using = ignore +mod_full_brace_nl = 1 +mod_full_brace_nl_block_rem_mlcond = false +mod_paren_on_return = remove +mod_pawn_semicolon = true +mod_full_paren_if_bool = true +mod_remove_extra_semicolon = true +mod_add_long_function_closebrace_comment = 0 mod_add_long_namespace_closebrace_comment = 0 -mod_add_long_switch_closebrace_comment = 0 -mod_add_long_ifdef_endif_comment = 0 -mod_add_long_ifdef_else_comment = 0 -mod_sort_import = true -mod_sort_using = false -mod_sort_include = true -mod_move_case_break = false -mod_case_brace = remove -mod_remove_empty_return = true -cmt_width = 0 -cmt_reflow_mode = 0 -cmt_convert_tab_to_spaces = true -cmt_indent_multi = true -cmt_c_group = true -cmt_c_nl_start = true -cmt_c_nl_end = true -cmt_cpp_group = true -cmt_cpp_nl_start = true -cmt_cpp_nl_end = true -cmt_cpp_to_c = false -cmt_star_cont = true -cmt_sp_before_star_cont = 0 -cmt_sp_after_star_cont = 0 -cmt_multi_check_last = true -cmt_insert_file_header = "" -cmt_insert_file_footer = "" -cmt_insert_func_header = "" -cmt_insert_class_header = "" -cmt_insert_oc_msg_header = "" -cmt_insert_before_preproc = false -pp_indent = force -pp_indent_at_level = false -pp_indent_count = 0 -pp_space = remove -pp_space_count = 0 -pp_indent_region = 0 -pp_region_indent_code = false -pp_indent_if = 0 -pp_if_indent_code = false -pp_define_at_level = false +mod_add_long_class_closebrace_comment = 0 +mod_add_long_switch_closebrace_comment = 0 +mod_add_long_ifdef_endif_comment = 0 +mod_add_long_ifdef_else_comment = 0 +mod_sort_case_sensitive = false +mod_sort_import = true +mod_sort_using = false +mod_sort_include = true +mod_move_case_break = false +mod_case_brace = remove +mod_remove_empty_return = true +mod_enum_last_comma = remove +mod_sort_oc_properties = false +mod_sort_oc_property_class_weight = 0 +mod_sort_oc_property_thread_safe_weight = 0 +mod_sort_oc_property_readwrite_weight = 0 +mod_sort_oc_property_reference_weight = 0 +mod_sort_oc_property_getter_weight = 0 +mod_sort_oc_property_setter_weight = 0 +mod_sort_oc_property_nullability_weight = 0 +pp_indent = force +pp_indent_at_level = false +pp_indent_count = 0 +pp_space = remove +pp_space_count = 0 +pp_indent_region = 0 +pp_region_indent_code = false +pp_indent_if = 0 +pp_if_indent_code = false +pp_define_at_level = false +pp_ignore_define_body = false +pp_indent_case = true +pp_indent_func_def = true +pp_indent_extern = true +pp_indent_brace = true +include_category_0 = "" +include_category_1 = "" +include_category_2 = "" +use_indent_func_call_param = true +use_indent_continue_only_once = false +indent_cpp_lambda_only_once = false +use_sp_after_angle_always = false +use_options_overriding_for_qt_macros = true +warn_level_tabs_found_in_verbatim_string_literals = 2 +# option(s) with 'not default' value: 332 +#