////
////  ServiceCallbackRegionController.swift
////  kt
////
////  Created by Alexandr Zalutskiy on 02.02.15.
////  Copyright (c) 2015 Alexandr Zalutskiy. All rights reserved.
////
//
//import UIKit
//
//class ServiceCallbackRegionController: UITableViewController {
//	
////	var row : Int!
////	var cityLocation : CityLocation!
//	
//	var serviceId: Int!
//	var pvc: ServiceCallbackController!
//	
//	private let cellIdentifier = "RegionCell"
//	private let facade = Facade.sharedInstance()
//	private let notificationCenter = NSNotificationCenter.defaultCenter()
//	
//	private var loadingIndicator : UIActivityIndicatorView?
//	
//	private var items = [CallbackCity]()
//	
//	override func viewDidLoad() {
//		let titleLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 150, height: 36))
//		titleLabel.textColor = Color.DarkColorForText
//		titleLabel.text = LocalizedString("city", description: "Город")
//		titleLabel.textAlignment = .Center
//		titleLabel.font = NavigationBarFont
//		
//		titleLabel.sizeToFit()
//		
//		navigationItem.titleView = titleLabel
//		
//		super.viewDidLoad()
//		
//		setBackButton()
//		
//		registerForNotification()
//		facade.citiesForCallback()
//		
//		loadingIndicator = UIActivityIndicatorView(activityIndicatorStyle: .Gray)
//		loadingIndicator!.hidesWhenStopped = true
//		navigationItem.rightBarButtonItem = UIBarButtonItem(customView: loadingIndicator!)
//		loadingIndicator!.startAnimating()
//
//	}
//	
//	override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
//		return items.count
//	}
//	
//	override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
//		let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath)
//			as UITableViewCell
//		cell.textLabel!.text = items[indexPath.row].text
//		return cell
//	}
//	
//	override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
//		tableView.deselectRowAtIndexPath(indexPath, animated: true)
//		
//		pvc.info = items[indexPath.row]
//		
//		navigationController!.popViewControllerAnimated(true)
//	}
//	
//	// MARK: Notification
//	
//	func registerForNotification() {
//		notificationCenter.addObserver(
//			self,
//			selector: #selector(ServiceCallbackRegionController.setItems(_:)),
//			name: FacadeCallbackItemsSuccess,
//			object: facade
//		)
//	}
//	
//	func unregisterForNotification() {
//		notificationCenter.removeObserver(self, name: FacadeCallbackItemsSuccess, object: facade)
//	}
//	
//	// MARK: Observering
//	
//	func setItems(notification: NSNotification) {
//		loadingIndicator!.stopAnimating()
//		unregisterForNotification()
//		items = notification.userInfo!["items"] as! [CallbackCity]
//		tableView.reloadData()
//	}
//}
