TableView not displaying text with JSON data from API call

前端 未结 1 626
走了就别回头了
走了就别回头了 2021-02-07 09:36

I connected to API using Alamofire and SwiftyJson.

I got this JSON return:

{
\"contacts\": [
        {
                     


        
相关标签:
1条回答
  • 2021-02-07 10:09

    You need to implement UITableViewDataSource and UITableViewDelegate like this

    class ViewController:UIViewController, UITableViewDataSource, UITableViewDelegate 
    

    and in viewDidLoad you need to assign DataSource and Delegate to your tableView like this

    override func viewDidLoad() {
        super.viewDidLoad()
        tblJSON.dataSource = self
        tblJSON.delegate = self
        getRequest()
    }
    
    0 讨论(0)
提交回复
热议问题