Merged branch BUG-When-user-proceeds-to-“ListingPreview,Publish,Save"-on-the-Draft-Posting-sequence-crashes-due-to-no-images into master

This commit is contained in:
Okechi Onyeje 2016-11-26 15:16:39 -05:00
commit 2369d01cf2
5 changed files with 109 additions and 98 deletions

View File

@ -186,7 +186,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/CategoriesTableViewController.swift"
timestampString = "501868546.548886"
timestampString = "501881724.556734"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "570"
@ -201,7 +201,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/CategoriesTableViewController.swift"
timestampString = "501868546.549061"
timestampString = "501881724.556878"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "572"
@ -744,7 +744,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/SettingsViewController.swift"
timestampString = "501868546.567523"
timestampString = "501881724.576913"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "194"
@ -759,7 +759,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/SettingsViewController.swift"
timestampString = "501868546.567615"
timestampString = "501881724.577081"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "197"
@ -792,11 +792,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/ItemImagePickerViewController.swift"
timestampString = "501823514.544138"
timestampString = "501879828.267358"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "519"
endingLineNumber = "519"
startingLineNumber = "536"
endingLineNumber = "536"
landmarkName = "ItemImagePickerViewController"
landmarkType = "3">
</BreakpointContent>
@ -840,27 +840,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/ItemImagePickerViewController.swift"
timestampString = "501824288.668123"
timestampString = "501879828.267358"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "167"
endingLineNumber = "167"
landmarkName = "prepareForSegue(_:sender:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/ItemImagePickerViewController.swift"
timestampString = "501863821.46129"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "520"
endingLineNumber = "520"
startingLineNumber = "537"
endingLineNumber = "537"
landmarkName = "cancelNewListing(_:)"
landmarkType = "5">
</BreakpointContent>
@ -904,7 +888,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
timestampString = "501868546.571367"
timestampString = "501881724.580763"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "16"
@ -919,7 +903,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
timestampString = "501868546.571482"
timestampString = "501881724.580877"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "16"
@ -934,7 +918,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
timestampString = "501868546.571568"
timestampString = "501881724.580974"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "16"
@ -958,38 +942,6 @@
endingLineNumber = "31"
landmarkName = "init()"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FirebaseManager.init () -&gt; Vendoo.FirebaseManager"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FirebaseManager.swift"
timestampString = "501868546.572473"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "31"
endingLineNumber = "31"
offsetFromSymbolStart = "1491">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FirebaseManager.(init () -&gt; Vendoo.FirebaseManager).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FirebaseManager.swift"
timestampString = "501868546.572569"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "34"
endingLineNumber = "34"
offsetFromSymbolStart = "19">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
@ -1008,5 +960,21 @@
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/ItemImagePickerViewController.swift"
timestampString = "501880171.766869"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "138"
endingLineNumber = "138"
landmarkName = "prepareForSegue(_:sender:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -40,6 +40,8 @@ class FirebaseManager: NSObject {
dispatch_group_leave(self.firGroup)
})
}else{
dispatch_group_leave(self.firGroup)
}
})
}

View File

@ -135,7 +135,22 @@ extension ItemImagePickerViewController {
print(self.itemDescription.text!)
print(self.possibleItemImageMain.image)
print(self.itemPrice.text!)
if (
self.itemName.text! == "" ||
Int(self.itemQuantity.text!) == nil ||
Int(self.itemQuantity.text!) < 1 ||
self.itemPrice.text! == "" ||
Double(self.itemPrice.text!) == nil ||
Double(self.itemPrice.text!) < 0.30 ||
self.itemDescription.text! == "Description"
){
let alert = UIAlertController(title: "Required Information Missing", message: "To proceed with your listing, at least one image must be provided. Along with all provided fields including:\n Title\nDescription\nQuantity (must be greater than 0)\nPrice (must be greater than $0.30).", preferredStyle: .Alert)
alert.addAction(UIAlertAction(title: "OK", style: .Default, handler:{(action: UIAlertAction!) in alert.dismissViewControllerAnimated(true, completion: nil)}))
self.presentViewController(alert, animated: true, completion: nil)
}else{
var dict: Dictionary<String, AnyObject!> = ["title":self.itemName.text!, "description":self.itemDescription.text!, "price":self.itemPrice.text!, "quantity":self.itemQuantity.text!]
var counter = 0
var images: [UIImageView] = []
@ -173,6 +188,8 @@ extension ItemImagePickerViewController {
fireManager: ((self.tabBarController as? HomeViewController)?.firebaseManager)!, ebayManager: ((self.tabBarController as? HomeViewController)?.ebayGraphManager)!,
etsyManager: ((self.tabBarController as? HomeViewController)?.etsyManager)!)
}
}
}

View File

@ -35,6 +35,7 @@ class NetworksTableViewController: UIViewController {
private var ebayManager: EbayWebServiceManager! = EbayWebServiceManager()
private var shouldShowDictionary: Dictionary<String, Bool> = ["ebay":false, "amazon":false,"etsy":false,"facebook":false]
private var networkOrderSelection: [String] = []
private var networkCount = 0
@ -81,6 +82,7 @@ class NetworksTableViewController: UIViewController {
var string = ""
for (market, visibility) in self.shouldShowDictionary {
if visibility {
self.networkCount += 1
self.shouldShowDictionary[market] = !self.shouldShowDictionary[market]!
string = market
self.networkOrderSelection.append(market)
@ -126,9 +128,31 @@ extension NetworksTableViewController {
// Pass the selected object to the new view controller.
if(segue.identifier == "ItemPreviewSegue"){
if(networkCount > 0){
var count = 0;
for (_,v) in self.networksDictionary{
if v {
count += 1
}
}
if(count > 0){
(segue.destinationViewController as! ListingPreviewViewController).setDictionary(self.networksDictionary, itemdictionary: self.itemListingDictionary)
(segue.destinationViewController as! ListingPreviewViewController).setManagers(self.graphManager, fireManager: self.firManager, ebayManager: self.ebayManager, etsyManager: self.etsyManager)
}else{
let alert = UIAlertController(title: "No Networks Selected", message: "You have not selected any networks to publish on. At least 1 network must be selected to continue.", preferredStyle: .Alert)
alert.addAction(UIAlertAction(title: "OK", style: .Default, handler:{(action: UIAlertAction!) in alert.dismissViewControllerAnimated(true, completion: nil)}))
self.presentViewController(alert, animated: true, completion: nil)
}
}else{
let alert = UIAlertController(title: "No Networks Authorized", message: "You currently have no authorized networks to post on. You will not be able to publish this listing until at least 1 network has been authorized and selected for publishing.", preferredStyle: .Alert)
alert.addAction(UIAlertAction(title: "OK", style: .Default, handler:{(action: UIAlertAction!) in alert.dismissViewControllerAnimated(true, completion: nil)}))
self.presentViewController(alert, animated: true, completion: nil)
}
}
if(segue.identifier == "EbaySettingsSegue") {