小编Bha*_*ath的帖子

如何在 RxSwift 中为行编写高度?

我想将以下代码转换为RxSwift. 还请帮助我如何ActionRxSwift.

ReactiveCocoa或者RxSwift哪个更适合在 swift3 中使用?

func tableView(_ tableView: UITableView, numberOfRowsInSection section: 
Int) -> Int {
    return posts.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: 
IndexPath) -> UITableViewCell {
    let cell: BTSTableViewCell = self.tableView.dequeueReusableCell(withIdentifier: "BTSTableViewCellIdentifier")! as! BTSTableViewCell

    cell.configureWithPost(posts[indexPath.row])
    cell.delegate = self
    return cell

}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {

    // 259.5+ labelHeight+ bigImageHeight

    let postViewModel = posts[indexPath.row]

    //caption height
    var captionHeight = postViewModel.textDetail?.height(withConstrainedWidth: tableView.bounds.size.width - 20, font: …
Run Code Online (Sandbox Code Playgroud)

ios reactive-cocoa rx-swift swift3

8
推荐指数
3
解决办法
8398
查看次数

标签 统计

ios ×1

reactive-cocoa ×1

rx-swift ×1

swift3 ×1