Refactor, changed / to - on keyboard

This commit is contained in:
2016-03-23 22:19:55 +01:00
parent 3bc298e6cb
commit a95ed4bd90
5 changed files with 20 additions and 99 deletions
+2
View File
@@ -22,4 +22,6 @@
withMinimumSize:(NSInteger)minSize
withMod:(float)mod;
+ (NSString *)savePathForFile:(NSString *)file;
@end
+8
View File
@@ -49,4 +49,12 @@
return [UIFont systemFontOfSize:mid];
}
+ (NSString *)savePathForFile:(NSString *)file {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
return [documentsPath
stringByAppendingString:[NSString stringWithFormat:@"/%@", file]];
}
@end
+8 -15
View File
@@ -39,27 +39,20 @@
- (void)saveToFile:(NSDictionary *)save {
if (!([_save valueForKey:@"MENU@LSKR1"] == nil ||
[[_save valueForKey:@"MENU@LSKR1"] isEqualToString:@""])) {
NSArray *paths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
[_save writeToFile:[documentsPath
stringByAppendingString:
[NSString
stringWithFormat:
@"/%@",
[_save writeToFile:[SharedDeclerations
savePathForFile:
[SharedDeclerations
savePathForFile:
[_save valueForKey:@"MENU@LSKR1"]]]
atomically:YES];
}
}
- (void)loadSave:(NSString *)file {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
NSString *filePath = [documentsPath
stringByAppendingString:[NSString stringWithFormat:@"/%@", file]];
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
_save = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
if ([[NSFileManager defaultManager]
fileExistsAtPath:[SharedDeclerations savePathForFile:file]]) {
_save = [[NSMutableDictionary alloc]
initWithContentsOfFile:[SharedDeclerations savePathForFile:file]];
}
}
+2 -2
View File
@@ -6,8 +6,8 @@
// Copyright © 2016 Kilian Hofmann. All rights reserved.
//
#import "ViewControllerKeyboard.h"
#import "ViewController.h"
#import "ViewControllerKeyboard.h"
@implementation ViewControllerKeyboard
@@ -71,7 +71,7 @@
@"",
@".",
@"0",
@"/",
@"-",
@"",
@"",
@"",