Skip to content

Commit

Permalink
Adds support for iOS 10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kzaher committed Dec 17, 2016
1 parent 5830c6f commit 1a82b57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions Tests/RxCocoaTests/UISwitch+RxTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1a82b57

Please sign in to comment.