-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathKASharedMethods.m
More file actions
26 lines (24 loc) · 835 Bytes
/
KASharedMethods.m
File metadata and controls
26 lines (24 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//
// KASharedMethods.m
// KAChartView
//
// Created by Kenneth Parker Ackerson on 1/12/14.
// Copyright (c) 2014 Kenneth Parker Ackerson. All rights reserved.
//
#import "KASharedMethods.h"
@implementation KASharedMethods
+ (NSArray *)numberedMonthIDsWithMonth:(NSString *)string numberOfDays:(NSInteger)days{
NSMutableArray * returnArray = [NSMutableArray array];
for (NSInteger i = 0; i < days; i++){
[returnArray addObject:[string stringByAppendingFormat:@" %ld", (long)(i+1)]];
}
return returnArray;
}
+ (NSArray *)generateRandomArrayOfLength:(int)length withNumbersBetween:(CGFloat)bottom andTop:(CGFloat)top{
NSMutableArray * array = @[].mutableCopy;
for(NSInteger i = 0; i < length; i++){
array[i] = @(bottom + (arc4random_uniform((top - bottom))));
}
return array;
}
@end