diff --git a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate index 5bbeb88..7a36e29 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 63ca4fd..01efc02 100644 --- a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -10,11 +10,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Vendoo/ItemTableViewController.swift" - timestampString = "505234532.167163" + timestampString = "506441897.665422" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "442" - endingLineNumber = "442" + startingLineNumber = "443" + endingLineNumber = "443" landmarkName = "tableView(_:cellForRowAtIndexPath:)" landmarkType = "5"> @@ -280,7 +280,7 @@ moduleName = "Vendoo" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Kroleo/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift" - timestampString = "506359937.526087" + timestampString = "506444138.580552" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "32" @@ -295,7 +295,7 @@ moduleName = "Vendoo" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Kroleo/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift" - timestampString = "506359937.526342" + timestampString = "506444138.580651" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "32" @@ -310,7 +310,7 @@ moduleName = "Vendoo" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Kroleo/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift" - timestampString = "506359937.526555" + timestampString = "506444138.580732" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "32" @@ -325,7 +325,7 @@ moduleName = "Vendoo" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Kroleo/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift" - timestampString = "506359937.526814" + timestampString = "506444138.580811" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "32" @@ -374,11 +374,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Vendoo/ItemTableViewController.swift" - timestampString = "505234532.167163" + timestampString = "506441897.665422" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "539" - endingLineNumber = "539" + startingLineNumber = "540" + endingLineNumber = "540" landmarkName = "tableView(_:didSelectRowAtIndexPath:)" landmarkType = "5"> @@ -390,11 +390,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Vendoo/ItemTableViewController.swift" - timestampString = "505234532.167163" + timestampString = "506441897.665422" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "540" - endingLineNumber = "540" + startingLineNumber = "541" + endingLineNumber = "541" landmarkName = "tableView(_:didSelectRowAtIndexPath:)" landmarkType = "5"> @@ -578,7 +578,7 @@ @@ -623,5 +623,309 @@ landmarkType = "5"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Vendoo/ItemCell.swift b/Vendoo/ItemCell.swift index ad23d4c..d1f66d8 100644 --- a/Vendoo/ItemCell.swift +++ b/Vendoo/ItemCell.swift @@ -62,7 +62,10 @@ extension ItemCell: UICollectionViewDataSource{ func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { let cell: NetworkCollectionViewCell! = self.networks.dequeueReusableCellWithReuseIdentifier("network", forIndexPath: indexPath) as! NetworkCollectionViewCell - cell.setImg(selectedNetworks[indexPath.row]) + + dispatch_async(dispatch_get_main_queue(), { + cell.setImg(self.selectedNetworks[indexPath.row]) + }) /*switch (indexPath.row){ case 0: cell = collectionView.dequeueReusableCellWithReuseIdentifier("ebay", forIndexPath: indexPath) diff --git a/Vendoo/ItemTableViewController.swift b/Vendoo/ItemTableViewController.swift index 2e792a5..d6a37b6 100644 --- a/Vendoo/ItemTableViewController.swift +++ b/Vendoo/ItemTableViewController.swift @@ -403,6 +403,7 @@ extension ItemTableViewController: UITableViewDataSource{ } + //draft listings }else{ cell.itemImage.image = (self.tabBarController as? HomeViewController)?.draftListings[indexPath.row].images[0] //come back cell.itemName.text = (self.tabBarController as? HomeViewController)!.draftListings[indexPath.row].title diff --git a/Vendoo/SignInViewController.swift b/Vendoo/SignInViewController.swift index c75d69b..a8caf46 100644 --- a/Vendoo/SignInViewController.swift +++ b/Vendoo/SignInViewController.swift @@ -87,6 +87,33 @@ extension SignInViewController { alert.addAction(UIAlertAction(title: "OK", style: .Default, handler: {(action: UIAlertAction!) in })) self.presentViewController(alert, animated: true, completion: nil) + + //if request fails due to connectivity, then retry the login request + }else if (error?.userInfo["NSUnderlyingError"]?.code == -1005 || error?.code == 17020){ + + var alert = UIAlertController(title: "Network Error", message: "There has been a problem connecting to the server. This could be due to various reasons such as having a slow or non existent connection or using an anonymity tool like a VPN service. Would you like to attempt to reconnect?", preferredStyle: .Alert) + + alert.addAction(UIAlertAction(title: "OK", style: .Default, handler: {(action: UIAlertAction!) in + + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), {() -> Void in + var downloadGroup = dispatch_group_create() + dispatch_group_enter(downloadGroup) + dispatch_group_wait(downloadGroup, dispatch_time(DISPATCH_TIME_NOW, 5000000000)) + // Wait 5 seconds before trying again. + dispatch_group_leave(downloadGroup) + dispatch_async(dispatch_get_main_queue(), {() -> Void in + //Main Queue stuff here + //Redo the function that made the Request. + self.signInUser(self) + + }) + }) + })) + alert.addAction(UIAlertAction(title: "Cancel", style: .Cancel, handler: {(action: UIAlertAction!) in + })) + self.presentViewController(alert, animated: true, completion: nil) + + return } } else {