From 1a82b57f87b0cfd22bae976f362db5f7b858731a Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Sat, 17 Dec 2016 23:11:05 +0100 Subject: [PATCH] Adds support for iOS 10.2 --- Tests/RxCocoaTests/UISwitch+RxTests.swift | 14 +++++++++----- scripts/common.sh | 6 +++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Tests/RxCocoaTests/UISwitch+RxTests.swift b/Tests/RxCocoaTests/UISwitch+RxTests.swift index 9d594a6bb..9b7d5350e 100644 --- a/Tests/RxCocoaTests/UISwitch+RxTests.swift +++ b/Tests/RxCocoaTests/UISwitch+RxTests.swift @@ -18,16 +18,20 @@ import XCTest } + // there was a leak on versions prior to 10.2 extension UISwitchTests { - func testSwitch_ValueCompletesOnDealloc() { - let createView: () -> UISwitch = { UISwitch(frame: CGRect(x: 0, y: 0, width: 1, height: 1)) } - ensurePropertyDeallocated(createView, true) { (view: UISwitch) in view.rx.value } + if #available(iOS 10.2, *) { + let createView: () -> UISwitch = { UISwitch(frame: CGRect(x: 0, y: 0, width: 1, height: 1)) } + ensurePropertyDeallocated(createView, true) { (view: UISwitch) in view.rx.value } + } } func testSwitch_isOnCompletesOnDealloc() { - let createView: () -> UISwitch = { UISwitch(frame: CGRect(x: 0, y: 0, width: 1, height: 1)) } - ensurePropertyDeallocated(createView, true) { (view: UISwitch) in view.rx.isOn } + if #available(iOS 10.2, *) { + let createView: () -> UISwitch = { UISwitch(frame: CGRect(x: 0, y: 0, width: 1, height: 1)) } + ensurePropertyDeallocated(createView, true) { (view: UISwitch) in view.rx.isOn } + } } } diff --git a/scripts/common.sh b/scripts/common.sh index 78c5d5b43..3b8112d2a 100755 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -21,8 +21,8 @@ BOLDWHITE="\033[1m\033[37m" # make sure all tests are passing -if [ `xcrun simctl list runtimes | grep com.apple.CoreSimulator.SimRuntime.iOS-10-1 | wc -l` -eq 1 ]; then - DEFAULT_IOS_SIMULATOR=RxSwiftTest/iPhone-6/iOS/10.1 +if [ `xcrun simctl list runtimes | grep com.apple.CoreSimulator.SimRuntime.iOS-10-2 | wc -l` -eq 1 ]; then + DEFAULT_IOS_SIMULATOR=RxSwiftTest/iPhone-6/iOS/10.2 else DEFAULT_IOS_SIMULATOR=RxSwiftTest/iPhone-6/iOS/10.0 fi @@ -33,7 +33,7 @@ else DEFAULT_WATCHOS_SIMULATOR=RxSwiftTest/Apple-Watch-38mm/watchOS/3.0 fi -if [ `xcrun simctl list runtimes | grep com.apple.CoreSimulator.SimRuntime.tvOS-10-1 | wc -l` -eq 1 ]; then +if [ `xcrun simctl list runtimes | grep com.apple.CoreSimulator.SimRuntime.tvOS-10-2 | wc -l` -eq 1 ]; then DEFAULT_TVOS_SIMULATOR=RxSwiftTest/Apple-TV-1080p/tvOS/10.1 else DEFAULT_TVOS_SIMULATOR=RxSwiftTest/Apple-TV-1080p/tvOS/10.0