| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- //
- // RecentViewController1.swift
- // SocketChat
- //
- // Created by Justine on 16/6/16.
- // Copyright © 2016年 AppCoda. All rights reserved.
- //
- import UIKit
- class RecentViewController1: UITableViewController {
- var dataList = NSMutableArray()
- var mysocket:TCPClient?
- override func viewDidLoad() {
- super.viewDidLoad()
-
- // Uncomment the following line to preserve selection between presentations
- // self.clearsSelectionOnViewWillAppear = false
- // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
- // self.navigationItem.rightBarButtonItem = self.editButtonItem()
-
-
- //绘制基本界面
- self.tableView?.dataSource = self
- self.tableView?.delegate = self
-
- // let story = UIStoryboard(name: "Main", bundle: nil)
- // let RecentVC = story.instantiateViewControllerWithIdentifier("RecentView")
-
- TCPClient.shareInstance.connect(GET_APP_SERVER)
- let params = ["serverID":GET_APP_SERVER,
- "loginName":GET_USER_NAME,
- "password":GET_USER_PWD,
- "type":1,
- "clientType":1,
- "deviceToken":GET_USER_TOKEN,
- ]
-
-
- /*let params:[String] = ["serverID \(GET_SERVER_ID as! String)",
- "loginName = \(GET_USER_NAME as! String)",
- "password = a12345678",
- "type = 1 ",
- "clientType = 1",
- "deviceToken = \(GET_USER_TOKEN?.stringValue)"
- //"deviceToken = \(GET_USER_TOKEN as! String)"
- ]*/
- TCPClient.shareInstance.recived("user.auth")
- mysocket?.send("user.auth", data: params)
-
- //TCPClient.shareInstance.recived("user.auth")
-
- }
- /**
- ......
- */
- func regNotification() {
- }
-
-
-
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
- // MARK: - Table view data source
- override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
- // #warning Incomplete implementation, return the number of sections
- return 1
- }
- override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- // #warning Incomplete implementation, return the number of rows
- return 100
- }
- override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCellWithIdentifier("reuseIdentifier", forIndexPath: indexPath)
- // Configure the cell...
- return cell
- }
-
- /*
- // Override to support conditional editing of the table view.
- override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
- // Return false if you do not want the specified item to be editable.
- return true
- }
- */
- /*
- // Override to support editing the table view.
- override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
- if editingStyle == .Delete {
- // Delete the row from the data source
- tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
- } else if editingStyle == .Insert {
- // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
- }
- }
- */
- /*
- // Override to support rearranging the table view.
- override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) {
- }
- */
- /*
- // Override to support conditional rearranging of the table view.
- override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool {
- // Return false if you do not want the item to be re-orderable.
- return true
- }
- */
- /*
- // 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.
- }
- */
- }
|