Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit cb2e403

Browse files
author
Sam Spencer
committed
Update Project Settings, Minor Bug Fixes
The BEMSimpleLineGraph sample project supports the lowest available deployment target in Xcode 8, which is iOS 8.0. Additional compiler warnings for the sample project have been enabled. Fixed a few issues with nullability.
1 parent 8bb5f88 commit cb2e403

File tree

7 files changed

+36
-19
lines changed

7 files changed

+36
-19
lines changed

Classes/BEMSimpleLineGraphView.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,15 @@ IB_DESIGNABLE @interface BEMSimpleLineGraphView : UIView <UIGestureRecognizerDel
303303

304304

305305
/// Color of the background of the X-Axis
306-
@property (strong, nonatomic) UIColor *colorBackgroundXaxis;
306+
@property (strong, nonatomic, nullable) UIColor *colorBackgroundXaxis;
307307

308308

309309
/// Alpha of the background of the X-Axis
310310
@property (nonatomic) CGFloat alphaBackgroundXaxis;
311311

312312

313313
/// Color of the background of the Y-Axis
314-
@property (strong, nonatomic) UIColor *colorBackgroundYaxis;
314+
@property (strong, nonatomic, nullable) UIColor *colorBackgroundYaxis;
315315

316316

317317
/// Alpha of the background of the Y-Axis
@@ -672,4 +672,4 @@ IB_DESIGNABLE @interface BEMSimpleLineGraphView : UIView <UIGestureRecognizerDel
672672

673673
NS_ASSUME_NONNULL_END
674674

675-
@end
675+
@end

Classes/BEMSimpleLineGraphView.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ - (NSArray *)calculationDataPoints {
12001200

12011201
- (NSNumber *)calculatePointValueAverage {
12021202
NSArray *filteredArray = [self calculationDataPoints];
1203-
if (filteredArray.count == 0) return 0;
1203+
if (filteredArray.count == 0) return [NSNumber numberWithInt:0];
12041204

12051205
NSExpression *expression = [NSExpression expressionForFunction:@"average:" arguments:@[[NSExpression expressionForConstantValue:filteredArray]]];
12061206
NSNumber *value = [expression expressionValueWithObject:nil context:nil];
@@ -1210,7 +1210,7 @@ - (NSNumber *)calculatePointValueAverage {
12101210

12111211
- (NSNumber *)calculatePointValueSum {
12121212
NSArray *filteredArray = [self calculationDataPoints];
1213-
if (filteredArray.count == 0) return 0;
1213+
if (filteredArray.count == 0) return [NSNumber numberWithInt:0];
12141214

12151215
NSExpression *expression = [NSExpression expressionForFunction:@"sum:" arguments:@[[NSExpression expressionForConstantValue:filteredArray]]];
12161216
NSNumber *value = [expression expressionValueWithObject:nil context:nil];
@@ -1220,7 +1220,7 @@ - (NSNumber *)calculatePointValueSum {
12201220

12211221
- (NSNumber *)calculatePointValueMedian {
12221222
NSArray *filteredArray = [self calculationDataPoints];
1223-
if (filteredArray.count == 0) return 0;
1223+
if (filteredArray.count == 0) return [NSNumber numberWithInt:0];
12241224

12251225
NSExpression *expression = [NSExpression expressionForFunction:@"median:" arguments:@[[NSExpression expressionForConstantValue:filteredArray]]];
12261226
NSNumber *value = [expression expressionValueWithObject:nil context:nil];
@@ -1230,7 +1230,7 @@ - (NSNumber *)calculatePointValueMedian {
12301230

12311231
- (NSNumber *)calculatePointValueMode {
12321232
NSArray *filteredArray = [self calculationDataPoints];
1233-
if (filteredArray.count == 0) return 0;
1233+
if (filteredArray.count == 0) return [NSNumber numberWithInt:0];
12341234

12351235
NSExpression *expression = [NSExpression expressionForFunction:@"mode:" arguments:@[[NSExpression expressionForConstantValue:filteredArray]]];
12361236
NSMutableArray *value = [expression expressionValueWithObject:nil context:nil];
@@ -1240,7 +1240,7 @@ - (NSNumber *)calculatePointValueMode {
12401240

12411241
- (NSNumber *)calculateLineGraphStandardDeviation {
12421242
NSArray *filteredArray = [self calculationDataPoints];
1243-
if (filteredArray.count == 0) return 0;
1243+
if (filteredArray.count == 0) return [NSNumber numberWithInt:0];
12441244

12451245
NSExpression *expression = [NSExpression expressionForFunction:@"stddev:" arguments:@[[NSExpression expressionForConstantValue:filteredArray]]];
12461246
NSNumber *value = [expression expressionValueWithObject:nil context:nil];
@@ -1250,7 +1250,7 @@ - (NSNumber *)calculateLineGraphStandardDeviation {
12501250

12511251
- (NSNumber *)calculateMinimumPointValue {
12521252
NSArray *filteredArray = [self calculationDataPoints];
1253-
if (filteredArray.count == 0) return 0;
1253+
if (filteredArray.count == 0) return [NSNumber numberWithInt:0];
12541254

12551255
NSExpression *expression = [NSExpression expressionForFunction:@"min:" arguments:@[[NSExpression expressionForConstantValue:filteredArray]]];
12561256
NSNumber *value = [expression expressionValueWithObject:nil context:nil];
@@ -1259,7 +1259,7 @@ - (NSNumber *)calculateMinimumPointValue {
12591259

12601260
- (NSNumber *)calculateMaximumPointValue {
12611261
NSArray *filteredArray = [self calculationDataPoints];
1262-
if (filteredArray.count == 0) return 0;
1262+
if (filteredArray.count == 0) return [NSNumber numberWithInt:0];
12631263

12641264
NSExpression *expression = [NSExpression expressionForFunction:@"max:" arguments:@[[NSExpression expressionForConstantValue:filteredArray]]];
12651265
NSNumber *value = [expression expressionValueWithObject:nil context:nil];

Sample Project/SimpleLineChart.xcodeproj/project.pbxproj

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
99B3FA3A1877898B00539A7B /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 99B3FA381877898B00539A7B /* LICENSE */; };
1313
99B3FA3B1877898B00539A7B /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 99B3FA391877898B00539A7B /* README.md */; };
1414
A63990B51AD4923900B14D88 /* BEMAverageLine.m in Sources */ = {isa = PBXBuildFile; fileRef = A63990B41AD4923900B14D88 /* BEMAverageLine.m */; };
15-
A64594521BAB257B00D6B8FD /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A64594501BAB257B00D6B8FD /* Launch Screen.storyboard */; settings = {ASSET_TAGS = (); }; };
15+
A64594521BAB257B00D6B8FD /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A64594501BAB257B00D6B8FD /* Launch Screen.storyboard */; };
1616
C3B90A5F187D15F7003E407D /* BEMCircle.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B90A59187D15F7003E407D /* BEMCircle.m */; };
1717
C3B90A60187D15F7003E407D /* BEMLine.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B90A5B187D15F7003E407D /* BEMLine.m */; };
1818
C3B90A61187D15F7003E407D /* BEMSimpleLineGraphView.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B90A5D187D15F7003E407D /* BEMSimpleLineGraphView.m */; };
@@ -249,7 +249,7 @@
249249
C3FD814D186DFD9A00FD8ED3 /* Project object */ = {
250250
isa = PBXProject;
251251
attributes = {
252-
LastUpgradeCheck = 0700;
252+
LastUpgradeCheck = 0800;
253253
ORGANIZATIONNAME = "Boris Emorine";
254254
TargetAttributes = {
255255
C3FD8175186DFD9A00FD8ED3 = {
@@ -385,14 +385,19 @@
385385
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
386386
CLANG_WARN_EMPTY_BODY = YES;
387387
CLANG_WARN_ENUM_CONVERSION = YES;
388+
CLANG_WARN_INFINITE_RECURSION = YES;
388389
CLANG_WARN_INT_CONVERSION = YES;
389390
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
391+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
392+
CLANG_WARN_UNREACHABLE_CODE = YES;
390393
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
391394
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
392395
COPY_PHASE_STRIP = NO;
396+
ENABLE_STRICT_OBJC_MSGSEND = YES;
393397
ENABLE_TESTABILITY = YES;
394398
GCC_C_LANGUAGE_STANDARD = gnu99;
395399
GCC_DYNAMIC_NO_PIC = NO;
400+
GCC_NO_COMMON_BLOCKS = YES;
396401
GCC_OPTIMIZATION_LEVEL = 0;
397402
GCC_PREPROCESSOR_DEFINITIONS = (
398403
"DEBUG=1",
@@ -405,7 +410,7 @@
405410
GCC_WARN_UNINITIALIZED_AUTOS = YES;
406411
GCC_WARN_UNUSED_FUNCTION = YES;
407412
GCC_WARN_UNUSED_VARIABLE = YES;
408-
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
413+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
409414
ONLY_ACTIVE_ARCH = YES;
410415
SDKROOT = iphoneos;
411416
};
@@ -424,20 +429,25 @@
424429
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
425430
CLANG_WARN_EMPTY_BODY = YES;
426431
CLANG_WARN_ENUM_CONVERSION = YES;
432+
CLANG_WARN_INFINITE_RECURSION = YES;
427433
CLANG_WARN_INT_CONVERSION = YES;
428434
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
435+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
436+
CLANG_WARN_UNREACHABLE_CODE = YES;
429437
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
430438
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
431439
COPY_PHASE_STRIP = YES;
432440
ENABLE_NS_ASSERTIONS = NO;
441+
ENABLE_STRICT_OBJC_MSGSEND = YES;
433442
GCC_C_LANGUAGE_STANDARD = gnu99;
443+
GCC_NO_COMMON_BLOCKS = YES;
434444
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
435445
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
436446
GCC_WARN_UNDECLARED_SELECTOR = YES;
437447
GCC_WARN_UNINITIALIZED_AUTOS = YES;
438448
GCC_WARN_UNUSED_FUNCTION = YES;
439449
GCC_WARN_UNUSED_VARIABLE = YES;
440-
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
450+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
441451
SDKROOT = iphoneos;
442452
VALIDATE_PRODUCT = YES;
443453
};

Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcshareddata/SimpleLineChart.xcscmblueprint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "F1F15B84-6620-4046-8D91-529CC20CD7C2",
1111
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
12-
"1CA8AD815677B6FB0DD135F65EC4576AE68426CF" : "BEMSimpleLineGraph",
12+
"1CA8AD815677B6FB0DD135F65EC4576AE68426CF" : "BEMSimpleLineGraph\/",
1313
"3A216D26EB93D9EB79DE1E013DBEF75CF4509620" : ""
1414
},
1515
"DVTSourceControlWorkspaceBlueprintNameKey" : "SimpleLineChart",

Sample Project/SimpleLineChart.xcodeproj/xcshareddata/xcschemes/SimpleLineChart.xcscheme

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0700"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -71,6 +71,13 @@
7171
ReferencedContainer = "container:SimpleLineChart.xcodeproj">
7272
</BuildableReference>
7373
</BuildableProductRunnable>
74+
<EnvironmentVariables>
75+
<EnvironmentVariable
76+
key = "OS_ACTIVITY_MODE"
77+
value = "disable"
78+
isEnabled = "YES">
79+
</EnvironmentVariable>
80+
</EnvironmentVariables>
7481
<AdditionalOptions>
7582
</AdditionalOptions>
7683
</LaunchAction>

Sample Project/SimpleLineChart.xcodeproj/xcshareddata/xcschemes/SimpleLineChartTests.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0700"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sample Project/SimpleLineChart/ViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ - (NSString *)labelForDateAtIndex:(NSInteger)index {
130130
- (IBAction)refresh:(id)sender {
131131
[self hydrateDatasets];
132132

133-
UIColor *color;
133+
UIColor *color = [UIColor colorWithRed:31.0/255.0 green:187.0/255.0 blue:166.0/255.0 alpha:1.0]; // set the default color
134134
if (self.graphColorChoice.selectedSegmentIndex == 0) color = [UIColor colorWithRed:31.0/255.0 green:187.0/255.0 blue:166.0/255.0 alpha:1.0];
135135
else if (self.graphColorChoice.selectedSegmentIndex == 1) color = [UIColor colorWithRed:255.0/255.0 green:187.0/255.0 blue:31.0/255.0 alpha:1.0];
136136
else if (self.graphColorChoice.selectedSegmentIndex == 2) color = [UIColor colorWithRed:0.0 green:140.0/255.0 blue:255.0/255.0 alpha:1.0];
@@ -310,4 +310,4 @@ - (NSString *)popUpSuffixForlineGraph:(BEMSimpleLineGraphView *)graph {
310310
// return increment;
311311
//}
312312

313-
@end
313+
@end

0 commit comments

Comments
 (0)