From c4eb18acfdc08b1bfbb0201886ae35ed3eb50cd2 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Wed, 30 Dec 2015 02:20:24 +0100 Subject: [PATCH] Deprecates `UIAlertView` and `UIActionSheet` extensions. --- CHANGELOG.md | 4 ++++ RxCocoa/iOS/Proxies/RxActionSheetDelegateProxy.swift | 1 + RxCocoa/iOS/Proxies/RxAlertViewDelegateProxy.swift | 5 +++-- RxCocoa/iOS/UIActionSheet+Rx.swift | 4 ++++ RxCocoa/iOS/UIAlertView+Rx.swift | 4 ++++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bb9f082..c2443ccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -126,6 +126,10 @@ let ( ... If you want to continue using free functions form, you can define your free function aliases for `Observable` factory methods (basically copy deprecated methods). +* Deprecates `UIAlertView` extensions. + * These extensions could be stored locally if needed. +* Deprecates `UIActionSheet` extensions. + * These extensions could be stored locally if needed. * Deprecates `rx_controlEvents` in favor of `rx_controlEvent`. * Deprecates `MainScheduler.sharedInstance` in favor of `MainScheduler.instance` * Deprecates `ConcurrentMainScheduler.sharedInstance` in favor of `ConcurrentMainScheduler.instance` diff --git a/RxCocoa/iOS/Proxies/RxActionSheetDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxActionSheetDelegateProxy.swift index fa9f1deb..d71def5b 100644 --- a/RxCocoa/iOS/Proxies/RxActionSheetDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxActionSheetDelegateProxy.swift @@ -13,6 +13,7 @@ import UIKit import RxSwift #endif +@available(*, deprecated=2.0.0, message="This class is deprecated by Apple. Removing official support.") class RxActionSheetDelegateProxy : DelegateProxy , UIActionSheetDelegate , DelegateProxyType { diff --git a/RxCocoa/iOS/Proxies/RxAlertViewDelegateProxy.swift b/RxCocoa/iOS/Proxies/RxAlertViewDelegateProxy.swift index d29c175c..ff04e492 100644 --- a/RxCocoa/iOS/Proxies/RxAlertViewDelegateProxy.swift +++ b/RxCocoa/iOS/Proxies/RxAlertViewDelegateProxy.swift @@ -13,15 +13,16 @@ import UIKit import RxSwift #endif +@available(*, deprecated=2.0.0, message="This class is deprecated by Apple. Removing official support.") class RxAlertViewDelegateProxy : DelegateProxy , UIAlertViewDelegate , DelegateProxyType { - + class func currentDelegateFor(object: AnyObject) -> AnyObject? { let alertView: UIAlertView = castOrFatalError(object) return alertView.delegate } - + class func setCurrentDelegate(delegate: AnyObject?, toObject object: AnyObject) { let alertView: UIAlertView = castOrFatalError(object) alertView.delegate = castOptionalOrFatalError(delegate) diff --git a/RxCocoa/iOS/UIActionSheet+Rx.swift b/RxCocoa/iOS/UIActionSheet+Rx.swift index 52738710..781e0798 100644 --- a/RxCocoa/iOS/UIActionSheet+Rx.swift +++ b/RxCocoa/iOS/UIActionSheet+Rx.swift @@ -21,6 +21,7 @@ extension UIActionSheet { For more information take a look at `DelegateProxyType` protocol documentation. */ + @available(*, deprecated=2.0.0, message="This class is deprecated by Apple. Removing official support.") public var rx_delegate: DelegateProxy { return proxyForObject(RxActionSheetDelegateProxy.self, self) } @@ -28,6 +29,7 @@ extension UIActionSheet { /** Reactive wrapper for `delegate` message. */ + @available(*, deprecated=2.0.0, message="This class is deprecated by Apple. Removing official support.") public var rx_clickedButtonAtIndex: ControlEvent { let source = rx_delegate.observe("actionSheet:clickedButtonAtIndex:") .map { a in @@ -40,6 +42,7 @@ extension UIActionSheet { /** Reactive wrapper for `delegate` message. */ + @available(*, deprecated=2.0.0, message="This class is deprecated by Apple. Removing official support.") public var rx_willDismissWithButtonIndex: ControlEvent { let source = rx_delegate.observe("actionSheet:willDismissWithButtonIndex:") .map { a in @@ -52,6 +55,7 @@ extension UIActionSheet { /** Reactive wrapper for `delegate` message. */ + @available(*, deprecated=2.0.0, message="This class is deprecated by Apple. Removing official support.") public var rx_didDismissWithButtonIndex: ControlEvent { let source = rx_delegate.observe("actionSheet:didDismissWithButtonIndex:") .map { a in diff --git a/RxCocoa/iOS/UIAlertView+Rx.swift b/RxCocoa/iOS/UIAlertView+Rx.swift index 6a168e98..9e3fb797 100644 --- a/RxCocoa/iOS/UIAlertView+Rx.swift +++ b/RxCocoa/iOS/UIAlertView+Rx.swift @@ -20,6 +20,7 @@ extension UIAlertView { For more information take a look at `DelegateProxyType` protocol documentation. */ + @available(*, deprecated=2.0.0, message="This class is deprecated by Apple. Removing official support.") public var rx_delegate: DelegateProxy { return proxyForObject(RxAlertViewDelegateProxy.self, self) } @@ -27,6 +28,7 @@ extension UIAlertView { /** Reactive wrapper for `delegate` message. */ + @available(*, deprecated=2.0.0, message="This class is deprecated by Apple. Removing official support.") public var rx_clickedButtonAtIndex: ControlEvent { let source = rx_delegate.observe("alertView:clickedButtonAtIndex:") .map { a in @@ -39,6 +41,7 @@ extension UIAlertView { /** Reactive wrapper for `delegate` message. */ + @available(*, deprecated=2.0.0, message="This class is deprecated by Apple. Removing official support.") public var rx_willDismissWithButtonIndex: ControlEvent { let source = rx_delegate.observe("alertView:willDismissWithButtonIndex:") .map { a in @@ -51,6 +54,7 @@ extension UIAlertView { /** Reactive wrapper for `delegate` message. */ + @available(*, deprecated=2.0.0, message="This class is deprecated by Apple. Removing official support.") public var rx_didDismissWithButtonIndex: ControlEvent { let source = rx_delegate.observe("alertView:didDismissWithButtonIndex:") .map { a in