Refactor, changed / to - on keyboard
This commit is contained in:
@@ -22,4 +22,6 @@
|
||||
withMinimumSize:(NSInteger)minSize
|
||||
withMod:(float)mod;
|
||||
|
||||
+ (NSString *)savePathForFile:(NSString *)file;
|
||||
|
||||
@end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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",
|
||||
@"/",
|
||||
@"-",
|
||||
@"",
|
||||
@"",
|
||||
@"",
|
||||
|
||||
Reference in New Issue
Block a user