Some of the most popular platforms on the web are digital marketplace. Look at eBay, Amazon, Craig’s List, Etsy, even Gumtree. And because phones are the new PC, marketplace apps are now more important (and more used) than online marketplaces. So we built an app template to help you launch the world’s next connected marketplace. It’s called Classifieds Marketplace app template.
It’s a clean, intuitive design, perfect to put your content first but still have a beautiful modern, flat UI. And it’s developed in native Swift for iOS. It’s the place to start to launch the next connected marketplace on iPhone.
//
// CategoriesViewController.swift
// Classified
//
// Copyright (c) 2014 MyAppTemplates. All rights reserved.
//
import UIKit
class CategoriesViewController: UIViewController {
var arrCategories : NSArray!
@IBOutlet var tblContents: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
arrCategories = ["All categories","Car","Sport & Hobby","Apartment/Rents","Rooms/Beds","Bike & Scooter","Jobs & Services","Offices & Commercial","Phones & Photography","Appliances","Boating"]
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int {
return arrCategories.count
}
func numberOfSectionsInTableView(tableView: UITableView!) -> Int {
return 1
}
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
var cell : CategoryTableViewCell!
cell = tblContents.dequeueReusableCellWithIdentifier("CellCategory") as CategoryTableViewCell
cell.lblTitle.text = arrCategories.objectAtIndex(indexPath.row) as? String
return cell
}
func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!){
var cell : CategoryTableViewCell!
cell = tblContents.cellForRowAtIndexPath(indexPath) as CategoryTableViewCell
cell.accessoryType = UITableViewCellAccessoryType.Checkmark
cell.lblTitle.textColor = UIColor.redColor()
}
// func tableView(tableView: UITableView!, didDeselectRowAtIndexPath indexPath: NSIndexPath!){
// var cell : CategoryTableViewCell!
// cell = tblContents.cellForRowAtIndexPath(indexPath) as CategoryTableViewCell
// cell.accessoryType = UITableViewCellAccessoryType.None
// cell.lblTitle.textColor = UIColor.darkGrayColor()
// }
@IBAction func dismissView() {
self.dismissViewControllerAnimated(1, completion: nil)
}
/*
// 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.
}
*/
}