diff --git a/Vendoo.xcodeproj/project.pbxproj b/Vendoo.xcodeproj/project.pbxproj index 59df3ab..de3f948 100644 --- a/Vendoo.xcodeproj/project.pbxproj +++ b/Vendoo.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ 3E7CF3FC1CF5FE9400F486B2 /* RecoverPasswordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E7CF3FB1CF5FE9400F486B2 /* RecoverPasswordViewController.swift */; }; 3E7CF3FE1CF5FF8200F486B2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3E7CF3FD1CF5FF8200F486B2 /* GoogleService-Info.plist */; }; 3E7CF4011CF6366300F486B2 /* EtsyRESTAPIManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E7CF4001CF6366300F486B2 /* EtsyRESTAPIManager.swift */; }; + 3E93DEDB1E15C3D800849ED6 /* ExternalWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E93DEDA1E15C3D800849ED6 /* ExternalWebViewController.swift */; }; 3EA668A11D02836C00EE57A8 /* EbayWebServiceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA668A01D02836C00EE57A8 /* EbayWebServiceManager.swift */; }; 3EB2F5161CF442CF002E6D2C /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EB2F5151CF442CF002E6D2C /* Security.framework */; }; 3EB54E0E1DE08A2E006D918B /* NetworkCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB54E0D1DE08A2E006D918B /* NetworkCollectionViewCell.swift */; }; @@ -97,6 +98,7 @@ 3E7CF3FB1CF5FE9400F486B2 /* RecoverPasswordViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecoverPasswordViewController.swift; sourceTree = ""; }; 3E7CF3FD1CF5FF8200F486B2 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 3E7CF4001CF6366300F486B2 /* EtsyRESTAPIManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EtsyRESTAPIManager.swift; sourceTree = ""; }; + 3E93DEDA1E15C3D800849ED6 /* ExternalWebViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExternalWebViewController.swift; sourceTree = ""; }; 3EA668961D026E7800EE57A8 /* Vendoo-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Vendoo-Bridging-Header.h"; sourceTree = ""; }; 3EA668A01D02836C00EE57A8 /* EbayWebServiceManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EbayWebServiceManager.swift; sourceTree = ""; }; 3EA668A21D02ECB100EE57A8 /* libicucore.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libicucore.tbd; path = usr/lib/libicucore.tbd; sourceTree = SDKROOT; }; @@ -267,6 +269,14 @@ name = EtsyServices; sourceTree = ""; }; + 3E93DED91E15C38300849ED6 /* Web Views */ = { + isa = PBXGroup; + children = ( + 3E93DEDA1E15C3D800849ED6 /* ExternalWebViewController.swift */, + ); + name = "Web Views"; + sourceTree = ""; + }; 3EA668941D026E2A00EE57A8 /* EbayServices */ = { isa = PBXGroup; children = ( @@ -349,6 +359,7 @@ 3EFB0E2F1D0B95B200A05D7A /* Menu */ = { isa = PBXGroup; children = ( + 3E93DED91E15C38300849ED6 /* Web Views */, 3EE734E41DCD347900F771AE /* Notifications */, 3E1AA4331D0DD0B2005FCCBB /* Settings */, 3EFB0E321D0B968300A05D7A /* SideMenuView.swift */, @@ -774,6 +785,7 @@ 3E6CC3571CF2A94B00E00A70 /* AppDelegate.swift in Sources */, 3EC3251E1CF734C100626C48 /* NetworksTableViewController.swift in Sources */, 3EC325201CF7C3AB00626C48 /* NetworkTableViewCell.swift in Sources */, + 3E93DEDB1E15C3D800849ED6 /* ExternalWebViewController.swift in Sources */, 3EC325261CF7E90000626C48 /* FacebookGraphAPIManager.swift in Sources */, 3E7CF3FC1CF5FE9400F486B2 /* RecoverPasswordViewController.swift in Sources */, 3E1DC3CF1D42328C0091BC60 /* CategoryCell.swift in Sources */, diff --git a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate index 1f87e5c..9c60f35 100644 Binary files a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate and b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 1e4358b..7f6a5e8 100644 --- a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -6,7 +6,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Vendoo/.DS_Store b/Vendoo/.DS_Store index d9f4a62..c2e7423 100644 Binary files a/Vendoo/.DS_Store and b/Vendoo/.DS_Store differ diff --git a/Vendoo/AppDelegate.swift b/Vendoo/AppDelegate.swift index 3db7e02..392fdc1 100644 --- a/Vendoo/AppDelegate.swift +++ b/Vendoo/AppDelegate.swift @@ -35,6 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { }else { view = storyboard.instantiateViewControllerWithIdentifier("SignUp") } + self.window?.rootViewController = view diff --git a/Vendoo/ExternalWebViewController.swift b/Vendoo/ExternalWebViewController.swift new file mode 100644 index 0000000..50fe1b2 --- /dev/null +++ b/Vendoo/ExternalWebViewController.swift @@ -0,0 +1,131 @@ +// +// ExternalWebViewController.swift +// Vendoo +// +// Created by Okechi Onyeje on 12/29/16. +// Copyright © 2016 Okechi Onyeje. All rights reserved. +// + +import UIKit + +enum WebContent { + case FAQ + case GetStarted +} + +class ExternalWebViewController: UIViewController, UIWebViewDelegate { + + @IBOutlet weak var webView: UIWebView! + + @IBOutlet weak var webViewSelector: UISegmentedControl! + + //var activity: UIActivityIndicatorView! + + //contanst urls for the various app web documents on hosted website + final let privPolicy = "http://vendoo.co/privacy-policy/" + final let termsCond = "http://vendoo.co/terms-conditions/" + final let getStarted = "http://vendoo.co" + + var allowLoad = true + var currIndex: Int! + + var contentStringUrlType: String? + var content: WebContent! + var url: NSURL! + + + //controller selection + + override func viewDidLoad() { + super.viewDidLoad() + contentStringUrlType = (NSUserDefaults.standardUserDefaults().objectForKey("whichContent") as? String) + //content = ((contentStringUrlType == "FAQ") ? WebContent.FAQ : WebContent.GetStarted) + self.webView.delegate = self + self.webView.dataDetectorTypes = UIDataDetectorTypes.None + + // Do any additional setup after loading the view. + + //self.activity = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.Gray) + //self.activity.color = UIColor.purpleColor() + //self.activity.backgroundColor = UIColor.grayColor() + //self.activity.frame = self.webView.frame; + + content = ((contentStringUrlType == "FAQ") ? WebContent.FAQ : WebContent.GetStarted) + if (self.content == WebContent.FAQ){ + webViewSelector.hidden = false + webViewSelector.enabled = true + + if(webViewSelector.selectedSegmentIndex == 0){ + url = NSURL (string: termsCond) + }else{ + url = NSURL (string: privPolicy) + } + currIndex = webViewSelector.selectedSegmentIndex + }else{ + webViewSelector.hidden = true + webViewSelector.enabled = false + + url = NSURL (string: getStarted); + + } + + let requestObj = NSURLRequest(URL: url!); + webView.loadRequest(requestObj); + } + + /* + // MARK: - WebView + */ + + func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool { + return allowLoad + } + + func webViewDidFinishLoad(webView: UIWebView) { + allowLoad = false + } + + + /* + //MARK: - SegmentControl + */ + @IBAction func segSwitcher(sender: UISegmentedControl) { + if(!(self.currIndex == self.webViewSelector.selectedSegmentIndex)){ + + if (self.webViewSelector.selectedSegmentIndex == 0){ + let requestObj = NSURLRequest(URL: NSURL (string: termsCond)!); + webView.loadRequest(requestObj); + }else{ + let requestObj = NSURLRequest(URL: NSURL (string: privPolicy)!); + webView.loadRequest(requestObj); + } + + self.currIndex = self.webViewSelector.selectedSegmentIndex + self.allowLoad = true + + } + + } + + + @IBAction func navigateBack(sender: UIButton) { + + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let vc = storyboard.instantiateViewControllerWithIdentifier("Reveal View Controller") + self.presentViewController(vc, animated: true, completion: { + NSUserDefaults.standardUserDefaults().removeObjectForKey("whichContent") + //self.parentViewController!.dismissViewControllerAnimated(true, completion: nil) + }) + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ +} diff --git a/Vendoo/HomeViewController.swift b/Vendoo/HomeViewController.swift index 0c0fb18..8c0ab74 100644 --- a/Vendoo/HomeViewController.swift +++ b/Vendoo/HomeViewController.swift @@ -32,7 +32,8 @@ class HomeViewController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() - + NSUserDefaults.standardUserDefaults().removeObjectForKey("whichContent") //used to reset which webview is loaded in Faq and get started pages + //initialize notifications manager ServiceNotificationManager.delegate = self self.notificationsManager.setManagers(fbGraphManager, fireManager: firebaseManager, ebayManager: ebayGraphManager, etsyManager: etsyManager) diff --git a/Vendoo/Main.storyboard b/Vendoo/Main.storyboard index 7c48dde..d1a54d2 100755 --- a/Vendoo/Main.storyboard +++ b/Vendoo/Main.storyboard @@ -70,7 +70,7 @@ - + @@ -139,7 +139,7 @@ - + @@ -232,7 +232,7 @@ - + @@ -459,7 +459,7 @@ - + @@ -737,7 +737,7 @@ - + @@ -802,7 +802,7 @@ - + @@ -1035,7 +1035,7 @@ - + @@ -1166,7 +1166,7 @@ - + @@ -1310,7 +1310,7 @@ - + @@ -1331,7 +1331,7 @@ - + @@ -1480,6 +1480,9 @@ + + + @@ -1501,6 +1504,9 @@ + + + @@ -1548,7 +1554,7 @@ - + @@ -1564,7 +1570,7 @@ - + @@ -1607,7 +1613,62 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1624,7 +1685,7 @@ - + @@ -1640,7 +1701,7 @@ - + @@ -1657,7 +1718,7 @@ - + @@ -1693,7 +1754,7 @@ - + @@ -1964,7 +2025,7 @@ - + @@ -2015,7 +2076,7 @@ - + @@ -2154,7 +2215,7 @@ - + @@ -2391,7 +2452,7 @@ - + @@ -2415,12 +2476,13 @@ - + - - - - + + + + + diff --git a/Vendoo/MenuPanelViewController.swift b/Vendoo/MenuPanelViewController.swift index 2de5487..4e494eb 100644 --- a/Vendoo/MenuPanelViewController.swift +++ b/Vendoo/MenuPanelViewController.swift @@ -46,7 +46,36 @@ class MenuPanelViewController: UIViewController{ extension MenuPanelViewController: UITableViewDelegate { - + func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { + switch(indexPath.row){ + + //display user name and email + case 0: + + break + + //display notification count + case 1: + break + //display settings cell + case 2: + break + + //display analytics (next iteration) + case 3: + break + + //display FAQ cell + case 4: + NSUserDefaults.standardUserDefaults().setObject("FAQ", forKey: "whichContent") + break + + //display how to cell + default: + NSUserDefaults.standardUserDefaults().setObject("Getting_Started", forKey: "whichContent") + break + } + } } extension MenuPanelViewController: UITableViewDataSource @@ -96,6 +125,7 @@ extension MenuPanelViewController: UITableViewDataSource //display FAQ cell case 4: cell = self.table.dequeueReusableCellWithIdentifier("FAQ_Cell")! + break //display how to cell @@ -106,6 +136,8 @@ extension MenuPanelViewController: UITableViewDataSource return cell } + + } diff --git a/Vendoo/SignInViewController.swift b/Vendoo/SignInViewController.swift index 1a28550..c75d69b 100644 --- a/Vendoo/SignInViewController.swift +++ b/Vendoo/SignInViewController.swift @@ -37,6 +37,7 @@ class SignInViewController: UIViewController { let dictionary = Locksmith.loadDataForUserAccount(self.email.text!, inService: "vendoo") self.password.text = dictionary!["pass"] as? String + signInUser(self) }else{ print("user not found") @@ -95,6 +96,7 @@ extension SignInViewController { if !(NSUserDefaults.standardUserDefaults().boolForKey("signedIn")){ NSUserDefaults.standardUserDefaults().setBool(true, forKey: "signedIn") NSUserDefaults.standardUserDefaults().setObject(self.email.text, forKey: "email") + //save data to keychain do{