This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL | |
{ | |
assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]); | |
NSError *error = nil; | |
BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES] | |
forKey: NSURLIsExcludedFromBackupKey error: &error]; | |
if(!success){ | |
NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LineChartData *d = [LineChartData new]; | |
d.xMin = 1; | |
d.xMax = [daysStatistics count]; | |
d.title = @"The title for the legend"; | |
d.color = [UIColor colorWithRed:0/255.0f green:179/255.0f blue:219/255.0f alpha:1.0f]; | |
d.itemCount = [daysStatistics count]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableArray *days = [NSMutableArray new]; | |
NSMutableArray *verbs = [NSMutableArray new]; | |
for(NSUInteger i = 0; i < d.itemCount; ++i) | |
{ | |
PVPDayStat *item = [[PVPDayStat alloc] init]; | |
item = [daysStatistics objectAtIndex:i]; | |
[days addObject:@([item.day intValue])]; | |
[verbs addObject:@([item.verbs intValue])]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_chartView = [[LineChartView alloc] initWithFrame:CGRectMake(0, 210, 300, 220)]; | |
if (d.itemCount <= 5) | |
_chartView.drawsDataPoints = YES; | |
else | |
_chartView.drawsDataPoints = NO; | |
_chartView.yMin = 0; | |
_chartView.yMax = [PVPVerbData getOverallVerbsQuantity]; | |
_chartView.ySteps = @[@"0", | |
[NSString stringWithFormat:@"%.f", _chartView.yMax / 8], | |
[NSString stringWithFormat:@"%.f", _chartView.yMax / 4], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText | |
{ | |
_data = [SBHotspotData findHotspot:searchText]; | |
[self.searchResultsTableView reloadData]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (NSArray *) findHotspot: (NSString *)partOfTitle | |
{ | |
SBHotspotData *item; | |
NSMutableArray *result = [NSMutableArray array]; | |
NSString *path = [self getDatabasePath]; | |
FMDatabase *database; | |
database = [FMDatabase databaseWithPath:path]; | |
[database open]; | |
NSString *query = [NSString stringWithFormat:@"select * from hotspots where TitleLow like '%%%@%%'", [partOfTitle lowercaseString]]; | |
FMResultSet *results = [database executeQuery:query]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:item.hotspotTitle]; | |
NSRange range = [item.hotspotTitle rangeOfString:_searchHotspotBar.text]; | |
[attributedString addAttribute:NSBackgroundColorAttributeName value:[UIColor colorWithRed:216/255.0f green:87/255.0f blue:23/255.0f alpha:1.0f] range:range]; | |
cell.cellLabel.attributedText = attributedString; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showMenu | |
{ | |
CALayer* layer = _menuButtonImageView.layer; | |
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; | |
animation.fromValue = [NSNumber numberWithFloat:0.0 * M_PI]; | |
animation.toValue = [NSNumber numberWithFloat:1.0 * M_PI]; | |
animation.duration = 0.3; | |
animation.cumulative = YES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "CERangeSlider.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation CEViewController | |
{ | |
CERangeSlider* _rangeSlider; | |
} |
OlderNewer