| | |
| | | @IBOutlet weak var cons_height: NSLayoutConstraint! |
| | | |
| | | private var viewModel = CommentListViewModel() |
| | | private var id:Int! |
| | | |
| | | init(id:Int) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.id = id |
| | | self.viewModel.id.accept(id) |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | |
| | | } |
| | | tf_input.resignFirstResponder() |
| | | |
| | | Services.addQuestion(content: tf_input.text!, meditationId: id).subscribe(onNext: {_ in |
| | | |
| | | }, onError: {_ in |
| | | |
| | | Services.addQuestion(meditationId: viewModel.id.value, content: tf_input.text!).subscribe(onNext: {[weak self] _ in |
| | | self?.viewModel.beginRefresh() |
| | | self?.tf_input.text = "" |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | |
| | | |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_CommentReplyTCell", for: indexPath) as? CommentReplyTCell |
| | | let v = viewModel.dataSource.value?.list[indexPath.row] |
| | | let v = viewModel.dataSource.value?.list[indexPath.section] |
| | | cell?.setText(text: v?.replyContent ?? "") |
| | | return cell! |
| | | } |