Create UITableView programmatically in Swift

前端 未结 8 1302
青春惊慌失措
青春惊慌失措 2020-12-12 12:00

I try to implement UITableView programmatically without use of xib or Storyboards. This is my code:

ViewController.swift

import UIKi         


        
8条回答
  •  春和景丽
    2020-12-12 12:40

    I had a similar issue in that the data would not populate for my programmatic UITableView. This was because I was using a delegate/dataSource without a strong reference. Once I kept a reference to it (I had one class implementing both UITableViewDataSource and UITableViewDelegate), the data was populated.

提交回复
热议问题