added new storyboard started working on posting to ebay and etsy and implementing default settings

This commit is contained in:
Okechi Onyeje 2016-07-10 10:58:37 -04:00
parent 8a9da0a7df
commit 5abcd1130c
64 changed files with 1984 additions and 236 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -12,6 +12,8 @@
3E1AA4301D0D9B3F005FCCBB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3E1AA42F1D0D9B3F005FCCBB /* Main.storyboard */; }; 3E1AA4301D0D9B3F005FCCBB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3E1AA42F1D0D9B3F005FCCBB /* Main.storyboard */; };
3E1AA4321D0DA071005FCCBB /* MenuPanelViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E1AA4311D0DA071005FCCBB /* MenuPanelViewController.swift */; }; 3E1AA4321D0DA071005FCCBB /* MenuPanelViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E1AA4311D0DA071005FCCBB /* MenuPanelViewController.swift */; };
3E1AA4351D0DD173005FCCBB /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E1AA4341D0DD173005FCCBB /* SettingsViewController.swift */; }; 3E1AA4351D0DD173005FCCBB /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E1AA4341D0DD173005FCCBB /* SettingsViewController.swift */; };
3E1B1F091D24926C00DBCF08 /* EbaySettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E1B1F081D24926C00DBCF08 /* EbaySettingsViewController.swift */; };
3E1B1F0B1D2493EE00DBCF08 /* EtsySettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E1B1F0A1D2493EE00DBCF08 /* EtsySettingsViewController.swift */; };
3E4897D11D0067030069F742 /* FirebaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E4897D01D0067030069F742 /* FirebaseManager.swift */; }; 3E4897D11D0067030069F742 /* FirebaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E4897D01D0067030069F742 /* FirebaseManager.swift */; };
3E6CC3571CF2A94B00E00A70 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6CC3561CF2A94B00E00A70 /* AppDelegate.swift */; }; 3E6CC3571CF2A94B00E00A70 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6CC3561CF2A94B00E00A70 /* AppDelegate.swift */; };
3E6CC3591CF2A94B00E00A70 /* SignInViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6CC3581CF2A94B00E00A70 /* SignInViewController.swift */; }; 3E6CC3591CF2A94B00E00A70 /* SignInViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6CC3581CF2A94B00E00A70 /* SignInViewController.swift */; };
@ -67,6 +69,8 @@
3E1AA42F1D0D9B3F005FCCBB /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; }; 3E1AA42F1D0D9B3F005FCCBB /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
3E1AA4311D0DA071005FCCBB /* MenuPanelViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuPanelViewController.swift; sourceTree = "<group>"; }; 3E1AA4311D0DA071005FCCBB /* MenuPanelViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuPanelViewController.swift; sourceTree = "<group>"; };
3E1AA4341D0DD173005FCCBB /* SettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; }; 3E1AA4341D0DD173005FCCBB /* SettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
3E1B1F081D24926C00DBCF08 /* EbaySettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EbaySettingsViewController.swift; sourceTree = "<group>"; };
3E1B1F0A1D2493EE00DBCF08 /* EtsySettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EtsySettingsViewController.swift; sourceTree = "<group>"; };
3E4897D01D0067030069F742 /* FirebaseManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FirebaseManager.swift; sourceTree = "<group>"; }; 3E4897D01D0067030069F742 /* FirebaseManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FirebaseManager.swift; sourceTree = "<group>"; };
3E6CC3531CF2A94B00E00A70 /* Vendoo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Vendoo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 3E6CC3531CF2A94B00E00A70 /* Vendoo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Vendoo.app; sourceTree = BUILT_PRODUCTS_DIR; };
3E6CC3561CF2A94B00E00A70 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 3E6CC3561CF2A94B00E00A70 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@ -230,6 +234,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
3E7CF4021CF644E400F486B2 /* EtsyObjects */, 3E7CF4021CF644E400F486B2 /* EtsyObjects */,
3E1B1F0A1D2493EE00DBCF08 /* EtsySettingsViewController.swift */,
3E7CF4001CF6366300F486B2 /* EtsyRESTAPIManager.swift */, 3E7CF4001CF6366300F486B2 /* EtsyRESTAPIManager.swift */,
); );
name = EtsyServices; name = EtsyServices;
@ -248,6 +253,7 @@
children = ( children = (
3EA668951D026E4000EE57A8 /* ObjC */, 3EA668951D026E4000EE57A8 /* ObjC */,
3EA668A01D02836C00EE57A8 /* EbayWebServiceManager.swift */, 3EA668A01D02836C00EE57A8 /* EbayWebServiceManager.swift */,
3E1B1F081D24926C00DBCF08 /* EbaySettingsViewController.swift */,
); );
name = EbayServices; name = EbayServices;
sourceTree = "<group>"; sourceTree = "<group>";
@ -631,11 +637,13 @@
3EC325111CF703A600626C48 /* ItemCell.swift in Sources */, 3EC325111CF703A600626C48 /* ItemCell.swift in Sources */,
3EA668A11D02836C00EE57A8 /* EbayWebServiceManager.swift in Sources */, 3EA668A11D02836C00EE57A8 /* EbayWebServiceManager.swift in Sources */,
3ECEDB871CF9C722003566B3 /* ListingPreviewViewController.swift in Sources */, 3ECEDB871CF9C722003566B3 /* ListingPreviewViewController.swift in Sources */,
3E1B1F0B1D2493EE00DBCF08 /* EtsySettingsViewController.swift in Sources */,
3EC325231CF7DA5500626C48 /* HomeViewController.swift in Sources */, 3EC325231CF7DA5500626C48 /* HomeViewController.swift in Sources */,
3EC3252D1CF894C400626C48 /* ItemImagePickerViewController.swift in Sources */, 3EC3252D1CF894C400626C48 /* ItemImagePickerViewController.swift in Sources */,
3E7CF4011CF6366300F486B2 /* EtsyRESTAPIManager.swift in Sources */, 3E7CF4011CF6366300F486B2 /* EtsyRESTAPIManager.swift in Sources */,
3EC325151CF7104300626C48 /* ItemTableViewController.swift in Sources */, 3EC325151CF7104300626C48 /* ItemTableViewController.swift in Sources */,
3EFB0E331D0B968300A05D7A /* SideMenuView.swift in Sources */, 3EFB0E331D0B968300A05D7A /* SideMenuView.swift in Sources */,
3E1B1F091D24926C00DBCF08 /* EbaySettingsViewController.swift in Sources */,
3E6CC3591CF2A94B00E00A70 /* SignInViewController.swift in Sources */, 3E6CC3591CF2A94B00E00A70 /* SignInViewController.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;

View File

@ -19,5 +19,37 @@
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "488937324.611765"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "722"
endingLineNumber = "722"
landmarkName = "toggleAuth(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "488937324.611765"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "737"
endingLineNumber = "737"
landmarkName = "toggleAuth(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints> </Breakpoints>
</Bucket> </Bucket>

BIN
Vendoo/.DS_Store vendored

Binary file not shown.

View File

0
Vendoo/Assets.xcassets/Contents.json Normal file → Executable file
View File

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Facebook login@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Screen Shot 2016-06-28 at 1.03.30 AM.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Plus Math-100.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "amazon_grey@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

2
Vendoo/Assets.xcassets/amazon_icon.imageset/Contents.json vendored Normal file → Executable file
View File

@ -6,7 +6,7 @@
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "amazon-icon.png", "filename" : "amazon@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "camera@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Delete-100.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Delete-500.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "circle2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "circle3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ebay_grey@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

2
Vendoo/Assets.xcassets/ebay_icon.imageset/Contents.json vendored Normal file → Executable file
View File

@ -6,7 +6,7 @@
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "ebay-icon.png", "filename" : "ebay@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Etsy_grey@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

2
Vendoo/Assets.xcassets/etsy_icon.imageset/Contents.json vendored Normal file → Executable file
View File

@ -6,7 +6,7 @@
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "Etsy-icon.png", "filename" : "Etsy@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Facebook_grey@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

2
Vendoo/Assets.xcassets/facebook_icon.imageset/Contents.json vendored Normal file → Executable file
View File

@ -6,7 +6,7 @@
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "facebook-icon-small-1.png", "filename" : "Facebook@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "faq.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

0
Vendoo/Assets.xcassets/first.imageset/Contents.json vendored Normal file → Executable file
View File

0
Vendoo/Assets.xcassets/first.imageset/first.pdf vendored Normal file → Executable file
View File

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Items@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "marketplaces@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Hamburger button@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Dollar@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

0
Vendoo/Assets.xcassets/second.imageset/Contents.json vendored Normal file → Executable file
View File

0
Vendoo/Assets.xcassets/second.imageset/second.pdf vendored Normal file → Executable file
View File

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Settings@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "About-100.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "About-500.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,47 @@
//
// EbaySettingsViewController.swift
// Vendoo
//
// Created by Okechi Onyeje on 6/29/16.
// Copyright © 2016 Okechi Onyeje. All rights reserved.
//
import UIKit
class EbaySettingsViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// 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.
}
*/
}
//MARK:- IBActions
extension EbaySettingsViewController {
@IBAction func navigateBack(sender: AnyObject){
self.dismissViewControllerAnimated(true, completion: nil)
}
}

View File

@ -0,0 +1,46 @@
//
// EtsySettingsViewController.swift
// Vendoo
//
// Created by Okechi Onyeje on 6/29/16.
// Copyright © 2016 Okechi Onyeje. All rights reserved.
//
import UIKit
class EtsySettingsViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// 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.
}
*/
}
//MARK:- IBActions
extension EtsySettingsViewController {
@IBAction func navigateBack(sender: AnyObject){
self.dismissViewControllerAnimated(true, completion: nil)
}
}

1607
Vendoo/Main.storyboard Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,8 @@ import UIKit
class EbayTableViewCell: UITableViewCell { class EbayTableViewCell: UITableViewCell {
@IBOutlet weak var networkToggle: UISwitch! @IBOutlet weak var networkToggle: UISwitch!
@IBOutlet weak var authorizeBtn: UIButton!
@IBOutlet weak var settingsBtn: UIButton!
override func awakeFromNib() { override func awakeFromNib() {
@ -27,6 +29,10 @@ class EbayTableViewCell: UITableViewCell {
class AmazonTableViewCell: UITableViewCell { class AmazonTableViewCell: UITableViewCell {
@IBOutlet weak var networkToggle: UISwitch! @IBOutlet weak var networkToggle: UISwitch!
@IBOutlet weak var authorizeBtn: UIButton!
@IBOutlet weak var settingsBtn: UIButton!
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
@ -43,6 +49,9 @@ class AmazonTableViewCell: UITableViewCell {
class EtsyTableViewCell: UITableViewCell { class EtsyTableViewCell: UITableViewCell {
@IBOutlet weak var networkToggle: UISwitch! @IBOutlet weak var networkToggle: UISwitch!
@IBOutlet weak var authorizeBtn: UIButton!
@IBOutlet weak var settingsBtn: UIButton!
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
@ -59,6 +68,10 @@ class EtsyTableViewCell: UITableViewCell {
class FBTableViewCell: UITableViewCell { class FBTableViewCell: UITableViewCell {
@IBOutlet weak var networkToggle: UISwitch! @IBOutlet weak var networkToggle: UISwitch!
@IBOutlet weak var authorizeBtn: UIButton!
@IBOutlet weak var settingsBtn: UIButton!
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()

View File

@ -162,8 +162,14 @@ extension NetworksTableViewController: UITableViewDataSource {
cell = (self.tableView.dequeueReusableCellWithIdentifier("ebay", forIndexPath: indexPath) as! EbayTableViewCell) cell = (self.tableView.dequeueReusableCellWithIdentifier("ebay", forIndexPath: indexPath) as! EbayTableViewCell)
if(((self.tabBarController as? HomeViewController)?.ebayGraphManager.isAuthorized)!){ if(((self.tabBarController as? HomeViewController)?.ebayGraphManager.isAuthorized)!){
dispatch_async(dispatch_get_main_queue(), {
(cell as! EbayTableViewCell).authorizeBtn.setTitle("Logout", forState: UIControlState.Normal)
(cell as! EbayTableViewCell).networkToggle.setOn(true, animated: false) })
//(cell as! EbayTableViewCell).networkToggle.setOn(true, animated: false)
}else{
(cell as! EbayTableViewCell).settingsBtn.enabled = false
(cell as! EbayTableViewCell).settingsBtn.hidden = true
} }
break break
@ -177,8 +183,15 @@ extension NetworksTableViewController: UITableViewDataSource {
let tabBar = self.tabBarController let tabBar = self.tabBarController
if(((tabBar as? HomeViewController)?.etsyManager.isAuthorized)!){ if(((tabBar as? HomeViewController)?.etsyManager.isAuthorized)!){
dispatch_async(dispatch_get_main_queue(), {
(cell as! EtsyTableViewCell).authorizeBtn.setTitle("Logout", forState: UIControlState.Normal)
(cell as! EtsyTableViewCell).networkToggle.setOn(true, animated: false) //(cell as! EtsyTableViewCell).networkToggle.setOn(true, animated: false)
})
}else{
(cell as! EtsyTableViewCell).settingsBtn.enabled = false
(cell as! EtsyTableViewCell).settingsBtn.hidden = true
} }
break break
default: default:
@ -187,8 +200,15 @@ extension NetworksTableViewController: UITableViewDataSource {
let tabBar = self.tabBarController let tabBar = self.tabBarController
if(((tabBar as? HomeViewController)?.fbGraphManager.isAuthorized)!){ if(((tabBar as? HomeViewController)?.fbGraphManager.isAuthorized)!){
dispatch_async(dispatch_get_main_queue(), {
(cell as! FBTableViewCell).networkToggle.setOn(true, animated: false) (cell as! FBTableViewCell).authorizeBtn.setTitle("Logout", forState: UIControlState.Normal)
})
//(cell as! FBTableViewCell).networkToggle.setOn(true, animated: false)
}else{
dispatch_async(dispatch_get_main_queue(), {
(cell as! FBTableViewCell).settingsBtn.enabled = false
(cell as! FBTableViewCell).settingsBtn.hidden = true
})
} }
break break
@ -695,3 +715,70 @@ extension NetworksTableViewController: UIWebViewDelegate {
} }
} }
extension NetworksTableViewController {
@IBAction func toggleAuth(sender: UIButton){
print(sender.superview!.superview!.classForCoder)
//Authorize app
if(sender.titleLabel?.text == "Login") {
switch (sender.superview?.superview?.classForCoder){
case is EbayTableViewCell.Type:
let tabBar = self.tabBarController
((tabBar as? HomeViewController)?.ebayGraphManager.authorizeApp())!
dispatch_async(dispatch_get_main_queue(), {
sender.setTitle("Logout", forState: UIControlState.Normal)
(sender.superview?.superview as! EbayTableViewCell).settingsBtn.enabled = true
(sender.superview?.superview as! EbayTableViewCell).settingsBtn.hidden = false
})
break
case is AmazonTableViewCell.Type:
break
case is EtsyTableViewCell.Type:
let tabBar = self.tabBarController
((tabBar as? HomeViewController)?.etsyManager.authorizeApp(self))!
dispatch_async(dispatch_get_main_queue(), {
sender.setTitle("Logout", forState: UIControlState.Normal)
(sender.superview?.superview as! EtsyTableViewCell).settingsBtn.enabled = true
(sender.superview?.superview as! EtsyTableViewCell).settingsBtn.hidden = false
})
break
case is FBTableViewCell.Type:
break
default:
break
}
}
//DeAuthorize app
else {
switch (sender.superview?.superview?.classForCoder){
case is EbayTableViewCell.Type:
let tabBar = self.tabBarController
((tabBar as? HomeViewController)?.ebayGraphManager.deauthorizeApp())!
dispatch_async(dispatch_get_main_queue(), {
sender.setTitle("Login", forState: UIControlState.Normal)
(sender.superview?.superview as! EbayTableViewCell).settingsBtn.enabled = false
(sender.superview?.superview as! EbayTableViewCell).settingsBtn.hidden = true
})
break
case is AmazonTableViewCell.Type:
break
case is EtsyTableViewCell.Type:
let tabBar = self.tabBarController
((tabBar as? HomeViewController)?.etsyManager.deAuthorizeApp(self))!
dispatch_async(dispatch_get_main_queue(), {
sender.setTitle("Login", forState: UIControlState.Normal)
(sender.superview?.superview as! EtsyTableViewCell).settingsBtn.enabled = false
(sender.superview?.superview as! EtsyTableViewCell).settingsBtn.hidden = true
})
break
case is FBTableViewCell.Type:
break
default:
break
}
}
}
}