私は私のテーブルビューは、Rxの変数DZNEmptyDataSetはRxSwiftのテーブルビューバインディングと互換性がありません。誰でもそれを動作させることができましたか?
let Chats = Variable(Section).
Chats.asObservable()
.bind(to: tableView.rx.items(dataSource: dataSource))
にバインドされており、次のように私のDZNコードがある一方でDZNEmptyDataSetで空のデータセットを設定しようとしている:
tableView.emptyDataSetSource = self
tableView.emptyDataSetDelegate = self
func title(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? {
let str = "Welcome"
let attrs = [NSFontAttributeName: UIFont.preferredFont(forTextStyle: UIFontTextStyle.headline)]
return NSAttributedString(string: str, attributes: attrs)
}
func description(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? {
let str = "Tap the button below to add your first grokkleglob."
let attrs = [NSFontAttributeName: UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)]
return NSAttributedString(string: str, attributes: attrs)
}
問題でも、ありますチャットが空の場合、テーブルビューの空のデータセットは表示されません。私がバインド機能を削除すると、それが表示されます。私は誰もが共存させることができたのだろうかと思っていたのですか?
ええ、rxdatasourceにテーブルをバインドするときはうまくいきませんでした。私はそのrxdatasourceと互換性がないと思います。空になっているかどうかでテーブルにオブザーバブルを置かなければならず、それがrefreshemptydatasetを呼び出すならば。 – Ryan