File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 99import Foundation
1010
1111
12- public protocol PresentableManager {
12+ public protocol PresentableManager : class {
1313
1414 var bindableData : Observable < PresentableSections > { get }
1515 var data : PresentableSections { get set }
Original file line number Diff line number Diff line change @@ -28,12 +28,15 @@ extension UITableView: PresentableCollectionElement {
2828
2929 public func bind( withPresentableManager manager: inout PresentableManager ) {
3030 let m = manager
31- manager. bindableData. bind ( listener: { ( data) in
32- for section : PresentableSection in m. data {
33- self . register ( section: section)
31+ manager. bindableData. bind { [ weak m] ( data) in
32+ if let data = m? . data {
33+ for section : PresentableSection in data {
34+ self . register ( section: section)
35+ }
3436 }
37+
3538 self . safeReloadData ( )
36- } )
39+ }
3740
3841 register ( presentableSections: & manager. data)
3942
You can’t perform that action at this time.
0 commit comments