     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
 
         let cell = UITableViewCell.init()
-        cell.textLabel?.text = "hi"
-        cell.contentView.backgroundColor = UIColor.init(red: 0.3, green: 0.4, blue: 0.5, alpha: 1)
+
+        let d = self.messages[indexPath.row] as! JSON
+        cell.textLabel?.text = d["abstract"].stringValue
+        cell.textLabel?.numberOfLines = 0
+
+        cell.contentView.backgroundColor = UIColor.init(red:CGFloat((arc4random()%100))/100.0, green:CGFloat((arc4random()%100))/100.0, blue: CGFloat((arc4random()%100))/100.0, alpha: 0.9)
 
         let view = UIView()
-        view.backgroundColor = UIColor.red
+        view.backgroundColor = UIColor.init(red: CGFloat(arc4random()), green:CGFloat(arc4random()), blue: CGFloat(arc4random()), alpha: 1)
         cell.contentView.addSubview(view)
+        cell.textLabel?.snp.remakeConstraints({ (make) in
+            make.left.equalTo(cell.contentView.snp.left).offset(15)
+            make.width.lessThanOrEqualTo(cell.contentView.snp.width)
+            make.bottom.equalTo(cell.contentView.snp.bottom).offset(-20)
+            make.top.equalTo(cell.contentView.snp.top).offset(20)
+        })
         view.snp.makeConstraints { (make) in
-            make.bottom.equalTo(cell.contentView.snp.bottom).offset(-20)
+//            make.bottom.equalTo(cell.contentView.snp.bottom).offset(-20)
+            make.top.equalTo(cell.contentView.snp.top).offset(20)
             make.right.equalTo(cell.contentView.snp.right).offset(-20)
             make.size.equalTo(CGSize(width: 100, height: 100))
-            make.top.equalTo(cell.contentView.snp.top).offset(20)
-
+            make.left.equalTo(cell.textLabel!.snp.right).offset(20)
         }
 
         return cell

        self.automaticallyAdjustsScrollViewInsets = false
        bigLbl.text = "News"
        subLbl.text = "some hot news"
      }

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

    


import UIKit
import SnapKit
import SwiftyJSON
import Alamofire

class NewsViewController: UIViewController,UITableViewDataSource,UITableViewDelegate {

    @IBOutlet weak var bigLbl: UILabel!
    @IBOutlet weak var subLbl: UILabel!

    let newsURL = "https://toutiao.com/api/article/recent/?source=2&category=news_hot&as=A1D5D87595C3287"

    @IBOutlet weak var tableView: UITableView!

    var messages = Array<Any>()


    override func viewDidLoad() {
        super.viewDidLoad()
