mirror of
https://bitbucket.org/vendoo/vendoo_v1.0.git
synced 2025-12-25 11:47:40 +00:00
History Segment and Sold and Unsold filter implemented
This commit is contained in:
parent
88e2de116f
commit
986e20407b
Binary file not shown.
@ -10,43 +10,11 @@
|
|||||||
ignoreCount = "0"
|
ignoreCount = "0"
|
||||||
continueAfterRunningActions = "No"
|
continueAfterRunningActions = "No"
|
||||||
filePath = "Vendoo/ItemTableViewController.swift"
|
filePath = "Vendoo/ItemTableViewController.swift"
|
||||||
timestampString = "502130300.686017"
|
timestampString = "504912890.797569"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "217"
|
startingLineNumber = "281"
|
||||||
endingLineNumber = "217"
|
endingLineNumber = "281"
|
||||||
landmarkName = "tableView(_:cellForRowAtIndexPath:)"
|
|
||||||
landmarkType = "5">
|
|
||||||
</BreakpointContent>
|
|
||||||
</BreakpointProxy>
|
|
||||||
<BreakpointProxy
|
|
||||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
||||||
<BreakpointContent
|
|
||||||
shouldBeEnabled = "Yes"
|
|
||||||
ignoreCount = "0"
|
|
||||||
continueAfterRunningActions = "No"
|
|
||||||
filePath = "Vendoo/ItemTableViewController.swift"
|
|
||||||
timestampString = "502130607.978907"
|
|
||||||
startingColumnNumber = "9223372036854775807"
|
|
||||||
endingColumnNumber = "9223372036854775807"
|
|
||||||
startingLineNumber = "253"
|
|
||||||
endingLineNumber = "253"
|
|
||||||
landmarkName = "tableView(_:cellForRowAtIndexPath:)"
|
|
||||||
landmarkType = "5">
|
|
||||||
</BreakpointContent>
|
|
||||||
</BreakpointProxy>
|
|
||||||
<BreakpointProxy
|
|
||||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
||||||
<BreakpointContent
|
|
||||||
shouldBeEnabled = "Yes"
|
|
||||||
ignoreCount = "0"
|
|
||||||
continueAfterRunningActions = "No"
|
|
||||||
filePath = "Vendoo/ItemTableViewController.swift"
|
|
||||||
timestampString = "502130713.514106"
|
|
||||||
startingColumnNumber = "9223372036854775807"
|
|
||||||
endingColumnNumber = "9223372036854775807"
|
|
||||||
startingLineNumber = "258"
|
|
||||||
endingLineNumber = "258"
|
|
||||||
landmarkName = "tableView(_:cellForRowAtIndexPath:)"
|
landmarkName = "tableView(_:cellForRowAtIndexPath:)"
|
||||||
landmarkType = "5">
|
landmarkType = "5">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
@ -70,16 +38,16 @@
|
|||||||
<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/ItemTableViewController.swift"
|
filePath = "Vendoo/ItemTableViewController.swift"
|
||||||
timestampString = "504755002.558106"
|
timestampString = "504910196.477146"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "88"
|
startingLineNumber = "92"
|
||||||
endingLineNumber = "88"
|
endingLineNumber = "92"
|
||||||
landmarkName = "segSwitch(_:)"
|
landmarkName = "activeHistorSegSwitch(_:)"
|
||||||
landmarkType = "5">
|
landmarkType = "5">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
@ -312,7 +280,7 @@
|
|||||||
moduleName = "Vendoo"
|
moduleName = "Vendoo"
|
||||||
usesParentBreakpointCondition = "Yes"
|
usesParentBreakpointCondition = "Yes"
|
||||||
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift"
|
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift"
|
||||||
timestampString = "504766122.581369"
|
timestampString = "504912892.065671"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "32"
|
startingLineNumber = "32"
|
||||||
@ -327,7 +295,7 @@
|
|||||||
moduleName = "Vendoo"
|
moduleName = "Vendoo"
|
||||||
usesParentBreakpointCondition = "Yes"
|
usesParentBreakpointCondition = "Yes"
|
||||||
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift"
|
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift"
|
||||||
timestampString = "504766122.581543"
|
timestampString = "504912892.065782"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "32"
|
startingLineNumber = "32"
|
||||||
@ -342,7 +310,7 @@
|
|||||||
moduleName = "Vendoo"
|
moduleName = "Vendoo"
|
||||||
usesParentBreakpointCondition = "Yes"
|
usesParentBreakpointCondition = "Yes"
|
||||||
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift"
|
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift"
|
||||||
timestampString = "504766122.581743"
|
timestampString = "504912892.065878"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "32"
|
startingLineNumber = "32"
|
||||||
@ -357,7 +325,7 @@
|
|||||||
moduleName = "Vendoo"
|
moduleName = "Vendoo"
|
||||||
usesParentBreakpointCondition = "Yes"
|
usesParentBreakpointCondition = "Yes"
|
||||||
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift"
|
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ExternalWebViewController.swift"
|
||||||
timestampString = "504766122.58194"
|
timestampString = "504912892.06597"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "32"
|
startingLineNumber = "32"
|
||||||
@ -383,5 +351,53 @@
|
|||||||
landmarkType = "5">
|
landmarkType = "5">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Vendoo/ItemTableViewController.swift"
|
||||||
|
timestampString = "504912890.797569"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "224"
|
||||||
|
endingLineNumber = "224"
|
||||||
|
landmarkName = "tableView(_:numberOfRowsInSection:)"
|
||||||
|
landmarkType = "5">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Vendoo/ItemTableViewController.swift"
|
||||||
|
timestampString = "504912890.797569"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "409"
|
||||||
|
endingLineNumber = "409"
|
||||||
|
landmarkName = "tableView(_:titleForHeaderInSection:)"
|
||||||
|
landmarkType = "5">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Vendoo/ItemTableViewController.swift"
|
||||||
|
timestampString = "504912890.797569"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "410"
|
||||||
|
endingLineNumber = "410"
|
||||||
|
landmarkName = "tableView(_:titleForHeaderInSection:)"
|
||||||
|
landmarkType = "5">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
</Breakpoints>
|
</Breakpoints>
|
||||||
</Bucket>
|
</Bucket>
|
||||||
|
|||||||
@ -21,6 +21,9 @@ class ItemTableViewController: UIViewController {
|
|||||||
|
|
||||||
@IBOutlet weak var menuButton: UIBarButtonItem!
|
@IBOutlet weak var menuButton: UIBarButtonItem!
|
||||||
|
|
||||||
|
@IBOutlet weak var historyFilter: UISegmentedControl!
|
||||||
|
|
||||||
|
|
||||||
var loadingView: UIView!
|
var loadingView: UIView!
|
||||||
var selectedListing: Listing!
|
var selectedListing: Listing!
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
@ -63,6 +66,7 @@ class ItemTableViewController: UIViewController {
|
|||||||
super.viewWillAppear(animated)
|
super.viewWillAppear(animated)
|
||||||
(menuButton.target as! SWRevealViewController).delegate = self
|
(menuButton.target as! SWRevealViewController).delegate = self
|
||||||
self.tabBarController?.tabBar.hidden = false
|
self.tabBarController?.tabBar.hidden = false
|
||||||
|
|
||||||
}
|
}
|
||||||
override func didReceiveMemoryWarning() {
|
override func didReceiveMemoryWarning() {
|
||||||
super.didReceiveMemoryWarning()
|
super.didReceiveMemoryWarning()
|
||||||
@ -85,9 +89,27 @@ class ItemTableViewController: UIViewController {
|
|||||||
|
|
||||||
// MARK: - IBAction
|
// MARK: - IBAction
|
||||||
extension ItemTableViewController {
|
extension ItemTableViewController {
|
||||||
@IBAction func segSwitch(sender: UISegmentedControl) {
|
@IBAction func activeHistorSegSwitch(sender: UISegmentedControl) {
|
||||||
|
self.itemTable.reloadData()
|
||||||
|
//History Segement
|
||||||
|
if(self.tableSegmentController.selectedSegmentIndex == 1){
|
||||||
|
self.historyFilter.enabled = true
|
||||||
|
self.historyFilter.userInteractionEnabled = true
|
||||||
|
self.historyFilter.hidden = false
|
||||||
|
|
||||||
|
//Active segment
|
||||||
|
}else{
|
||||||
|
self.historyFilter.selectedSegmentIndex = UISegmentedControlNoSegment
|
||||||
|
self.historyFilter.enabled = false
|
||||||
|
self.historyFilter.userInteractionEnabled = false
|
||||||
|
self.historyFilter.hidden = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func historyFilterSegSwitch(sender: UISegmentedControl) {
|
||||||
self.itemTable.reloadData()
|
self.itemTable.reloadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Side Menu View
|
// MARK: - Side Menu View
|
||||||
@ -167,21 +189,77 @@ extension ItemTableViewController {
|
|||||||
|
|
||||||
// MARK: - TableView Datasource methods
|
// MARK: - TableView Datasource methods
|
||||||
extension ItemTableViewController: UITableViewDataSource{
|
extension ItemTableViewController: UITableViewDataSource{
|
||||||
|
|
||||||
|
func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
|
||||||
|
|
||||||
|
//if in the history segment
|
||||||
|
if(self.tableSegmentController.selectedSegmentIndex == 1){
|
||||||
|
//hides title of unsold section if Sold filter selected
|
||||||
|
if(self.historyFilter.selectedSegmentIndex == 0){
|
||||||
|
if(section == 1){
|
||||||
|
return 0.0
|
||||||
|
}else{
|
||||||
|
return self.itemTable.sectionHeaderHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
//hides title of sold section if Unsold filter selected
|
||||||
|
}else if(self.historyFilter.selectedSegmentIndex == 1){
|
||||||
|
if(section == 0){
|
||||||
|
return 0.0
|
||||||
|
}else{
|
||||||
|
return self.itemTable.sectionHeaderHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
//Shows both section titles
|
||||||
|
}else{
|
||||||
|
return self.itemTable.sectionHeaderHeight
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return self.itemTable.sectionHeaderHeight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
|
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
|
||||||
// #warning Incomplete implementation, return the number of sections
|
//number of sections for active segment
|
||||||
return 1
|
if self.tableSegmentController.selectedSegmentIndex == 0 {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||||
// #warning Incomplete implementation, return the number of rows
|
//if in the active segment
|
||||||
if self.tableSegmentController.selectedSegmentIndex == 0 {
|
if self.tableSegmentController.selectedSegmentIndex == 0 {
|
||||||
return ((self.tabBarController as? HomeViewController)?.userListings.count)!
|
return ((self.tabBarController as? HomeViewController)?.userListings.count)!
|
||||||
}
|
}
|
||||||
else if tableSegmentController.selectedSegmentIndex == 1 {
|
|
||||||
return ((self.tabBarController as? HomeViewController)?.endedListings.count)!
|
//if in the history segment
|
||||||
}
|
else {
|
||||||
else{
|
//hides unsold section cells if Sold filter selected
|
||||||
return ((self.tabBarController as? HomeViewController)?.soldListings.count)!
|
if(self.historyFilter.selectedSegmentIndex == 0){
|
||||||
|
if(section == 1){
|
||||||
|
return 0
|
||||||
|
}else{
|
||||||
|
return ((self.tabBarController as? HomeViewController)?.soldListings.count)!
|
||||||
|
}
|
||||||
|
//hides sold section cells if Unsold filter selected
|
||||||
|
}else if(self.historyFilter.selectedSegmentIndex == 1){
|
||||||
|
if(section == 0){
|
||||||
|
return 0
|
||||||
|
}else{
|
||||||
|
return ((self.tabBarController as? HomeViewController)?.endedListings.count)!
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//shows both respective sections cells
|
||||||
|
if(section == 1){
|
||||||
|
return ((self.tabBarController as? HomeViewController)?.endedListings.count)!
|
||||||
|
}else{
|
||||||
|
return ((self.tabBarController as? HomeViewController)?.soldListings.count)!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -195,6 +273,7 @@ extension ItemTableViewController: UITableViewDataSource{
|
|||||||
//for each listing cell generated need to find the marketplaces it belongs to, the listing price, the name of the item, the status of the item, and the item image.
|
//for each listing cell generated need to find the marketplaces it belongs to, the listing price, the name of the item, the status of the item, and the item image.
|
||||||
//Once these objects are retrieved, access the ItemCell properties and manipulate as needed
|
//Once these objects are retrieved, access the ItemCell properties and manipulate as needed
|
||||||
|
|
||||||
|
//Active and unpublished listings
|
||||||
if self.tableSegmentController.selectedSegmentIndex == 0 {
|
if self.tableSegmentController.selectedSegmentIndex == 0 {
|
||||||
cell.itemImage.image = (self.tabBarController as? HomeViewController)?.userListings[indexPath.row].images[0] //come back
|
cell.itemImage.image = (self.tabBarController as? HomeViewController)?.userListings[indexPath.row].images[0] //come back
|
||||||
cell.itemName.text = (self.tabBarController as? HomeViewController)!.userListings[indexPath.row].title
|
cell.itemName.text = (self.tabBarController as? HomeViewController)!.userListings[indexPath.row].title
|
||||||
@ -220,20 +299,16 @@ extension ItemTableViewController: UITableViewDataSource{
|
|||||||
cell.selectedNetworks = []
|
cell.selectedNetworks = []
|
||||||
dispatch_async(dispatch_get_main_queue(), {
|
dispatch_async(dispatch_get_main_queue(), {
|
||||||
if(((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["ebay"])!){
|
if(((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["ebay"])!){
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 0, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("ebay_icon")
|
cell.addNetwork("ebay_icon")
|
||||||
}
|
}
|
||||||
if(((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["amazon"])!){
|
if(((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["amazon"])!){
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 1, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("amazon_icon")
|
cell.addNetwork("amazon_icon")
|
||||||
}
|
}
|
||||||
if(((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["etsy"])!){
|
if(((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["etsy"])!){
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 2, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("etsy_icon")
|
cell.addNetwork("etsy_icon")
|
||||||
|
|
||||||
}
|
}
|
||||||
if(((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["facebook"])!){
|
if(((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["facebook"])!){
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 3, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("facebook_icon")
|
cell.addNetwork("facebook_icon")
|
||||||
}
|
}
|
||||||
cell.networks.reloadData()
|
cell.networks.reloadData()
|
||||||
@ -243,74 +318,75 @@ extension ItemTableViewController: UITableViewDataSource{
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if tableSegmentController.selectedSegmentIndex == 1 {
|
|
||||||
cell.itemImage.image = (self.tabBarController as? HomeViewController)?.endedListings[indexPath.row].images[0] //come back
|
|
||||||
cell.itemName.text = (self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].title
|
|
||||||
cell.itemPrice.text = (self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].price
|
|
||||||
|
|
||||||
cell.itemStatus.text = "Status: Unsold"
|
//Sold and Unsold Listings
|
||||||
|
else {
|
||||||
|
|
||||||
if(!((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["areNetworksChosen"])!){
|
//unsold listings section
|
||||||
cell.networks.hidden = true
|
if indexPath.section == 1 {
|
||||||
|
cell.itemImage.image = (self.tabBarController as? HomeViewController)?.endedListings[indexPath.row].images[0] //come back
|
||||||
|
cell.itemName.text = (self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].title
|
||||||
|
cell.itemPrice.text = (self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].price
|
||||||
|
|
||||||
|
cell.itemStatus.text = "Status: Unsold"
|
||||||
|
|
||||||
|
if(!((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["areNetworksChosen"])!){
|
||||||
|
cell.networks.hidden = true
|
||||||
|
}else{
|
||||||
|
cell.selectedNetworks = []
|
||||||
|
dispatch_async(dispatch_get_main_queue(), {
|
||||||
|
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["ebay"])!){
|
||||||
|
cell.addNetwork("ebay_icon")
|
||||||
|
}
|
||||||
|
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["amazon"])!){
|
||||||
|
cell.addNetwork("amazon_icon")
|
||||||
|
}
|
||||||
|
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["etsy"])!){
|
||||||
|
cell.addNetwork("etsy_icon")
|
||||||
|
|
||||||
|
}
|
||||||
|
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["facebook"])!){
|
||||||
|
cell.addNetwork("facebook_icon")
|
||||||
|
}
|
||||||
|
cell.networks.reloadData()
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//section for sold listings
|
||||||
}else{
|
}else{
|
||||||
cell.selectedNetworks = []
|
cell.itemImage.image = (self.tabBarController as? HomeViewController)?.soldListings[indexPath.row].images[0]
|
||||||
dispatch_async(dispatch_get_main_queue(), {
|
cell.itemName.text = (self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].title
|
||||||
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["ebay"])!){
|
cell.itemPrice.text = (self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].price
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 0, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("ebay_icon")
|
|
||||||
}
|
|
||||||
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["amazon"])!){
|
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 1, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("amazon_icon")
|
|
||||||
}
|
|
||||||
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["etsy"])!){
|
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 2, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("etsy_icon")
|
|
||||||
|
|
||||||
}
|
cell.itemStatus.text = "Status: Sold"
|
||||||
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["facebook"])!){
|
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 3, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("facebook_icon")
|
|
||||||
}
|
|
||||||
cell.networks.reloadData()
|
|
||||||
})
|
|
||||||
|
|
||||||
|
if(!((self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].networks["areNetworksChosen"])!){
|
||||||
|
cell.networks.hidden = true
|
||||||
|
}else{
|
||||||
|
cell.selectedNetworks = []
|
||||||
|
dispatch_async(dispatch_get_main_queue(), {
|
||||||
|
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["ebay"])!){
|
||||||
|
cell.addNetwork("ebay_icon")
|
||||||
|
}
|
||||||
|
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["amazon"])!){
|
||||||
|
cell.addNetwork("amazon_icon")
|
||||||
|
}
|
||||||
|
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["etsy"])!){
|
||||||
|
cell.addNetwork("etsy_icon")
|
||||||
|
|
||||||
|
}
|
||||||
|
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["facebook"])!){
|
||||||
|
cell.addNetwork("facebook_icon")
|
||||||
|
}
|
||||||
|
cell.networks.reloadData()
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
cell.itemImage.image = (self.tabBarController as? HomeViewController)?.soldListings[indexPath.row].images[0] //come back
|
|
||||||
cell.itemName.text = (self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].title
|
|
||||||
cell.itemPrice.text = (self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].price
|
|
||||||
|
|
||||||
cell.itemStatus.text = "Status: Sold"
|
|
||||||
|
|
||||||
if(!((self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].networks["areNetworksChosen"])!){
|
|
||||||
cell.networks.hidden = true
|
|
||||||
}else{
|
|
||||||
cell.selectedNetworks = []
|
|
||||||
dispatch_async(dispatch_get_main_queue(), {
|
|
||||||
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["ebay"])!){
|
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 0, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("ebay_icon")
|
|
||||||
}
|
|
||||||
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["amazon"])!){
|
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 1, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("amazon_icon")
|
|
||||||
}
|
|
||||||
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["etsy"])!){
|
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 2, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("etsy_icon")
|
|
||||||
|
|
||||||
}
|
|
||||||
if(((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["facebook"])!){
|
|
||||||
//cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 3, inSection: 0))?.hidden = true
|
|
||||||
cell.addNetwork("facebook_icon")
|
|
||||||
}
|
|
||||||
cell.networks.reloadData()
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -318,17 +394,37 @@ extension ItemTableViewController: UITableViewDataSource{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
|
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
|
||||||
|
|
||||||
|
//view listing that is active or draft
|
||||||
if self.tableSegmentController.selectedSegmentIndex == 0 {
|
if self.tableSegmentController.selectedSegmentIndex == 0 {
|
||||||
self.selectedListing = (self.tabBarController as? HomeViewController)?.userListings[indexPath.row]
|
self.selectedListing = (self.tabBarController as? HomeViewController)?.userListings[indexPath.row]
|
||||||
}
|
}
|
||||||
else if tableSegmentController.selectedSegmentIndex == 1 {
|
|
||||||
self.selectedListing = (self.tabBarController as? HomeViewController)?.endedListings[indexPath.row]
|
//view listing that is sold or unsold
|
||||||
}
|
|
||||||
else{
|
else{
|
||||||
self.selectedListing = (self.tabBarController as? HomeViewController)?.soldListings[indexPath.row]
|
//unsold
|
||||||
|
if(indexPath.section == 1){
|
||||||
|
self.selectedListing = (self.tabBarController as? HomeViewController)?.endedListings[indexPath.row]
|
||||||
|
//sold
|
||||||
|
}else{
|
||||||
|
self.selectedListing = (self.tabBarController as? HomeViewController)?.soldListings[indexPath.row]
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
self.performSegueWithIdentifier("ItemDetailSegue", sender: self)
|
self.performSegueWithIdentifier("ItemDetailSegue", sender: self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
|
||||||
|
if(self.tableSegmentController.selectedSegmentIndex == 1){
|
||||||
|
if(section == 1){
|
||||||
|
return "Unsold"
|
||||||
|
}else{
|
||||||
|
return "Sold"
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1194,22 +1194,22 @@
|
|||||||
<rect key="frame" x="0.0" y="44" width="375" height="29"/>
|
<rect key="frame" x="0.0" y="44" width="375" height="29"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<segments>
|
<segments>
|
||||||
<segment title="Selling"/>
|
<segment title="Active"/>
|
||||||
<segment title="Unsold"/>
|
<segment title="History"/>
|
||||||
<segment title="Sold"/>
|
|
||||||
</segments>
|
</segments>
|
||||||
<color key="tintColor" red="0.2784313725" green="0.80392156859999997" blue="0.68235294120000001" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="tintColor" red="0.2784313725" green="0.80392156859999997" blue="0.68235294120000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="segSwitch:" destination="Iwh-sn-a0Q" eventType="valueChanged" id="YfI-EH-qgs"/>
|
<action selector="activeHistorSegSwitch:" destination="Iwh-sn-a0Q" eventType="valueChanged" id="Ejr-V9-nMo"/>
|
||||||
</connections>
|
</connections>
|
||||||
</segmentedControl>
|
</segmentedControl>
|
||||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="123" sectionHeaderHeight="1" sectionFooterHeight="28" id="Thg-pb-lhN">
|
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="123" sectionHeaderHeight="1" sectionFooterHeight="28" id="Thg-pb-lhN">
|
||||||
<rect key="frame" x="0.0" y="80" width="375" height="535"/>
|
<rect key="frame" x="0.0" y="80" width="375" height="535"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||||
|
<inset key="contentInset" minX="0.0" minY="10" maxX="0.0" maxY="0.0"/>
|
||||||
<prototypes>
|
<prototypes>
|
||||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Item Cell" rowHeight="123" id="zmO-fi-nTP" customClass="ItemCell" customModule="Vendoo" customModuleProvider="target">
|
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Item Cell" rowHeight="123" id="zmO-fi-nTP" customClass="ItemCell" customModule="Vendoo" customModuleProvider="target">
|
||||||
<rect key="frame" x="0.0" y="1" width="375" height="123"/>
|
<rect key="frame" x="0.0" y="11" width="375" height="123"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="zmO-fi-nTP" id="CoK-hy-32b">
|
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="zmO-fi-nTP" id="CoK-hy-32b">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="375" height="122.5"/>
|
<rect key="frame" x="0.0" y="0.0" width="375" height="122.5"/>
|
||||||
@ -1292,6 +1292,17 @@
|
|||||||
</tableViewCell>
|
</tableViewCell>
|
||||||
</prototypes>
|
</prototypes>
|
||||||
</tableView>
|
</tableView>
|
||||||
|
<segmentedControl hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" id="hyA-UD-JyK">
|
||||||
|
<rect key="frame" x="127" y="73" width="121" height="29"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
|
<segments>
|
||||||
|
<segment title="Sold"/>
|
||||||
|
<segment title="Unsold"/>
|
||||||
|
</segments>
|
||||||
|
<connections>
|
||||||
|
<action selector="historyFilterSegSwitch:" destination="Iwh-sn-a0Q" eventType="valueChanged" id="hlT-aZ-WSw"/>
|
||||||
|
</connections>
|
||||||
|
</segmentedControl>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||||
</view>
|
</view>
|
||||||
@ -1302,6 +1313,7 @@
|
|||||||
<nil key="simulatedStatusBarMetrics"/>
|
<nil key="simulatedStatusBarMetrics"/>
|
||||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
|
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
|
||||||
<connections>
|
<connections>
|
||||||
|
<outlet property="historyFilter" destination="hyA-UD-JyK" id="ey9-bb-et0"/>
|
||||||
<outlet property="itemTable" destination="Thg-pb-lhN" id="u15-xE-hz6"/>
|
<outlet property="itemTable" destination="Thg-pb-lhN" id="u15-xE-hz6"/>
|
||||||
<outlet property="menuButton" destination="WjT-mo-4jm" id="1CT-vV-KLK"/>
|
<outlet property="menuButton" destination="WjT-mo-4jm" id="1CT-vV-KLK"/>
|
||||||
<outlet property="tableSegmentController" destination="X2D-np-ma4" id="DbB-DF-wEF"/>
|
<outlet property="tableSegmentController" destination="X2D-np-ma4" id="DbB-DF-wEF"/>
|
||||||
@ -1570,7 +1582,7 @@
|
|||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||||
<prototypes>
|
<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">
|
<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="28" width="375" height="69"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9G8-XI-ptI" id="r3f-6Q-p1g">
|
<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"/>
|
<rect key="frame" x="0.0" y="0.0" width="375" height="68.5"/>
|
||||||
@ -1701,7 +1713,7 @@
|
|||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||||
<prototypes>
|
<prototypes>
|
||||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Change_Pass_Cell" id="ceq-sl-ClT">
|
<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="28" width="375" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ceq-sl-ClT" id="Waq-fu-UxD">
|
<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"/>
|
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
|
||||||
@ -1718,7 +1730,7 @@
|
|||||||
</tableViewCellContentView>
|
</tableViewCellContentView>
|
||||||
</tableViewCell>
|
</tableViewCell>
|
||||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Delete_Account_Cell" id="Lha-cf-Sfc">
|
<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="72" width="375" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Lha-cf-Sfc" id="kmF-Sb-d0c">
|
<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"/>
|
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
|
||||||
@ -2476,12 +2488,12 @@
|
|||||||
<image name="start" width="50" height="50"/>
|
<image name="start" width="50" height="50"/>
|
||||||
</resources>
|
</resources>
|
||||||
<inferredMetricsTieBreakers>
|
<inferredMetricsTieBreakers>
|
||||||
<segue reference="NOz-ya-avj"/>
|
|
||||||
<segue reference="syc-IR-LNQ"/>
|
<segue reference="syc-IR-LNQ"/>
|
||||||
<segue reference="Ds4-LY-IRj"/>
|
<segue reference="Ds4-LY-IRj"/>
|
||||||
<segue reference="Gnt-iE-cW9"/>
|
<segue reference="Gnt-iE-cW9"/>
|
||||||
<segue reference="eaI-bm-1aI"/>
|
<segue reference="eaI-bm-1aI"/>
|
||||||
<segue reference="nUj-1v-ftF"/>
|
<segue reference="nUj-1v-ftF"/>
|
||||||
|
<segue reference="NOz-ya-avj"/>
|
||||||
<segue reference="qb4-wt-avv"/>
|
<segue reference="qb4-wt-avv"/>
|
||||||
</inferredMetricsTieBreakers>
|
</inferredMetricsTieBreakers>
|
||||||
<color key="tintColor" red="0.2784313725" green="0.80392156859999997" blue="0.68235294120000001" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="tintColor" red="0.2784313725" green="0.80392156859999997" blue="0.68235294120000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user