From a70df29f403b11abb1c91269db6aa5edcfa1b0b7 Mon Sep 17 00:00:00 2001 From: Kilian Hofmann Date: Thu, 14 Apr 2016 00:23:48 +0200 Subject: [PATCH] Parsing of NavData implemented, lookup of Waypoints implemented as testbed --- About.rtf | 7 + FMC Planner 2.xcodeproj/project.pbxproj | 10 ++ FMC Planner 2/AppDelegate.h | 8 +- FMC Planner 2/AppDelegate.m | 31 ++-- FMC Planner 2/Base.lproj/Main.storyboard | 17 ++- FMC Planner 2/DropboxV2ObjC.h | 1 + FMC Planner 2/NavDataParser.h | 25 ++++ FMC Planner 2/NavDataParser.m | 168 ++++++++++++++++++++++ FMC Planner 2/SharedDeclerations.h | 8 ++ FMC Planner 2/SharedDeclerations.m | 46 +++--- FMC Planner 2/TableViewController.h | 5 +- FMC Planner 2/TableViewController.m | 51 ++++--- FMC Planner 2/ViewController.h | 8 ++ FMC Planner 2/ViewController.m | 28 +++- FMC Planner 2/ViewControllerKeyboard.m | 7 +- FMC Planner 2/ViewControllerScreen.h | 1 + FMC Planner 2/ViewControllerScreen.m | 67 ++++++--- FMC Planner 2/ViewControllerServiceMenu.h | 4 +- FMC Planner 2/ViewControllerServiceMenu.m | 8 +- 19 files changed, 392 insertions(+), 108 deletions(-) create mode 100644 About.rtf create mode 100644 FMC Planner 2/NavDataParser.h create mode 100644 FMC Planner 2/NavDataParser.m diff --git a/About.rtf b/About.rtf new file mode 100644 index 0000000..cbe8eca --- /dev/null +++ b/About.rtf @@ -0,0 +1,7 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\margl1440\margr1440\vieww9000\viewh8400\viewkind0 +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 + +\f0\fs24 \cf0 SWTableViewCell by Chris Wendel: https://github.com/CEWendel/SWTableViewCell} \ No newline at end of file diff --git a/FMC Planner 2.xcodeproj/project.pbxproj b/FMC Planner 2.xcodeproj/project.pbxproj index 6cc4ddd..411fe2f 100644 --- a/FMC Planner 2.xcodeproj/project.pbxproj +++ b/FMC Planner 2.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + E20D7B501CBE807700FF3C70 /* NavDataParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E20D7B4F1CBE807700FF3C70 /* NavDataParser.m */; }; + E20D7B521CBE87A800FF3C70 /* About.rtf in Resources */ = {isa = PBXBuildFile; fileRef = E20D7B511CBE87A800FF3C70 /* About.rtf */; }; E227C7831C9F42AB00DE0CA4 /* ViewControllerKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = E227C7821C9F42AB00DE0CA4 /* ViewControllerKeyboard.m */; }; E227C7861C9F474100DE0CA4 /* ViewControllerScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = E227C7851C9F474100DE0CA4 /* ViewControllerScreen.m */; }; E22E0B561CAD655D00B71EE5 /* libPods-FMC Planner 2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E22E0B551CAD655D00B71EE5 /* libPods-FMC Planner 2.a */; }; @@ -57,6 +59,9 @@ 7001889F24BA85C99E7B33D5 /* Pods-FMC Planner 2Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FMC Planner 2Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-FMC Planner 2Tests/Pods-FMC Planner 2Tests.debug.xcconfig"; sourceTree = ""; }; 7D8EFDFEC3DAB0323BA29ECE /* Pods-FMC Planner 2.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FMC Planner 2.debug.xcconfig"; path = "Pods/Target Support Files/Pods-FMC Planner 2/Pods-FMC Planner 2.debug.xcconfig"; sourceTree = ""; }; C9A81E1FC84665AB5255ECFC /* Pods-FMC Planner 2UITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FMC Planner 2UITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-FMC Planner 2UITests/Pods-FMC Planner 2UITests.release.xcconfig"; sourceTree = ""; }; + E20D7B4E1CBE807700FF3C70 /* NavDataParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavDataParser.h; sourceTree = ""; }; + E20D7B4F1CBE807700FF3C70 /* NavDataParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NavDataParser.m; sourceTree = ""; }; + E20D7B511CBE87A800FF3C70 /* About.rtf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.rtf; path = About.rtf; sourceTree = ""; }; E227C7811C9F42AB00DE0CA4 /* ViewControllerKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewControllerKeyboard.h; sourceTree = ""; }; E227C7821C9F42AB00DE0CA4 /* ViewControllerKeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewControllerKeyboard.m; sourceTree = ""; }; E227C7841C9F474100DE0CA4 /* ViewControllerScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewControllerScreen.h; sourceTree = ""; }; @@ -157,6 +162,7 @@ E22EE9C31C9DB7B3001F5BC0 = { isa = PBXGroup; children = ( + E20D7B511CBE87A800FF3C70 /* About.rtf */, E22EE9CE1C9DB7B3001F5BC0 /* FMC Planner 2 */, E22EE9E81C9DB7B4001F5BC0 /* FMC Planner 2Tests */, E22EE9F31C9DB7B4001F5BC0 /* FMC Planner 2UITests */, @@ -194,6 +200,8 @@ E2A9270E1CA2FE5200606E07 /* Header */, E22EE9DB1C9DB7B3001F5BC0 /* Assets.xcassets */, E22EE9E01C9DB7B3001F5BC0 /* Info.plist */, + E20D7B4E1CBE807700FF3C70 /* NavDataParser.h */, + E20D7B4F1CBE807700FF3C70 /* NavDataParser.m */, ); name = "Supporting Files"; sourceTree = ""; @@ -410,6 +418,7 @@ E29391CE1CA444F4008EB590 /* LaunchScreen.storyboard in Resources */, E28E10731CA0375F006E2C6B /* ROUTE.plist in Resources */, E22EE9DA1C9DB7B3001F5BC0 /* Main.storyboard in Resources */, + E20D7B521CBE87A800FF3C70 /* About.rtf in Resources */, E2763C721CA6C8AE001E4EDA /* LSKs.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -566,6 +575,7 @@ E227C7831C9F42AB00DE0CA4 /* ViewControllerKeyboard.m in Sources */, E2763C751CA6E777001E4EDA /* ViewControllerServiceMenu.m in Sources */, E227C7861C9F474100DE0CA4 /* ViewControllerScreen.m in Sources */, + E20D7B501CBE807700FF3C70 /* NavDataParser.m in Sources */, E280F3A41CA7C71500DF2A05 /* TableViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/FMC Planner 2/AppDelegate.h b/FMC Planner 2/AppDelegate.h index d856c88..79a7141 100644 --- a/FMC Planner 2/AppDelegate.h +++ b/FMC Planner 2/AppDelegate.h @@ -7,6 +7,8 @@ // #import "DropboxV2ObjC.h" +#import "NavDataParser.h" +#import "ViewController.h" #import "ViewControllerServiceMenu.h" #import @@ -14,9 +16,9 @@ @property (strong, nonatomic) UIWindow *window; -#pragma mark - Shared Dropbox client -/// Shared Dropbox client -@property (strong, nonatomic) DropboxV2ObjC *dbClient; +#pragma mark - Refrence to other views in app + +@property (strong, nonatomic) ViewController *main; #pragma mark - Refrence to authentication web view in order to dismiss it diff --git a/FMC Planner 2/AppDelegate.m b/FMC Planner 2/AppDelegate.m index 2ec222c..7c074e0 100644 --- a/FMC Planner 2/AppDelegate.m +++ b/FMC Planner 2/AppDelegate.m @@ -15,18 +15,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - _dbClient = [[DropboxV2ObjC alloc] init]; - NSDictionary *credentials = - [[NSURLCredentialStorage sharedCredentialStorage] - credentialsForProtectionSpace:_dbClient.kDropboxProtectionSpace]; - NSURLCredential *credential = [credentials.objectEnumerator nextObject]; - _dbClient.token = credential.password; - // Reset if user changed it - [_dbClient setupDropboxWithHandler:^{ - } - presenter:nil]; [self setup]; + return YES; } @@ -74,15 +64,16 @@ - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { // Display text - [_dbClient authorizeUserWithToke:url - completion:^(void) { - [_smWebView.navigationController - popViewControllerAnimated:YES]; - [_dbClient setupDropboxWithHandler:^{ - } - presenter:_smMenu]; - } - presenter:_smMenu]; + [_main.dbClient authorizeUserWithToke:url + completion:^(void) { + [_smWebView.navigationController + popViewControllerAnimated:YES]; + [_main.dbClient + setupDropboxWithHandler:^{ + } + presenter:_smMenu]; + } + presenter:_smMenu]; return YES; } diff --git a/FMC Planner 2/Base.lproj/Main.storyboard b/FMC Planner 2/Base.lproj/Main.storyboard index ae306aa..68667df 100644 --- a/FMC Planner 2/Base.lproj/Main.storyboard +++ b/FMC Planner 2/Base.lproj/Main.storyboard @@ -3,7 +3,6 @@ - @@ -116,7 +115,7 @@