mirror of
https://bitbucket.org/vendoo/vendoo_v1.0.git
synced 2025-12-25 03:37:39 +00:00
Merge branch 'master'
Conflicts: Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This commit is contained in:
commit
74cffa4f47
Binary file not shown.
@ -10,11 +10,11 @@
|
|||||||
ignoreCount = "0"
|
ignoreCount = "0"
|
||||||
continueAfterRunningActions = "No"
|
continueAfterRunningActions = "No"
|
||||||
filePath = "Vendoo/ListingPreviewViewController.swift"
|
filePath = "Vendoo/ListingPreviewViewController.swift"
|
||||||
timestampString = "501292645.293697"
|
timestampString = "501865709.047213"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "617"
|
startingLineNumber = "629"
|
||||||
endingLineNumber = "617"
|
endingLineNumber = "629"
|
||||||
landmarkName = "publishItem(_:)"
|
landmarkName = "publishItem(_:)"
|
||||||
landmarkType = "5">
|
landmarkType = "5">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
@ -186,7 +186,7 @@
|
|||||||
moduleName = "Vendoo"
|
moduleName = "Vendoo"
|
||||||
usesParentBreakpointCondition = "Yes"
|
usesParentBreakpointCondition = "Yes"
|
||||||
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/CategoriesTableViewController.swift"
|
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/CategoriesTableViewController.swift"
|
||||||
timestampString = "501823413.391987"
|
timestampString = "501881724.556734"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "570"
|
startingLineNumber = "570"
|
||||||
@ -201,7 +201,7 @@
|
|||||||
moduleName = "Vendoo"
|
moduleName = "Vendoo"
|
||||||
usesParentBreakpointCondition = "Yes"
|
usesParentBreakpointCondition = "Yes"
|
||||||
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/CategoriesTableViewController.swift"
|
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/CategoriesTableViewController.swift"
|
||||||
timestampString = "501823413.392097"
|
timestampString = "501881724.556878"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "572"
|
startingLineNumber = "572"
|
||||||
@ -744,7 +744,7 @@
|
|||||||
moduleName = "Vendoo"
|
moduleName = "Vendoo"
|
||||||
usesParentBreakpointCondition = "Yes"
|
usesParentBreakpointCondition = "Yes"
|
||||||
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/SettingsViewController.swift"
|
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/SettingsViewController.swift"
|
||||||
timestampString = "501823413.408374"
|
timestampString = "501881724.576913"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "194"
|
startingLineNumber = "194"
|
||||||
@ -759,7 +759,7 @@
|
|||||||
moduleName = "Vendoo"
|
moduleName = "Vendoo"
|
||||||
usesParentBreakpointCondition = "Yes"
|
usesParentBreakpointCondition = "Yes"
|
||||||
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/SettingsViewController.swift"
|
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/SettingsViewController.swift"
|
||||||
timestampString = "501823413.408515"
|
timestampString = "501881724.577081"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "197"
|
startingLineNumber = "197"
|
||||||
@ -788,15 +788,15 @@
|
|||||||
<BreakpointProxy
|
<BreakpointProxy
|
||||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
<BreakpointContent
|
<BreakpointContent
|
||||||
shouldBeEnabled = "Yes"
|
shouldBeEnabled = "No"
|
||||||
ignoreCount = "0"
|
ignoreCount = "0"
|
||||||
continueAfterRunningActions = "No"
|
continueAfterRunningActions = "No"
|
||||||
filePath = "Vendoo/ItemImagePickerViewController.swift"
|
filePath = "Vendoo/ItemImagePickerViewController.swift"
|
||||||
timestampString = "501823514.544138"
|
timestampString = "501879828.267358"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "519"
|
startingLineNumber = "536"
|
||||||
endingLineNumber = "519"
|
endingLineNumber = "536"
|
||||||
landmarkName = "cancelNewListing(_:)"
|
landmarkName = "cancelNewListing(_:)"
|
||||||
landmarkType = "5">
|
landmarkType = "5">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
@ -840,11 +840,138 @@
|
|||||||
ignoreCount = "0"
|
ignoreCount = "0"
|
||||||
continueAfterRunningActions = "No"
|
continueAfterRunningActions = "No"
|
||||||
filePath = "Vendoo/ItemImagePickerViewController.swift"
|
filePath = "Vendoo/ItemImagePickerViewController.swift"
|
||||||
timestampString = "501824288.668123"
|
timestampString = "501879828.267358"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "167"
|
startingLineNumber = "537"
|
||||||
endingLineNumber = "167"
|
endingLineNumber = "537"
|
||||||
|
landmarkName = "cancelNewListing(_:)"
|
||||||
|
landmarkType = "5">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Vendoo/ListingPreviewViewController.swift"
|
||||||
|
timestampString = "501865709.047213"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "243"
|
||||||
|
endingLineNumber = "243"
|
||||||
|
landmarkName = "cancel(_:)"
|
||||||
|
landmarkType = "5">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Vendoo/HomeViewController.swift"
|
||||||
|
timestampString = "501867900.667754"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "16"
|
||||||
|
endingLineNumber = "16"
|
||||||
|
landmarkName = "HomeViewController"
|
||||||
|
landmarkType = "3">
|
||||||
|
<Locations>
|
||||||
|
<Location
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "Vendoo.HomeViewController.firebaseManager.getter : Vendoo.FirebaseManager"
|
||||||
|
moduleName = "Vendoo"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
|
||||||
|
timestampString = "501881724.580763"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "16"
|
||||||
|
endingLineNumber = "16"
|
||||||
|
offsetFromSymbolStart = "35">
|
||||||
|
</Location>
|
||||||
|
<Location
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "Vendoo.HomeViewController.init (nibName : Swift.Optional<Swift.String>, bundle : Swift.Optional<__ObjC.NSBundle>) -> Vendoo.HomeViewController"
|
||||||
|
moduleName = "Vendoo"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
|
||||||
|
timestampString = "501881724.580877"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "16"
|
||||||
|
endingLineNumber = "16"
|
||||||
|
offsetFromSymbolStart = "143">
|
||||||
|
</Location>
|
||||||
|
<Location
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
symbolName = "Vendoo.HomeViewController.init (coder : __ObjC.NSCoder) -> Swift.Optional<Vendoo.HomeViewController>"
|
||||||
|
moduleName = "Vendoo"
|
||||||
|
usesParentBreakpointCondition = "Yes"
|
||||||
|
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
|
||||||
|
timestampString = "501881724.580974"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "16"
|
||||||
|
endingLineNumber = "16"
|
||||||
|
offsetFromSymbolStart = "83">
|
||||||
|
</Location>
|
||||||
|
</Locations>
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Vendoo/FirebaseManager.swift"
|
||||||
|
timestampString = "501868545.010904"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "31"
|
||||||
|
endingLineNumber = "31"
|
||||||
|
landmarkName = "init()"
|
||||||
|
landmarkType = "5">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Vendoo/FirebaseManager.swift"
|
||||||
|
timestampString = "501868545.010904"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "34"
|
||||||
|
endingLineNumber = "34"
|
||||||
|
landmarkName = "init()"
|
||||||
|
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:)"
|
landmarkName = "prepareForSegue(_:sender:)"
|
||||||
landmarkType = "5">
|
landmarkType = "5">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
// FirebaseService.swift
|
// FirebaseService.swift
|
||||||
// Vendoo
|
// Vendoo
|
||||||
//
|
//
|
||||||
|
// This class is responsible for initializing a new user, as well as managing web request to both firebase database and data storage
|
||||||
// Created by Okechi Onyeje on 6/2/16.
|
// Created by Okechi Onyeje on 6/2/16.
|
||||||
// Copyright © 2016 Okechi Onyeje. All rights reserved.
|
// Copyright © 2016 Okechi Onyeje. All rights reserved.
|
||||||
//
|
//
|
||||||
@ -19,6 +20,7 @@ class FirebaseManager: NSObject {
|
|||||||
let user_email = ((NSUserDefaults.standardUserDefaults().objectForKey("email") as? String)!).stringByReplacingOccurrencesOfString(".", withString: "_")
|
let user_email = ((NSUserDefaults.standardUserDefaults().objectForKey("email") as? String)!).stringByReplacingOccurrencesOfString(".", withString: "_")
|
||||||
let storage = FIRStorage.storage()
|
let storage = FIRStorage.storage()
|
||||||
var indicator = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.WhiteLarge)
|
var indicator = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.WhiteLarge)
|
||||||
|
var firGroup = dispatch_group_create()
|
||||||
|
|
||||||
//let key: String!
|
//let key: String!
|
||||||
|
|
||||||
@ -26,18 +28,22 @@ class FirebaseManager: NSObject {
|
|||||||
super.init()
|
super.init()
|
||||||
indicator.color = UIColor.blueColor()
|
indicator.color = UIColor.blueColor()
|
||||||
//check if user has been created
|
//check if user has been created
|
||||||
self.ref.child("Users").observeSingleEventOfType(.Value, withBlock: { snapshot in
|
dispatch_group_enter(self.firGroup)
|
||||||
// do some stuff once
|
self.ref.child("Users").observeSingleEventOfType(.Value, withBlock: { snapshot in
|
||||||
|
// do some stuff once
|
||||||
if(!snapshot.hasChild(self.user_email)){
|
|
||||||
let user = ["name": (NSUserDefaults.standardUserDefaults().objectForKey("name") as? String)!, "user_Listings": "", "listing_Keys": "", "favorite_listings_keys": ""]
|
|
||||||
self.ref.child("Users").child(self.user_email).setValue(user)
|
|
||||||
|
|
||||||
}
|
if(!snapshot.hasChild(self.user_email)){
|
||||||
})
|
let user = ["name": (NSUserDefaults.standardUserDefaults().objectForKey("name") as? String)!, "user_Listings": "", "listing_Keys": "", "favorite_listings_keys": ""]
|
||||||
|
self.ref.child("Users").child(self.user_email).setValue(user, withCompletionBlock: {
|
||||||
|
(error, reference) -> Void in
|
||||||
|
|
||||||
|
dispatch_group_leave(self.firGroup)
|
||||||
|
})
|
||||||
|
|
||||||
|
}else{
|
||||||
|
dispatch_group_leave(self.firGroup)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class HomeViewController: UITabBarController {
|
|||||||
ServiceNotificationManager.delegate = self
|
ServiceNotificationManager.delegate = self
|
||||||
self.notificationsManager.setManagers(fbGraphManager, fireManager: firebaseManager, ebayManager: ebayGraphManager, etsyManager: etsyManager)
|
self.notificationsManager.setManagers(fbGraphManager, fireManager: firebaseManager, ebayManager: ebayGraphManager, etsyManager: etsyManager)
|
||||||
// Do any additional setup after loading the view.
|
// Do any additional setup after loading the view.
|
||||||
dispatch_async(dispatch_get_main_queue(), {
|
dispatch_group_notify(self.firebaseManager.firGroup, dispatch_get_main_queue(), {
|
||||||
|
|
||||||
//get all listing information for current user
|
//get all listing information for current user
|
||||||
self.firebaseManager.ref.child("Users/\(self.firebaseManager.user_email)").observeSingleEventOfType( .Value, withBlock: {
|
self.firebaseManager.ref.child("Users/\(self.firebaseManager.user_email)").observeSingleEventOfType( .Value, withBlock: {
|
||||||
|
|||||||
@ -134,43 +134,60 @@ extension ItemImagePickerViewController {
|
|||||||
print(self.itemDescription.text!)
|
print(self.itemDescription.text!)
|
||||||
print(self.possibleItemImageMain.image)
|
print(self.possibleItemImageMain.image)
|
||||||
print(self.itemPrice.text!)
|
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"
|
||||||
|
){
|
||||||
|
|
||||||
var dict: Dictionary<String, AnyObject!> = ["title":self.itemName.text!, "description":self.itemDescription.text!, "price":self.itemPrice.text!, "quantity":self.itemQuantity.text!]
|
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)
|
||||||
var counter = 0
|
alert.addAction(UIAlertAction(title: "OK", style: .Default, handler:{(action: UIAlertAction!) in alert.dismissViewControllerAnimated(true, completion: nil)}))
|
||||||
var images: [UIImageView] = []
|
|
||||||
for bool in self.itemImagesSelections {
|
|
||||||
if !bool {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
switch counter {
|
|
||||||
case 1:
|
|
||||||
images.append(self.possibleItemImage2)
|
|
||||||
break
|
|
||||||
case 2:
|
|
||||||
images.append(self.possibleItemImage3)
|
|
||||||
break
|
|
||||||
case 3:
|
|
||||||
images.append(self.possibleItemImage4)
|
|
||||||
break
|
|
||||||
case 4:
|
|
||||||
images.append(self.possibleItemImage5)
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
images.append(self.possibleItemImageMain)
|
|
||||||
}
|
|
||||||
counter += 1
|
|
||||||
}
|
|
||||||
|
|
||||||
dict["pictures"] = images
|
|
||||||
(segue.destinationViewController as! CategoriesTableViewController).setListingDictionary(dict)
|
|
||||||
|
|
||||||
if(self.isEditing) {
|
|
||||||
(segue.destinationViewController as! CategoriesTableViewController).setManagers((self.currentInformation["fbManager"] as? FacebookGraphAPIManager)!, fireManager: (self.currentInformation["firebaseManager"] as? FirebaseManager)!, ebayManager: (self.currentInformation["ebayManager"] as? EbayWebServiceManager)!, etsyManager: (self.currentInformation["etsyManager"] as? EtsyRESTAPIManager)!)
|
|
||||||
|
|
||||||
}else {
|
self.presentViewController(alert, animated: true, completion: nil)
|
||||||
(segue.destinationViewController as! CategoriesTableViewController).setManagers(((self.tabBarController as? HomeViewController)?.fbGraphManager)!,
|
|
||||||
fireManager: ((self.tabBarController as? HomeViewController)?.firebaseManager)!, ebayManager: ((self.tabBarController as? HomeViewController)?.ebayGraphManager)!,
|
}else{
|
||||||
etsyManager: ((self.tabBarController as? HomeViewController)?.etsyManager)!)
|
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] = []
|
||||||
|
for bool in self.itemImagesSelections {
|
||||||
|
if !bool {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
switch counter {
|
||||||
|
case 1:
|
||||||
|
images.append(self.possibleItemImage2)
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
images.append(self.possibleItemImage3)
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
images.append(self.possibleItemImage4)
|
||||||
|
break
|
||||||
|
case 4:
|
||||||
|
images.append(self.possibleItemImage5)
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
images.append(self.possibleItemImageMain)
|
||||||
|
}
|
||||||
|
counter += 1
|
||||||
|
}
|
||||||
|
|
||||||
|
dict["pictures"] = images
|
||||||
|
(segue.destinationViewController as! CategoriesTableViewController).setListingDictionary(dict)
|
||||||
|
|
||||||
|
if(self.isEditing) {
|
||||||
|
(segue.destinationViewController as! CategoriesTableViewController).setManagers((self.currentInformation["fbManager"] as? FacebookGraphAPIManager)!, fireManager: (self.currentInformation["firebaseManager"] as? FirebaseManager)!, ebayManager: (self.currentInformation["ebayManager"] as? EbayWebServiceManager)!, etsyManager: (self.currentInformation["etsyManager"] as? EtsyRESTAPIManager)!)
|
||||||
|
|
||||||
|
}else {
|
||||||
|
(segue.destinationViewController as! CategoriesTableViewController).setManagers(((self.tabBarController as? HomeViewController)?.fbGraphManager)!,
|
||||||
|
fireManager: ((self.tabBarController as? HomeViewController)?.firebaseManager)!, ebayManager: ((self.tabBarController as? HomeViewController)?.ebayGraphManager)!,
|
||||||
|
etsyManager: ((self.tabBarController as? HomeViewController)?.etsyManager)!)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -68,10 +68,22 @@ class ListingPreviewViewController: UIViewController {
|
|||||||
/*if(!self.networksDictionary["areNetworksChosen"]!) {
|
/*if(!self.networksDictionary["areNetworksChosen"]!) {
|
||||||
self.networks.hidden = true
|
self.networks.hidden = true
|
||||||
}*/
|
}*/
|
||||||
/*else if (self.itemViewState == "Editable") {
|
else if (self.itemViewState == "Editible") {
|
||||||
//self.cancel_backBtn.titleLabel?.text = "Back"
|
//self.cancel_backBtn.titleLabel?.text = "Back"
|
||||||
|
if(
|
||||||
}*/
|
self.itemTitle.text == "" ||
|
||||||
|
self.itemDescription.text == "" ||
|
||||||
|
self.itemPrice.text == "" ||
|
||||||
|
self.itemCategory.text == "" ||
|
||||||
|
self.itemQuantity == nil ||
|
||||||
|
self.itemPictureMain.image == nil ||
|
||||||
|
self.networks.numberOfItemsInSection(0) == 0
|
||||||
|
){
|
||||||
|
|
||||||
|
self.publishBtn.hidden = true
|
||||||
|
self.publishBtn.enabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
// Do any additional setup after loading the view.
|
// Do any additional setup after loading the view.
|
||||||
|
|
||||||
// Initialization code
|
// Initialization code
|
||||||
@ -233,7 +245,7 @@ extension ListingPreviewViewController {
|
|||||||
let vc = storyboard.instantiateViewControllerWithIdentifier("Reveal View Controller") as! SWRevealViewController
|
let vc = storyboard.instantiateViewControllerWithIdentifier("Reveal View Controller") as! SWRevealViewController
|
||||||
self.presentViewController(vc, animated: true, completion: nil)
|
self.presentViewController(vc, animated: true, completion: nil)
|
||||||
}
|
}
|
||||||
else if self.itemViewState == "Editable" || self.itemViewState == "NonEditable"{
|
else if self.itemViewState == "Editible" || self.itemViewState == "NonEditable"{
|
||||||
self.presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
|
self.presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,7 @@ class NetworksTableViewController: UIViewController {
|
|||||||
private var ebayManager: EbayWebServiceManager! = EbayWebServiceManager()
|
private var ebayManager: EbayWebServiceManager! = EbayWebServiceManager()
|
||||||
private var shouldShowDictionary: Dictionary<String, Bool> = ["ebay":false, "amazon":false,"etsy":false,"facebook":false]
|
private var shouldShowDictionary: Dictionary<String, Bool> = ["ebay":false, "amazon":false,"etsy":false,"facebook":false]
|
||||||
private var networkOrderSelection: [String] = []
|
private var networkOrderSelection: [String] = []
|
||||||
|
private var networkCount = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -81,6 +82,7 @@ class NetworksTableViewController: UIViewController {
|
|||||||
var string = ""
|
var string = ""
|
||||||
for (market, visibility) in self.shouldShowDictionary {
|
for (market, visibility) in self.shouldShowDictionary {
|
||||||
if visibility {
|
if visibility {
|
||||||
|
self.networkCount += 1
|
||||||
self.shouldShowDictionary[market] = !self.shouldShowDictionary[market]!
|
self.shouldShowDictionary[market] = !self.shouldShowDictionary[market]!
|
||||||
string = market
|
string = market
|
||||||
self.networkOrderSelection.append(market)
|
self.networkOrderSelection.append(market)
|
||||||
@ -126,9 +128,31 @@ extension NetworksTableViewController {
|
|||||||
// Pass the selected object to the new view controller.
|
// Pass the selected object to the new view controller.
|
||||||
|
|
||||||
if(segue.identifier == "ItemPreviewSegue"){
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
(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)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(segue.identifier == "EbaySettingsSegue") {
|
if(segue.identifier == "EbaySettingsSegue") {
|
||||||
|
|||||||
@ -61,13 +61,11 @@ extension SignUpViewController {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
||||||
//save user account
|
//save user account
|
||||||
NSUserDefaults.standardUserDefaults().setBool(true, forKey: "signedIn")
|
NSUserDefaults.standardUserDefaults().setBool(true, forKey: "signedIn")
|
||||||
NSUserDefaults.standardUserDefaults().setObject(self.email.text, forKey: "email")
|
NSUserDefaults.standardUserDefaults().setObject(self.email.text, forKey: "email")
|
||||||
NSUserDefaults.standardUserDefaults().setObject(self.name.text, forKey: "name")
|
NSUserDefaults.standardUserDefaults().setObject(self.name.text, forKey: "name")
|
||||||
|
|
||||||
|
|
||||||
//save user credentials in Keychain
|
//save user credentials in Keychain
|
||||||
do{
|
do{
|
||||||
try Locksmith.saveData(["pass": self.password.text!], forUserAccount: self.email.text!, inService: "vendoo")
|
try Locksmith.saveData(["pass": self.password.text!], forUserAccount: self.email.text!, inService: "vendoo")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user