@@ -1,205 +1,206 @@
import UIKit

class HostViewController: UIViewController, ChannelsVCDelegate {
@IBOutlet var tableView: UITableView!

var cellContent:[String: [String]] = [
"basicContent":["Create A Room",
"Name Of Room"],

"advancedContent":["Advanced Settings",
"Room Entry Key",
"Public",
"Embed Channels"]
]

var nameOfRoom:String?
var roomPassCode:String?
var createChannels = false
var privateRoom = false
var toggleAdvancedSettings = false
var channels = [Channel]()
var enableSegue = false

override func viewDidLoad() {
super.viewDidLoad()

setUpUI()
configureTableView()
}

func setUpUI(){
toggleAdvancedSettings = false
let headerNib = UINib(nibName: "HostReusableCell", bundle: nil)
tableView.registerNib(headerNib, forCellReuseIdentifier: "Host Reusable Cell")
tableView.scrollEnabled = false
tableView.backgroundColor = Theme.Colors.ForegroundColor.color

let addRoomButton = UIBarButtonItem(title: "Create Room", style: UIBarButtonItemStyle.Plain, target: self, action: "addRoomButtonWasTapped")
navigationItem.rightBarButtonItem = addRoomButton
navigationItem.rightBarButtonItem?.enabled = false
}

func addRoomButtonWasTapped(){
if !checkIfLoggedIn() {
return
}
guard let name = nameOfRoom else { return }
let entryKey = roomPassCode ?? "123"
let user = FirebaseManager.manager.user
let privateRoomAsInt = convertBooltoInt(privateRoom)

Room.createNewRoomWith(name, host: user, privateRoom: privateRoomAsInt, password: entryKey) { newRoom in
self.performSegueWithSegueIdentifier(SegueIdentifier.SegueToMessaging, sender: newRoom)

}
}

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
switch segue.identifier {
case SegueIdentifier.SegueToMessaging.rawValue?:
guard let nvc = segue.destinationViewController as? UINavigationController, room = sender as? Room else { return }
guard let mvc = nvc.viewControllers[0] as? MessagingViewController else { return }
mvc.room = room

room.channels = channels.map { channel -> Channel in
return Channel(title: channel.title, privateChannel: channel.privateChannel, password: channel.password, room: room)
}
mvc.currentChannel = room.channels[0]
return

case SegueIdentifier.SegueToChannelsVC.rawValue?:
guard let cvc = segue.destinationViewController as? ChannelsVC else { return }
cvc.tempRoom = nameOfRoom!
if channels.count > 0 {
cvc.channels = channels
}
cvc.delegate = self
return
default: assertionFailure()
}
}

func convertBooltoInt(bool:Bool) -> Int {
return bool == true ? 1 : 0
}

func channelsVC(channelsVC: ChannelsVC, didCreateChannel channel: AnyObject) {
let addChannel = channel as! Channel
channels.append(addChannel)
}
@IBOutlet var tableView: UITableView!

var cellContent:[String: [String]] = [
"basicContent":["Create A Room",
"Name Of Room"],

"advancedContent":["Advanced Settings",
"Room Entry Key",
"Public",
"Embed Channels"]
]

var nameOfRoom:String?
var roomPassCode:String?
var createChannels = false
var privateRoom = false
var toggleAdvancedSettings = false
var channels = [Channel]()
var enableSegue = false

override func viewDidLoad() {
super.viewDidLoad()

setUpUI()
configureTableView()
}

func setUpUI(){
toggleAdvancedSettings = false
let headerNib = UINib(nibName: "HostReusableCell", bundle: nil)
tableView.registerNib(headerNib, forCellReuseIdentifier: "Host Reusable Cell")
tableView.scrollEnabled = false
tableView.backgroundColor = Theme.Colors.ForegroundColor.color

let addRoomButton = UIBarButtonItem(title: "Create Room", style: UIBarButtonItemStyle.Plain, target: self, action: "addRoomButtonWasTapped")
navigationItem.rightBarButtonItem = addRoomButton
navigationItem.rightBarButtonItem?.enabled = false
}

func addRoomButtonWasTapped(){
if FirebaseManager.manager.authData == nil {
presentLoginScreen()
return
}

guard let name = nameOfRoom else { return }
let entryKey = roomPassCode ?? "123"
let user = FirebaseManager.manager.user
let privateRoomAsInt = convertBooltoInt(privateRoom)

Room.createNewRoomWith(name, host: user, privateRoom: privateRoomAsInt, password: entryKey) { newRoom in
self.performSegueWithSegueIdentifier(SegueIdentifier.SegueToMessaging, sender: newRoom)
}
}

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
switch segue.identifier {
case SegueIdentifier.SegueToMessaging.rawValue?:
guard let nvc = segue.destinationViewController as? UINavigationController, room = sender as? Room else { return }
guard let mvc = nvc.viewControllers[0] as? MessagingViewController else { return }
mvc.room = room

room.channels = channels.map { channel -> Channel in
return Channel(title: channel.title, privateChannel: channel.privateChannel, password: channel.password, room: room)
}
mvc.currentChannel = room.channels[0]
return

case SegueIdentifier.SegueToChannelsVC.rawValue?:
guard let cvc = segue.destinationViewController as? ChannelsVC else { return }
cvc.tempRoom = nameOfRoom!
if channels.count > 0 {
cvc.channels = channels
}
cvc.delegate = self
return
default: assertionFailure()
}
}

func convertBooltoInt(bool:Bool) -> Int {
return bool == true ? 1 : 0
}

func channelsVC(channelsVC: ChannelsVC, didCreateChannel channel: AnyObject) {
let addChannel = channel as! Channel
channels.append(addChannel)
}
}


//HostReusableCellDelegate
extension HostViewController: HostReusableCellDelegate {
func hostReusableCell(cell: HostReusableCell, valueDidChange: AnyObject?) {
switch cell.type {
case .NameOfRoom:
nameOfRoom = valueDidChange as? String
enableSegue = true
navigationItem.rightBarButtonItem?.enabled = true
case .PasscodeOfRoom:
roomPassCode = valueDidChange as? String
case .Privacy:
if let aSwitch = valueDidChange as? UISwitch {
privateRoom = aSwitch.on
guard let cell = tableView.cellForRowAtIndexPath(NSIndexPath(forRow: 2, inSection: 1)) as? HostReusableCell else {return}
switch privateRoom {
case false:
cell.title.text = "Private"
default:
cell.title.text = "Public"
}
func hostReusableCell(cell: HostReusableCell, valueDidChange: AnyObject?) {
switch cell.type {
case .NameOfRoom:
nameOfRoom = valueDidChange as? String
enableSegue = true
navigationItem.rightBarButtonItem?.enabled = true
case .PasscodeOfRoom:
roomPassCode = valueDidChange as? String
case .Privacy:
if let aSwitch = valueDidChange as? UISwitch {
privateRoom = aSwitch.on
guard let cell = tableView.cellForRowAtIndexPath(NSIndexPath(forRow: 2, inSection: 1)) as? HostReusableCell else {return}
switch privateRoom {
case false:
cell.title.text = "Private"
default:
cell.title.text = "Public"
}
default:
assertionFailure()
}
}

func textFieldDidBeginEditingInCell(textField: UITextField) {
let textFieldPosition = textField.convertPoint(CGPointZero, toView: self.tableView)
let indexPath = self.tableView.indexPathForRowAtPoint(textFieldPosition)
let cell = tableView.cellForRowAtIndexPath(indexPath!)

tableView.setContentOffset(CGPointMake(self.tableView.contentOffset.x, self.tableView.contentOffset.y + CGFloat(indexPath!.row) * (cell?.frame.height)! - (navigationController?.navigationBar.frame.height)!), animated: true)
}

func textFieldDidEndEditingInCell() {
tableView.setContentOffset(CGPointMake(self.tableView.contentOffset.x, 0.0), animated: true)
}

}
default:
assertionFailure()
}
}

func textFieldDidBeginEditingInCell(textField: UITextField) {
let textFieldPosition = textField.convertPoint(CGPointZero, toView: self.tableView)
let indexPath = self.tableView.indexPathForRowAtPoint(textFieldPosition)
let cell = tableView.cellForRowAtIndexPath(indexPath!)

tableView.setContentOffset(CGPointMake(self.tableView.contentOffset.x, self.tableView.contentOffset.y + CGFloat(indexPath!.row) * (cell?.frame.height)! - (navigationController?.navigationBar.frame.height)!), animated: true)
}

func textFieldDidEndEditingInCell() {
tableView.setContentOffset(CGPointMake(self.tableView.contentOffset.x, 0.0), animated: true)
}

}


//MARK - UITableView
extension HostViewController: UITableViewDelegate, UITableViewDataSource {
func configureTableView(){
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 40
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Host Reusable Cell") as! HostReusableCell
cell.setUpCellAtIndexPath(indexPath, cellContent: cellContent)
cell.delegate = self
return cell
}
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 2
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case 0:
return cellContent["basicContent"]!.count
case 1:
if toggleAdvancedSettings == true {
return cellContent["advancedContent"]!.count
} else {
return 1
}
default:
return 0
}
}
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 66
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
view.endEditing(true)
let index = NSIndexSet(index: 1)
switch (indexPath.section, indexPath.row){
case (1,0):
toggleAdvancedSettings = !toggleAdvancedSettings
tableView.scrollEnabled = true
tableView.reloadSections(index, withRowAnimation: UITableViewRowAnimation.Fade)
case (1,3):
if enableSegue == true {
performSegueWithSegueIdentifier(SegueIdentifier.SegueToChannelsVC, sender: self)
}
else {
if let cell = tableView.cellForRowAtIndexPath(NSIndexPath(forRow: 1, inSection: 0)) as? HostReusableCell {
animateCellText(cell)}
}
default:break
}
}
func animateCellText(cell: HostReusableCell){
UIView.transitionWithView(cell.title, duration: 0.25, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: { () -> Void in
cell.title.textColor = UIColor.redColor()
cell.title.alpha = 1.0
}) { (Bool) -> Void in
UIView.transitionWithView(cell.title, duration: 0.25, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: { () -> Void in
cell.title.textColor = UIColor.whiteColor()
cell.title.alpha = 0.5
}, completion: nil)
}
}

func configureTableView(){
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 40
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Host Reusable Cell") as! HostReusableCell
cell.setUpCellAtIndexPath(indexPath, cellContent: cellContent)
cell.delegate = self
return cell
}


func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 2
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case 0:
return cellContent["basicContent"]!.count
case 1:
if toggleAdvancedSettings == true {
return cellContent["advancedContent"]!.count
} else {
return 1
}
default:
return 0
}
}

func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 66
}

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
view.endEditing(true)
let index = NSIndexSet(index: 1)
switch (indexPath.section, indexPath.row){
case (1,0):
toggleAdvancedSettings = !toggleAdvancedSettings
tableView.scrollEnabled = true
tableView.reloadSections(index, withRowAnimation: UITableViewRowAnimation.Fade)
case (1,3):
if enableSegue == true {
performSegueWithSegueIdentifier(SegueIdentifier.SegueToChannelsVC, sender: self)
}
else {
if let cell = tableView.cellForRowAtIndexPath(NSIndexPath(forRow: 1, inSection: 0)) as? HostReusableCell {
animateCellText(cell)}
}
default:break
}
}

func animateCellText(cell: HostReusableCell){
UIView.transitionWithView(cell.title, duration: 0.25, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: { () -> Void in
cell.title.textColor = UIColor.redColor()
cell.title.alpha = 1.0
}) { (Bool) -> Void in
UIView.transitionWithView(cell.title, duration: 0.25, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: { () -> Void in
cell.title.textColor = UIColor.whiteColor()
cell.title.alpha = 0.5
}, completion: nil)
}
}
}

This file was deleted.

@@ -5,11 +5,17 @@ import Firebase

class LoginViewController: UIViewController, FBSDKLoginButtonDelegate {

override func viewDidLoad() {
super.viewDidLoad()

let button = createFBLoginButtonWithPosition(view.center.x, y: view.center.y)
button.delegate = self
}
override func viewDidLoad() {
super.viewDidLoad()
let button = createFBLoginButtonWithPosition(view.center.x, y: view.center.y)
button.delegate = self
NSNotificationCenter.defaultCenter().addObserver(self, selector: "checkForDismiss", name: "FirebaseAuth", object: nil)
}

func checkForDismiss() {
if FirebaseManager.manager.authData != nil {
dismissViewControllerAnimated(true, completion: nil)
}
}
}

@@ -6,6 +6,7 @@ class MessagingViewController: UIViewController, UITextViewDelegate, MenuChannel
didSet {
guard let currentChannelTitle = currentChannel?.title else { return }
textView.text = currentChannelTitle
textView.autocorrectionType = UITextAutocorrectionType.Yes
}
}
@IBOutlet weak var tableView: UITableView! {
@@ -14,16 +15,18 @@ class MessagingViewController: UIViewController, UITextViewDelegate, MenuChannel
tableView.dataSource = self
}
}
@IBOutlet var buttonContainer: UIView!
override func viewDidLoad() {
super.viewDidLoad()
uiSetup()
}
@IBOutlet var buttonContainer: UIView!
@IBOutlet weak var channelButtonOutlet: UIButton!
@IBOutlet weak var sendButtonOutlet: UIButton!
// @IBOutlet weak var buttonToTableViewConstraint: NSLayoutConstraint!
// @IBOutlet weak var buttonsContainer: UIView!

var messageFirebase: FirebaseArray<Message>! {
didSet {
self.tableView.reloadData()
guard let tableView = self.tableView else { return }
tableView.reloadData()
}
}

@@ -45,101 +48,50 @@ class MessagingViewController: UIViewController, UITextViewDelegate, MenuChannel
self.tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: .None)
self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: UITableViewScrollPosition.Bottom, animated: false)
}

messageFirebase = firebaseArray
}

let manager = FirebaseManager.manager
let ref = FirebaseManager.manager.ref
var user: User? {
didSet {
if currentChannel != nil {
setUpMessageFirebase()
doOperationQueueing()
}
}
}
var room: Room! {
didSet {
navigationItem.title = room.title
}
}

func doOperationQueueing() {
let operationQueue = NSOperationQueue()
operationQueue.suspended = true


let fetchFirst = FetchOperation()
fetchFirst.operationBlock = {
self.messageFirebase.onceQueryForValue()
print("fetchFirst done")
}

let listen = FetchOperation()
listen.operationBlock = {
self.messageFirebase.startListener(forLast: 1)
print("listen done")
}

listen.addDependency(fetchFirst)

operationQueue.addOperation(fetchFirst)
operationQueue.addOperation(listen)
operationQueue.suspended = false
}

var currentChannel:Channel! {
didSet {
if user != nil {
setUpMessageFirebase()
doOperationQueueing()
}
setUpMessageFirebase()
messageFirebase.startListenerForAll()
guard let roomLabel = textView else { return }
roomLabel.text = room.title + " - " + currentChannel.title
}
}

let manager = FirebaseManager.manager
let ref = FirebaseManager.manager.ref

func addRoomToRecent() {
guard let user = user else { return }
guard !(user.recentRooms.contains ({ (room: Room) -> Bool in
guard !(FirebaseManager.manager.user.recentRooms.contains ({ (room: Room) -> Bool in
return room === self.room
})) else { return }
user.recentRoomUIDs.append(room.uid)
user.recentRooms.append(room)
}

override func viewDidLoad() {
super.viewDidLoad()

textView.autocorrectionType = UITextAutocorrectionType.Yes
uiSetup()
FirebaseManager.manager.user.recentRoomUIDs.append(room.uid)
FirebaseManager.manager.user.recentRooms.append(room)
}


override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
user = manager.user

}

var startUID: String!
var endUID: String!
var increment: UInt = 10

//MARK Actions
@IBAction func sendButton(sender: UIButton) {
if FirebaseManager.manager.authData == nil {
presentLoginScreen()
return
}
if (textView.text != "") {
guard let user = user else { return }
Message.createNewMessageWith(textView.text, timeObject: FirebaseServerValue.timestamp(), poster: user, channel: currentChannel, withCompletionHandler: nil)
textView.text = ""
Message.createNewMessageWith(textView.text, timeObject: FirebaseServerValue.timestamp(), poster: FirebaseManager.manager.user, channel: currentChannel, withCompletionHandler: nil)
textView.text = ""
}
}

// @IBAction func onBrowseTapped(sender: UIBarButtonItem) {
// performSegueWithIdentifier("", sender: nil)
// }
func menuChannelViewController(menuChannelViewController: MenuChannelViewController, didSelectChannel channel: AnyObject) {
guard let selectedChannel = channel as? Channel else { return }
currentChannel = selectedChannel

Large diffs are not rendered by default.

@@ -5,114 +5,102 @@ import FBSDKShareKit
import AFNetworking

class ProfileViewController: UIViewController, FBSDKLoginButtonDelegate {

var user: User? {
didSet{
guard let user = user else { return }
if let nameLabel = nameLabel {
nameLabel.text = user.name
}
if let profileImageView = profileImageView {
profileImageView.setImageWithURL(NSURL(string: user.profileImageURL)!, placeholderImage: UIImage(named: "profileImageDummy"))
let imageHeight = profileImageView.frame.size.height
profileImageView.layer.cornerRadius = imageHeight / 2
}
}
}
@IBOutlet var topContainer: UIView!

@IBOutlet var settingsButton: UIButton!

@IBOutlet weak var profileImageView: UIImageView! {
didSet {
guard let user = user else { return }
profileImageView.setImageWithURL(NSURL(string: user.profileImageURL)!, placeholderImage: UIImage(named: "profileImageDummy"))
let imageHeight = profileImageView.frame.size.height
profileImageView.layer.cornerRadius = imageHeight / 2
}
}
@IBOutlet weak var nameLabel: UILabel! {
didSet {
guard let user = user else { return }
nameLabel.text = user.name
}
}
@IBOutlet weak var recentTableView: UITableView! {
didSet {
recentTableView.delegate = self
recentTableView.dataSource = self
}
}
@IBOutlet weak var followingCountLabel: UILabel! {
didSet {
followingCountLabel.text = "Jerry we don't"
}
}
@IBOutlet weak var followerCountLabel: UILabel! {
didSet {
followerCountLabel.text = "have followers?"
}
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
user = FirebaseManager.manager.user

@IBOutlet var topContainer: UIView!
@IBOutlet var settingsButton: UIButton!

@IBOutlet weak var profileImageView: UIImageView! {
didSet {
let imageHeight = profileImageView.frame.size.height
profileImageView.layer.cornerRadius = imageHeight / 2
}
}
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var recentTableView: UITableView! {
didSet {
recentTableView.delegate = self
recentTableView.dataSource = self
}
}

func updateUserLabels() {
profileImageView.setImageWithURL(NSURL(string: FirebaseManager.manager.user.profileImageURL)!, placeholderImage: UIImage(named: "profileImageDummy"))
nameLabel.text = FirebaseManager.manager.user.name
}

override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
updateUserLabels()
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)

}
override func viewDidLoad() {
super.viewDidLoad()
let size = view.frame.size
let button = createFBLoginButtonWithPosition(size.width * 0.8, y: size.height * 0.1)
button.delegate = self
setUpUI()
}

override func loginButtonDidLogOut(loginButton: FBSDKLoginButton!) {
super.loginButtonDidLogOut(loginButton)
user = FirebaseManager.manager.user
updateUserLabels()
}

override func loginButton(loginButton: FBSDKLoginButton!, didCompleteWithResult result: FBSDKLoginManagerLoginResult!, error: NSError!) {
super.loginButton(loginButton, didCompleteWithResult: result, error: error)
updateUserLabels()
}

override func viewDidLoad() {
super.viewDidLoad()
let size = view.frame.size
let button = createFBLoginButtonWithPosition(size.width * 0.8, y: size.height * 0.1)
button.delegate = self
setUpUI()
}

override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "updateUserLabels", name: UIApplicationDidBecomeActiveNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "updateUserLabels", name: "FirebaseAuth", object: nil)
}

override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
NSNotificationCenter.defaultCenter().removeObserver(self)
}

func setUpUI (){
let backgroundColor = Theme.Colors.BackgroundColor.color
recentTableView.backgroundColor = backgroundColor
recentTableView.tableFooterView = UIView()
topContainer.backgroundColor = backgroundColor
nameLabel.font = Theme.Fonts.NormalTypeFace.font
settingsButton.hidden = true
}

func setUpUI (){
let backgroundColor = Theme.Colors.BackgroundColor.color
recentTableView.backgroundColor = backgroundColor
recentTableView.tableFooterView = UIView()
topContainer.backgroundColor = backgroundColor
nameLabel.font = Theme.Fonts.NormalTypeFace.font
settingsButton.hidden = true
}
}

extension ProfileViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithCellIdentifier(.ProfileCell)
cell.textLabel?.text = "Let's copy twitch/facebook messenger/hangouts for things to put here?"
switch (indexPath.section, indexPath.row){
case (0,0):
cell.textLabel?.text = "Log Out"
cell.textLabel?.font = Theme.Fonts.BoldNormalTypeFace.font
cell.textLabel?.textColor = UIColor.whiteColor()
cell.backgroundColor = Theme.Colors.ForegroundColor.color
default:
break
}
return cell
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
switch (indexPath.section, indexPath.row){
case(0,0):
//Log Out here
break
default:
//Go To Recent Messages Here
break
}
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithCellIdentifier(.ProfileCell)
cell.textLabel?.text = "Let's copy twitch/facebook messenger/hangouts for things to put here?"
switch (indexPath.section, indexPath.row){
case (0,0):
cell.textLabel?.text = "Log Out"
cell.textLabel?.font = Theme.Fonts.BoldNormalTypeFace.font
cell.textLabel?.textColor = UIColor.whiteColor()
cell.backgroundColor = Theme.Colors.ForegroundColor.color
default:
break
}
return cell
}

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
switch (indexPath.section, indexPath.row){
case(0,0):
//Log Out here
break
default:
//Go To Recent Messages Here
break
}
}
}