ReactiveX / RxSwift

Reactive Programming in Swift
MIT License
24.37k stars 4.17k forks source link

use addDisposableTo method can not make a warning #1427

Closed dakeshi closed 7 years ago

dakeshi commented 7 years ago

Short description of the issue: When I search some tutorials about RxSwift, I find out so many sample codes still use deprecated addDisposableTo method instead of disposed(by:). I think that the main reason is a missing warning message.

Deprecated addDisposableTo method can not make a warning during a build time. To show a warning and avoid an old method, it need to comment out in Deprecated.swift.

/// **@available(\*, deprecated, message="use disposed(by:) instead")** 

Um. it is not the correct statement. It should be:

@available(*, deprecated, message: "use disposed(by:) instead")

Expected outcome:

show a warning to avoid to use deprecated method

What actually happens:

no warning.

RxSwift/RxCocoa/RxBlocking/RxTest version/commit

3.6.1

Platform/Environment

How easy is to reproduce? (chances of successful reproduce after running the self contained code)

Xcode version:

9.0

Installation method:

I have multiple versions of Xcode installed: (so we can know if this is a potential cause of your issue)

Level of RxSwift knowledge: (this is so we can understand your level of knowledge and formulate the response in an appropriate manner)

kzaher commented 7 years ago

Hi @dakeshi ,

Thnx for reporting this. We haven't been able to deprecate this for 3.x release, but we've deprecated it now in 4.x.