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
1b3c8265e1
@ -31,6 +31,7 @@
|
||||
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 */; };
|
||||
3EB54E101DE1397A006D918B /* Not_TableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB54E0F1DE1397A006D918B /* Not_TableViewCell.swift */; };
|
||||
3EC325111CF703A600626C48 /* ItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EC325101CF703A600626C48 /* ItemCell.swift */; };
|
||||
3EC325151CF7104300626C48 /* ItemTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EC325141CF7104300626C48 /* ItemTableViewController.swift */; };
|
||||
3EC3251E1CF734C100626C48 /* NetworksTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EC3251D1CF734C100626C48 /* NetworksTableViewController.swift */; };
|
||||
@ -101,6 +102,7 @@
|
||||
3EA668A21D02ECB100EE57A8 /* libicucore.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libicucore.tbd; path = usr/lib/libicucore.tbd; sourceTree = SDKROOT; };
|
||||
3EB2F5151CF442CF002E6D2C /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
||||
3EB54E0D1DE08A2E006D918B /* NetworkCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkCollectionViewCell.swift; sourceTree = "<group>"; };
|
||||
3EB54E0F1DE1397A006D918B /* Not_TableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Not_TableViewCell.swift; sourceTree = "<group>"; };
|
||||
3EC325101CF703A600626C48 /* ItemCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemCell.swift; sourceTree = "<group>"; };
|
||||
3EC325141CF7104300626C48 /* ItemTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemTableViewController.swift; sourceTree = "<group>"; };
|
||||
3EC3251D1CF734C100626C48 /* NetworksTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworksTableViewController.swift; sourceTree = "<group>"; };
|
||||
@ -339,6 +341,7 @@
|
||||
children = (
|
||||
3EE734E71DCD34B900F771AE /* NotificationTableViewCell.swift */,
|
||||
3EE734E51DCD34AE00F771AE /* NotificationsViewController.swift */,
|
||||
3EB54E0F1DE1397A006D918B /* Not_TableViewCell.swift */,
|
||||
);
|
||||
name = Notifications;
|
||||
sourceTree = "<group>";
|
||||
@ -776,6 +779,7 @@
|
||||
3E1DC3CF1D42328C0091BC60 /* CategoryCell.swift in Sources */,
|
||||
3EC325111CF703A600626C48 /* ItemCell.swift in Sources */,
|
||||
3E3A004A1D76680E00A3A5B6 /* ServiceNotificationManager.swift in Sources */,
|
||||
3EB54E101DE1397A006D918B /* Not_TableViewCell.swift in Sources */,
|
||||
3EA668A11D02836C00EE57A8 /* EbayWebServiceManager.swift in Sources */,
|
||||
3EF422B21D73262000B9A3EB /* UserCell.swift in Sources */,
|
||||
3ECEDB871CF9C722003566B3 /* ListingPreviewViewController.swift in Sources */,
|
||||
|
||||
Binary file not shown.
@ -186,7 +186,7 @@
|
||||
moduleName = "Vendoo"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/CategoriesTableViewController.swift"
|
||||
timestampString = "501301326.689405"
|
||||
timestampString = "501440965.919907"
|
||||
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 = "501301326.689558"
|
||||
timestampString = "501440965.920274"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "572"
|
||||
@ -663,12 +663,124 @@
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Vendoo/MenuPanelViewController.swift"
|
||||
timestampString = "501301326.548836"
|
||||
filePath = "Vendoo/HomeViewController.swift"
|
||||
timestampString = "501429562.960347"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "111"
|
||||
endingLineNumber = "111"
|
||||
startingLineNumber = "41"
|
||||
endingLineNumber = "41"
|
||||
landmarkName = "viewDidLoad()"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Vendoo/SettingsViewController.swift"
|
||||
timestampString = "501431362.91266"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "196"
|
||||
endingLineNumber = "196"
|
||||
landmarkName = "tableView(_:didSelectRowAtIndexPath:)"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Vendoo/SettingsViewController.swift"
|
||||
timestampString = "501431365.398348"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "197"
|
||||
endingLineNumber = "197"
|
||||
landmarkName = "tableView(_:didSelectRowAtIndexPath:)"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Vendoo/SettingsViewController.swift"
|
||||
timestampString = "501431572.028953"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "194"
|
||||
endingLineNumber = "194"
|
||||
landmarkName = "tableView(_:didSelectRowAtIndexPath:)"
|
||||
landmarkType = "5">
|
||||
<Locations>
|
||||
<Location
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "Vendoo.SettingsViewController.(tableView (__ObjC.UITableView, didSelectRowAtIndexPath : __ObjC.NSIndexPath) -> ()).(closure #5)"
|
||||
moduleName = "Vendoo"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/SettingsViewController.swift"
|
||||
timestampString = "501440965.932575"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "194"
|
||||
endingLineNumber = "194"
|
||||
offsetFromSymbolStart = "2591">
|
||||
</Location>
|
||||
<Location
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "Vendoo.SettingsViewController.(tableView (__ObjC.UITableView, didSelectRowAtIndexPath : __ObjC.NSIndexPath) -> ()).(closure #5).(closure #1)"
|
||||
moduleName = "Vendoo"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/SettingsViewController.swift"
|
||||
timestampString = "501440965.932664"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "197"
|
||||
endingLineNumber = "197"
|
||||
offsetFromSymbolStart = "34">
|
||||
</Location>
|
||||
</Locations>
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Vendoo/HomeViewController.swift"
|
||||
timestampString = "501438721.606962"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "172"
|
||||
endingLineNumber = "172"
|
||||
landmarkName = "viewDidLoad()"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Vendoo/MenuPanelViewController.swift"
|
||||
timestampString = "501441064.896937"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "116"
|
||||
endingLineNumber = "116"
|
||||
landmarkName = "tableView(_:cellForRowAtIndexPath:)"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
|
||||
BIN
Vendoo/.DS_Store
vendored
BIN
Vendoo/.DS_Store
vendored
Binary file not shown.
@ -38,16 +38,34 @@ class HomeViewController: UITabBarController {
|
||||
let listingDict = userDict!["user_Listings"] as? [String : AnyObject]
|
||||
|
||||
//sync notifications
|
||||
/*if userDict!["notifications"] != nil {
|
||||
if userDict!["notifications"] != nil {
|
||||
self.notifications = []
|
||||
for (_, v) in userDict!["notifications"] as! [String : AnyObject] {
|
||||
if v["seen"] as! Bool == false {
|
||||
self.notifications.append(v as! Dictionary<String, AnyObject>)
|
||||
if v["seen"] as! Bool == false/*add network visibility as well*/{
|
||||
var is_networkAuth = false
|
||||
switch((v["network"] as! String)){
|
||||
case "ebay":
|
||||
is_networkAuth = NSUserDefaults.standardUserDefaults().boolForKey("ebayAuthorized")
|
||||
break
|
||||
case "etsy":
|
||||
is_networkAuth = NSUserDefaults.standardUserDefaults().boolForKey("etsyAuthorized")
|
||||
break
|
||||
case "facebook" :
|
||||
is_networkAuth = NSUserDefaults.standardUserDefaults().boolForKey("fbAuthorized")
|
||||
break
|
||||
case "amazon":
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
if is_networkAuth {
|
||||
self.notifications.append(v as! Dictionary<String, AnyObject>)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NSUserDefaults.standardUserDefaults().setObject(self.notifications, forKey: "notifications")
|
||||
}*/
|
||||
}
|
||||
|
||||
NSUserDefaults.standardUserDefaults().setObject(userDict!["name"] as? String, forKey: "name")
|
||||
|
||||
@ -151,6 +169,13 @@ class HomeViewController: UITabBarController {
|
||||
NSNotificationCenter.defaultCenter().postNotificationName("finished_fetching_listings", object: nil)
|
||||
self.notificationsManager.setListings(self.userListings)
|
||||
self.notificationsManager.startServicePolling()
|
||||
/*self.notificationsManager.startServicePolling({
|
||||
(_,_) -> Void in
|
||||
NSNotificationCenter.defaultCenter().postNotificationName("finished_fetching_listings", object: nil)
|
||||
|
||||
|
||||
})*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1393,7 +1393,7 @@
|
||||
<outlet property="name" destination="QxU-Ol-czq" id="GGJ-j1-f1P"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Notifications_Cell" id="TpL-A6-BYb">
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Notifications_Cell" id="TpL-A6-BYb" customClass="Not_TableViewCell" customModule="Vendoo" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="45" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="TpL-A6-BYb" id="8n5-6b-Lkb">
|
||||
@ -1421,6 +1421,7 @@
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="count" destination="YAq-k9-mKp" id="h9I-UA-fQW"/>
|
||||
<segue destination="RA5-cu-shk" kind="custom" customClass="SWRevealViewControllerSeguePushController" id="Yor-9j-5ft"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
@ -1567,7 +1568,7 @@
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="notification_cell" rowHeight="69" id="9G8-XI-ptI" customClass="NotificationTableViewCell" customModule="Vendoo" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="72" width="375" height="69"/>
|
||||
<rect key="frame" x="0.0" y="92" width="375" height="69"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9G8-XI-ptI" id="r3f-6Q-p1g">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="68.5"/>
|
||||
@ -1643,7 +1644,7 @@
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Change_Pass_Cell" id="ceq-sl-ClT">
|
||||
<rect key="frame" x="0.0" y="72" width="375" height="44"/>
|
||||
<rect key="frame" x="0.0" y="92" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ceq-sl-ClT" id="Waq-fu-UxD">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
|
||||
@ -1660,7 +1661,7 @@
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Delete_Account_Cell" id="Lha-cf-Sfc">
|
||||
<rect key="frame" x="0.0" y="116" width="375" height="44"/>
|
||||
<rect key="frame" x="0.0" y="136" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Lha-cf-Sfc" id="kmF-Sb-d0c">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
|
||||
@ -2418,11 +2419,11 @@
|
||||
<image name="start" width="50" height="50"/>
|
||||
</resources>
|
||||
<inferredMetricsTieBreakers>
|
||||
<segue reference="rkZ-c8-XJc"/>
|
||||
<segue reference="nUj-1v-ftF"/>
|
||||
<segue reference="Sz0-BH-2me"/>
|
||||
<segue reference="syc-IR-LNQ"/>
|
||||
<segue reference="nWA-7e-2Ec"/>
|
||||
<segue reference="NOz-ya-avj"/>
|
||||
<segue reference="nUj-1v-ftF"/>
|
||||
<segue reference="rkZ-c8-XJc"/>
|
||||
<segue reference="KKl-Gj-ZVc"/>
|
||||
</inferredMetricsTieBreakers>
|
||||
<color key="tintColor" red="0.2784313725" green="0.80392156859999997" blue="0.68235294120000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
|
||||
@ -11,6 +11,7 @@ import FirebaseAuth
|
||||
import Locksmith
|
||||
|
||||
class MenuPanelViewController: UIViewController{
|
||||
var count = (NSUserDefaults.standardUserDefaults().objectForKey("notifications") == nil ? 0 : (NSUserDefaults.standardUserDefaults().objectForKey("notifications") as! [Dictionary<String, AnyObject>]).count)
|
||||
|
||||
//Outlets
|
||||
@IBOutlet weak var table: UITableView!
|
||||
@ -107,8 +108,10 @@ extension MenuPanelViewController: UITableViewDataSource
|
||||
(cell as! UserCell).email.text = (NSUserDefaults.standardUserDefaults().objectForKey("email") as? String)!
|
||||
break
|
||||
case 1:
|
||||
cell = self.table.dequeueReusableCellWithIdentifier("Notifications_Cell")!
|
||||
break
|
||||
let cellN: Not_TableViewCell!
|
||||
cellN = self.table.dequeueReusableCellWithIdentifier("Notifications_Cell")! as! Not_TableViewCell
|
||||
cellN.count.text = "\(count)"
|
||||
return cellN
|
||||
case 2:
|
||||
cell = self.table.dequeueReusableCellWithIdentifier("Settings_Cell")!
|
||||
break
|
||||
|
||||
25
Vendoo/Not_TableViewCell.swift
Normal file
25
Vendoo/Not_TableViewCell.swift
Normal file
@ -0,0 +1,25 @@
|
||||
//
|
||||
// TableViewCell.swift
|
||||
// Vendoo
|
||||
//
|
||||
// Created by Okechi Onyeje on 11/19/16.
|
||||
// Copyright © 2016 Okechi Onyeje. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class Not_TableViewCell: UITableViewCell {
|
||||
@IBOutlet weak var count: UILabel!
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
override func setSelected(selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
}
|
||||
@ -9,13 +9,15 @@
|
||||
import UIKit
|
||||
import Locksmith
|
||||
import FirebaseAuth
|
||||
import FirebaseDatabase
|
||||
import FirebaseStorage
|
||||
|
||||
class SettingsViewController: UIViewController {
|
||||
|
||||
//IBOutlet
|
||||
@IBOutlet weak var closeButton: UIBarButtonItem!
|
||||
@IBOutlet weak var table: UITableView!
|
||||
|
||||
var firbase = FirebaseManager()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
@ -184,6 +186,74 @@ extension SettingsViewController: UITableViewDelegate {
|
||||
|
||||
//put in deletion code later
|
||||
print("account deleted, add in deletion code as well as deauthorization code for any network currently authorized")
|
||||
|
||||
|
||||
|
||||
//get all listing information for current user
|
||||
print((NSUserDefaults.standardUserDefaults().objectForKey("email") as? String)!)
|
||||
self.firbase.ref.child("Users/\(self.firbase.user_email)").observeSingleEventOfType( .Value, withBlock: {
|
||||
(snapshot) -> Void in
|
||||
|
||||
let userDict = snapshot.value as? [String : AnyObject]
|
||||
let listingDict = userDict!["user_Listings"] as? [String : AnyObject]
|
||||
|
||||
if listingDict != nil {
|
||||
for (key, values) in listingDict! {
|
||||
self.firbase.ref.child("Global_listings").child(key).removeValue()
|
||||
FIRStorage.storage().referenceForURL((userDict!["image_storage"] as? String)!).child("images/\(key)").deleteWithCompletion({
|
||||
(error) -> Void in
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
self.firbase.ref.child("Users").child(self.firbase.user_email).removeValueWithCompletionBlock({
|
||||
(error, ref) -> Void in
|
||||
|
||||
if error == nil {
|
||||
FIRAuth.auth()?.currentUser?.deleteWithCompletion({
|
||||
(profile) -> Void in
|
||||
|
||||
do{
|
||||
try Locksmith.deleteDataForUserAccount((NSUserDefaults.standardUserDefaults().objectForKey("email") as? String)!, inService: "vendoo")
|
||||
|
||||
do {
|
||||
try Locksmith.deleteDataForUserAccount((NSUserDefaults.standardUserDefaults().objectForKey("email") as? String)!, inService: "vendoo_oauth_ebay")
|
||||
}catch {
|
||||
(error)
|
||||
print(error)
|
||||
}
|
||||
|
||||
do {
|
||||
try Locksmith.deleteDataForUserAccount((NSUserDefaults.standardUserDefaults().objectForKey("email") as? String)!, inService: "vendoo_oauth_etsy")
|
||||
}catch {
|
||||
(error)
|
||||
print(error)
|
||||
}
|
||||
|
||||
do {
|
||||
try Locksmith.deleteDataForUserAccount((NSUserDefaults.standardUserDefaults().objectForKey("email") as? String)!, inService: "vendoo_oauth_amazon")
|
||||
}catch {
|
||||
(error)
|
||||
print(error)
|
||||
}
|
||||
|
||||
for key in Array(NSUserDefaults.standardUserDefaults().dictionaryRepresentation().keys) {
|
||||
NSUserDefaults.standardUserDefaults().removeObjectForKey(key)
|
||||
}
|
||||
|
||||
let vc = self.storyboard?.instantiateViewControllerWithIdentifier("SignInViewController")
|
||||
self.presentViewController(vc!, animated: true, completion: nil)
|
||||
}
|
||||
catch{
|
||||
(error)
|
||||
print(error)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
alert.dismissViewControllerAnimated(true, completion: nil)
|
||||
}else{
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user