RecentViewController1.swift 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. //
  2. // RecentViewController1.swift
  3. // SocketChat
  4. //
  5. // Created by Justine on 16/6/16.
  6. // Copyright © 2016年 AppCoda. All rights reserved.
  7. //
  8. import UIKit
  9. class RecentViewController1: UITableViewController {
  10. var dataList = NSMutableArray()
  11. var mysocket:TCPClient?
  12. override func viewDidLoad() {
  13. super.viewDidLoad()
  14. // Uncomment the following line to preserve selection between presentations
  15. // self.clearsSelectionOnViewWillAppear = false
  16. // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
  17. // self.navigationItem.rightBarButtonItem = self.editButtonItem()
  18. //绘制基本界面
  19. self.tableView?.dataSource = self
  20. self.tableView?.delegate = self
  21. // let story = UIStoryboard(name: "Main", bundle: nil)
  22. // let RecentVC = story.instantiateViewControllerWithIdentifier("RecentView")
  23. TCPClient.shareInstance.connect(GET_APP_SERVER)
  24. let params = ["serverID":GET_APP_SERVER,
  25. "loginName":GET_USER_NAME,
  26. "password":GET_USER_PWD,
  27. "type":1,
  28. "clientType":1,
  29. "deviceToken":GET_USER_TOKEN,
  30. ]
  31. /*let params:[String] = ["serverID \(GET_SERVER_ID as! String)",
  32. "loginName = \(GET_USER_NAME as! String)",
  33. "password = a12345678",
  34. "type = 1 ",
  35. "clientType = 1",
  36. "deviceToken = \(GET_USER_TOKEN?.stringValue)"
  37. //"deviceToken = \(GET_USER_TOKEN as! String)"
  38. ]*/
  39. TCPClient.shareInstance.recived("user.auth")
  40. mysocket?.send("user.auth", data: params)
  41. //TCPClient.shareInstance.recived("user.auth")
  42. }
  43. /**
  44. ......
  45. */
  46. func regNotification() {
  47. }
  48. override func didReceiveMemoryWarning() {
  49. super.didReceiveMemoryWarning()
  50. // Dispose of any resources that can be recreated.
  51. }
  52. // MARK: - Table view data source
  53. override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
  54. // #warning Incomplete implementation, return the number of sections
  55. return 1
  56. }
  57. override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  58. // #warning Incomplete implementation, return the number of rows
  59. return 100
  60. }
  61. override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
  62. let cell = tableView.dequeueReusableCellWithIdentifier("reuseIdentifier", forIndexPath: indexPath)
  63. // Configure the cell...
  64. return cell
  65. }
  66. /*
  67. // Override to support conditional editing of the table view.
  68. override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
  69. // Return false if you do not want the specified item to be editable.
  70. return true
  71. }
  72. */
  73. /*
  74. // Override to support editing the table view.
  75. override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
  76. if editingStyle == .Delete {
  77. // Delete the row from the data source
  78. tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
  79. } else if editingStyle == .Insert {
  80. // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
  81. }
  82. }
  83. */
  84. /*
  85. // Override to support rearranging the table view.
  86. override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) {
  87. }
  88. */
  89. /*
  90. // Override to support conditional rearranging of the table view.
  91. override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool {
  92. // Return false if you do not want the item to be re-orderable.
  93. return true
  94. }
  95. */
  96. /*
  97. // MARK: - Navigation
  98. // In a storyboard-based application, you will often want to do a little preparation before navigation
  99. override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
  100. // Get the new view controller using segue.destinationViewController.
  101. // Pass the selected object to the new view controller.
  102. }
  103. */
  104. }