Skip to content

Commit

Permalink
Merge branch 'swift-3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuoza committed Dec 29, 2016
2 parents 22311f5 + 7e4b6e2 commit eb81154
Show file tree
Hide file tree
Showing 22 changed files with 122 additions and 112 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ language: objective-c
osx_image: xcode7.1
env:
matrix:
- DESTINATION="OS=9.1,name=iPhone 6s" SDK=iphonesimulator9.1
- DESTINATION="OS=9.1,name=iPhone 6s Plus" SDK=iphonesimulator9.1
- DESTINATION="OS=10.0,name=iPhone 6s" SDK=iphonesimulator10.0
- DESTINATION="OS=10.0,name=iPhone 6s Plus" SDK=iphonesimulator10.0
branches:
only:
- master
before_install:
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- cd Example && pod install && cd -
- pod install --project-dir=Example
script:
- set -o pipefail
- xcodebuild -workspace XYDoughnutChart.xcworkspace -scheme XYDoughnutChartDemo -sdk "$SDK" -destination "$DESTINATION"
Expand Down
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'

target 'Tests', :exclusive => true do
target 'Tests' do
pod 'FBSnapshotTestCase/Core', '~> 2.0'
end
4 changes: 3 additions & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ DEPENDENCIES:
SPEC CHECKSUMS:
FBSnapshotTestCase: d94cf34841c9e77390e29009e8e2713479d48753

COCOAPODS: 0.38.2
PODFILE CHECKSUM: f4b11cbb8a287da832b0c70c9bc530319c0ec7b0

COCOAPODS: 1.0.1
2 changes: 1 addition & 1 deletion Example/Tests/DummyChartSourceClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ - (NSInteger)numberOfSlicesInDoughnutChart:(XYDoughnutChart *)doughnutChart
return 4;
}

- (CGFloat)doughnutChart:(XYDoughnutChart *)doughnutChart valueForSliceAtIndexPath:(NSIndexPath *)indexPath
- (CGFloat)doughnutChart:(XYDoughnutChart *)doughnutChart valueForSliceAtIndexPath:(XYDoughnutIndexPath *)indexPath
{
return (indexPath.slice + 1) * 10.0;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...tViewWithHighRadiusOffsetSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...tViewWithHighRadiusOffsetSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...tViewWithZeroRadiusOffsetSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...tViewWithZeroRadiusOffsetSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Example/XYDoughnutChart.playground/contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DataSource: NSObject, XYDoughnutChartDataSource {
return 4
}

func doughnutChart(doughnutChart: XYDoughnutChart, valueForSliceAtIndexPath indexPath: NSIndexPath) -> CGFloat {
func doughnutChart(doughnutChart: XYDoughnutChart, valueForSliceAtIndexPath indexPath: XYDoughnutIndexPath) -> CGFloat {
return CGFloat(indexPath.slice + 1) * 10
}

Expand Down
6 changes: 3 additions & 3 deletions Example/XYDoughnutChart.playground/timeline.xctimeline
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
version = "3.0">
<TimelineItems>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=9&amp;CharacterRangeLoc=581&amp;EndingColumnNumber=10&amp;EndingLineNumber=32&amp;StartingColumnNumber=1&amp;StartingLineNumber=32&amp;Timestamp=449734504.502212"
documentLocation = "#CharacterRangeLen=9&amp;CharacterRangeLoc=589&amp;EndingColumnNumber=10&amp;EndingLineNumber=32&amp;StartingColumnNumber=1&amp;StartingLineNumber=32&amp;Timestamp=496006663.660715"
lockedSize = "{401, 181}"
selectedRepresentationIndex = "0"
shouldTrackSuperviewWidth = "NO">
</LoggerValueHistoryTimelineItem>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=9&amp;CharacterRangeLoc=528&amp;EndingColumnNumber=10&amp;EndingLineNumber=22&amp;StartingColumnNumber=1&amp;StartingLineNumber=22&amp;Timestamp=449734504.502496"
documentLocation = "#CharacterRangeLen=9&amp;CharacterRangeLoc=536&amp;EndingColumnNumber=10&amp;EndingLineNumber=22&amp;StartingColumnNumber=1&amp;StartingLineNumber=22&amp;Timestamp=496006663.773426"
selectedRepresentationIndex = "0"
shouldTrackSuperviewWidth = "NO">
</LoggerValueHistoryTimelineItem>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=9&amp;CharacterRangeLoc=526&amp;EndingColumnNumber=10&amp;EndingLineNumber=21&amp;StartingColumnNumber=1&amp;StartingLineNumber=21&amp;Timestamp=449734508.867406"
documentLocation = "#CharacterRangeLen=9&amp;CharacterRangeLoc=534&amp;EndingColumnNumber=10&amp;EndingLineNumber=21&amp;StartingColumnNumber=1&amp;StartingLineNumber=21&amp;Timestamp=496006663.773872"
lockedSize = "{334, 178}"
selectedRepresentationIndex = "0"
shouldTrackSuperviewWidth = "NO">
Expand Down
74 changes: 46 additions & 28 deletions Example/XYDoughnutChartDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
8386CA4AE322D08A5E4E2A28 /* libPods-Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F5A29C6D5646BD442F4297F /* libPods-Tests.a */; };
18C72FE8DE770C5F59FF40ED /* libPods-Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 883FA6780C21573E867A0854 /* libPods-Tests.a */; };
A83DB7261A762423001C5763 /* ChartViewWithZeroRadiusOffsetSnapshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A83DB7251A762423001C5763 /* ChartViewWithZeroRadiusOffsetSnapshotTests.m */; };
A83DB7291A762471001C5763 /* DummyChartSourceClass.m in Sources */ = {isa = PBXBuildFile; fileRef = A83DB7281A762471001C5763 /* DummyChartSourceClass.m */; };
A83DB72B1A762581001C5763 /* ChartViewWithHighRadiusOffsetSnapshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A83DB72A1A762581001C5763 /* ChartViewWithHighRadiusOffsetSnapshotTests.m */; };
Expand Down Expand Up @@ -63,9 +63,9 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
4F5A29C6D5646BD442F4297F /* libPods-Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5C9E97081F3BE8F52FAB858D /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = "<group>"; };
5DD003F043E195C6A060FE8F /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = "<group>"; };
36F889852E29C467CE8D68CB /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = "<group>"; };
73BD3890160432EFAFC49766 /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = "<group>"; };
883FA6780C21573E867A0854 /* libPods-Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
A83DB7251A762423001C5763 /* ChartViewWithZeroRadiusOffsetSnapshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ChartViewWithZeroRadiusOffsetSnapshotTests.m; path = Tests/ChartViewWithZeroRadiusOffsetSnapshotTests.m; sourceTree = SOURCE_ROOT; };
A83DB7271A762471001C5763 /* DummyChartSourceClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DummyChartSourceClass.h; path = Tests/DummyChartSourceClass.h; sourceTree = SOURCE_ROOT; };
A83DB7281A762471001C5763 /* DummyChartSourceClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DummyChartSourceClass.m; path = Tests/DummyChartSourceClass.m; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -107,13 +107,22 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8386CA4AE322D08A5E4E2A28 /* libPods-Tests.a in Frameworks */,
18C72FE8DE770C5F59FF40ED /* libPods-Tests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
426F666075B27F8CE466DFE0 /* Pods */ = {
isa = PBXGroup;
children = (
36F889852E29C467CE8D68CB /* Pods-Tests.debug.xcconfig */,
73BD3890160432EFAFC49766 /* Pods-Tests.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
A83DB72C1A76272C001C5763 /* DummyChartSource */ = {
isa = PBXGroup;
children = (
Expand All @@ -138,8 +147,8 @@
A8ED43041A47F63900053246 /* XYDoughnutChartDemo */,
A8ED431E1A47F63900053246 /* Tests */,
A8ED43031A47F63900053246 /* Products */,
F999DF91B8306D9282BEF2EE /* Pods */,
E01C450E0196D84BB46374AE /* Frameworks */,
426F666075B27F8CE466DFE0 /* Pods */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -216,20 +225,11 @@
children = (
A8E0692D1A48001C007C7737 /* XYDoughnutChart.framework */,
A8E069251A47FF53007C7737 /* XYDoughnutChart.framework */,
4F5A29C6D5646BD442F4297F /* libPods-Tests.a */,
883FA6780C21573E867A0854 /* libPods-Tests.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
F999DF91B8306D9282BEF2EE /* Pods */ = {
isa = PBXGroup;
children = (
5C9E97081F3BE8F52FAB858D /* Pods-Tests.debug.xcconfig */,
5DD003F043E195C6A060FE8F /* Pods-Tests.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -256,11 +256,12 @@
isa = PBXNativeTarget;
buildConfigurationList = A8ED43281A47F63900053246 /* Build configuration list for PBXNativeTarget "Tests" */;
buildPhases = (
1A7105BEC12EA50F7703BE2C /* Check Pods Manifest.lock */,
5922BF3326F471A6DE89B5EE /* [CP] Check Pods Manifest.lock */,
A8ED43171A47F63900053246 /* Sources */,
A8ED43181A47F63900053246 /* Frameworks */,
A8ED43191A47F63900053246 /* Resources */,
E1A6E2C3D9D6EC13120B0EC6 /* Copy Pods Resources */,
537DA98AAFEB90C2EA473323 /* [CP] Embed Pods Frameworks */,
27331B7CE697DA2F640B4656 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -347,34 +348,49 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
1A7105BEC12EA50F7703BE2C /* Check Pods Manifest.lock */ = {
27331B7CE697DA2F640B4656 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
E1A6E2C3D9D6EC13120B0EC6 /* Copy Pods Resources */ = {
537DA98AAFEB90C2EA473323 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
5922BF3326F471A6DE89B5EE /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -538,6 +554,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/XYDoughnutChartDemo/XYDoughnutChartDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -551,6 +568,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/XYDoughnutChartDemo/XYDoughnutChartDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -562,10 +580,10 @@
};
A8ED43291A47F63900053246 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5C9E97081F3BE8F52FAB858D /* Pods-Tests.debug.xcconfig */;
baseConfigurationReference = 36F889852E29C467CE8D68CB /* Pods-Tests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = "";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand All @@ -581,10 +599,10 @@
};
A8ED432A1A47F63900053246 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5DD003F043E195C6A060FE8F /* Pods-Tests.release.xcconfig */;
baseConfigurationReference = 73BD3890160432EFAFC49766 /* Pods-Tests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = "";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "Tests/Tests-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
Expand Down
14 changes: 7 additions & 7 deletions Example/XYDoughnutChartDemo/XYDoughnutChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,42 +62,42 @@ - (NSInteger)numberOfSlicesInDoughnutChart:(XYDoughnutChart *)doughnutChart
return self.slices.count;
}

- (CGFloat)doughnutChart:(XYDoughnutChart *)doughnutChart valueForSliceAtIndexPath:(NSIndexPath *)indexPath
- (CGFloat)doughnutChart:(XYDoughnutChart *)doughnutChart valueForSliceAtIndexPath:(XYDoughnutIndexPath *)indexPath
{
return [[self.slices objectAtIndex:(indexPath.slice % self.slices.count)] intValue];
}

#pragma mark - XYDoughnutChart Delegate

- (NSIndexPath *)doughnutChart:(XYDoughnutChart *)doughnutChart willSelectSliceAtIndex:(NSIndexPath *)indexPath
- (XYDoughnutIndexPath *)doughnutChart:(XYDoughnutChart *)doughnutChart willSelectSliceAtIndex:(XYDoughnutIndexPath *)indexPath
{
NSLog(@"will Select slice at index %lu", (long)indexPath.slice);
return indexPath;
}

- (void)doughnutChart:(XYDoughnutChart *)doughnutChart didSelectSliceAtIndexPath:(NSIndexPath *)indexPath
- (void)doughnutChart:(XYDoughnutChart *)doughnutChart didSelectSliceAtIndexPath:(XYDoughnutIndexPath *)indexPath
{
NSLog(@"did Select slice at index %ld", (long)indexPath.slice);
}


- (void)doughnutChart:(XYDoughnutChart *)doughnutChart didDeselectSliceAtIndexPath:(NSIndexPath *)indexPath
- (void)doughnutChart:(XYDoughnutChart *)doughnutChart didDeselectSliceAtIndexPath:(XYDoughnutIndexPath *)indexPath
{
NSLog(@"did Deselect slice at index %ld", (long)indexPath.slice);
}


- (UIColor *)doughnutChart:(XYDoughnutChart *)doughnutChart colorForSliceAtIndexPath:(NSIndexPath *)indexPath
- (UIColor *)doughnutChart:(XYDoughnutChart *)doughnutChart colorForSliceAtIndexPath:(XYDoughnutIndexPath *)indexPath
{
return [self.sliceColors objectAtIndex:(indexPath.slice % self.sliceColors.count)];
}

- (UIColor *)doughnutChart:(XYDoughnutChart *)doughnutChart selectedStrokeColorForSliceAtIndexPath:(NSIndexPath *)indexPath
- (UIColor *)doughnutChart:(XYDoughnutChart *)doughnutChart selectedStrokeColorForSliceAtIndexPath:(XYDoughnutIndexPath *)indexPath
{
return [UIColor whiteColor];
}

- (CGFloat)doughnutChart:(XYDoughnutChart *)doughnutChart selectedStrokeWidthForSliceAtIndexPath:(NSIndexPath *)indexPath
- (CGFloat)doughnutChart:(XYDoughnutChart *)doughnutChart selectedStrokeWidthForSliceAtIndexPath:(XYDoughnutIndexPath *)indexPath
{
return 2.0;
}
Expand Down
23 changes: 0 additions & 23 deletions Source/Classes/NSIndexPath+XYDoughnutChart.m

This file was deleted.

Loading

0 comments on commit eb81154

Please sign in to comment.