Skip to content

Commit

Permalink
Fixes code example in comments of RxTableViewExtensions that didn't c…
Browse files Browse the repository at this point in the history
…ompile. #947
  • Loading branch information
kzaher committed Oct 20, 2016
1 parent ac52c21 commit fe800bf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions RxCocoa/iOS/UICollectionView+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ extension Reactive where Base: UICollectionView {

items
.bindTo(collectionView.rx.items) { (collectionView, row, element) in
let indexPath = IndexPath(forItem: row, inSection: 0)
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath) as! NumberCell
let indexPath = IndexPath(row: row, section: 0)
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as! NumberCell
cell.value?.text = "\(element) @ \(row)"
return cell
}
Expand Down Expand Up @@ -126,7 +126,7 @@ extension Reactive where Base: UICollectionView {
])

dataSource.configureCell = { (dataSource, cv, indexPath, element) in
let cell = cv.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath) as! NumberCell
let cell = cv.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as! NumberCell
cell.value?.text = "\(element) @ row \(indexPath.row)"
return cell
}
Expand All @@ -146,7 +146,7 @@ extension Reactive where Base: UICollectionView {
// This is called for sideeffects only, and to make sure delegate proxy is in place when
// data source is being bound.
// This is needed because theoretically the data source subscription itself might
// call `self.rx_delegate`. If that happens, it might cause weird side effects since
// call `self.rx.delegate`. If that happens, it might cause weird side effects since
// setting data source will set delegate, and UICollectionView might get into a weird state.
// Therefore it's better to set delegate proxy first, just to be sure.
_ = self.delegate
Expand Down
6 changes: 3 additions & 3 deletions RxCocoa/iOS/UITableView+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extension Reactive where Base: UITableView {

items
.bindTo(tableView.rx.items) { (tableView, row, element) in
let cell = tableView.dequeueReusableCellWithIdentifier("Cell")!
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell")!
cell.textLabel?.text = "\(element) @ row \(row)"
return cell
}
Expand Down Expand Up @@ -130,7 +130,7 @@ extension Reactive where Base: UITableView {
])

dataSource.configureCell = { (dataSource, tv, indexPath, element) in
let cell = tv.dequeueReusableCellWithIdentifier("Cell")!
let cell = tv.dequeueReusableCell(withIdentifier: "Cell")!
cell.textLabel?.text = "\(element) @ row \(indexPath.row)"
return cell
}
Expand All @@ -150,7 +150,7 @@ extension Reactive where Base: UITableView {
// This is called for sideeffects only, and to make sure delegate proxy is in place when
// data source is being bound.
// This is needed because theoretically the data source subscription itself might
// call `self.rx_delegate`. If that happens, it might cause weird side effects since
// call `self.rx.delegate`. If that happens, it might cause weird side effects since
// setting data source will set delegate, and UITableView might get into a weird state.
// Therefore it's better to set delegate proxy first, just to be sure.
_ = self.delegate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ class APIWrappersViewController: ViewController {

manager.rx.didUpdateLocations
.subscribe(onNext: { x in
print("rx_didUpdateLocations \(x)")
print("rx.didUpdateLocations \(x)")
})
.addDisposableTo(disposeBag)

_ = manager.rx.didFailWithError
.subscribe(onNext: { x in
print("rx_didFailWithError \(x)")
print("rx.didFailWithError \(x)")
})

manager.rx.didChangeAuthorizationStatus
Expand Down
4 changes: 2 additions & 2 deletions RxExample/RxExample/Operators.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ func <-> <Base: UITextInput>(textInput: TextInput<Base>, variable: Variable<Stri
func <-> <T>(property: ControlProperty<T>, variable: Variable<T>) -> Disposable {
if T.self == String.self {
#if DEBUG
fatalError("It is ok to delete this message, but this is here to warn that you are maybe trying to bind to some `rx_text` property directly to variable.\n" +
fatalError("It is ok to delete this message, but this is here to warn that you are maybe trying to bind to some `rx.text` property directly to variable.\n" +
"That will usually work ok, but for some languages that use IME, that simplistic method could cause unexpected issues because it will return intermediate results while text is being inputed.\n" +
"REMEDY: Just use `textField <-> variable` instead of `textField.rx_text <-> variable`.\n" +
"REMEDY: Just use `textField <-> variable` instead of `textField.rx.text <-> variable`.\n" +
"Find out more here: https://github.com/ReactiveX/RxSwift/issues/649\n"
)
#endif
Expand Down

0 comments on commit fe800bf

Please sign in to comment.