From 6e23f11d58fb6594aeabd69f036dcdd63c5fbb3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0r=C5=AFtek?= <35694712+michalsrutek@users.noreply.github.com> Date: Mon, 18 Mar 2024 10:42:48 +0100 Subject: [PATCH 1/2] Remove Result mention from Playground (#871) Co-authored-by: Michael Brown --- .../Pages/ValidatingProperty.xcplaygroundpage/Contents.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/ReactiveSwift-UIExamples.playground/Pages/ValidatingProperty.xcplaygroundpage/Contents.swift b/ReactiveSwift-UIExamples.playground/Pages/ValidatingProperty.xcplaygroundpage/Contents.swift index aaa837d91..0bca2c2e2 100644 --- a/ReactiveSwift-UIExamples.playground/Pages/ValidatingProperty.xcplaygroundpage/Contents.swift +++ b/ReactiveSwift-UIExamples.playground/Pages/ValidatingProperty.xcplaygroundpage/Contents.swift @@ -6,7 +6,6 @@ **OR**, if you have [Carthage](https://github.com/Carthage/Carthage) installed - `carthage checkout` 1. Open `ReactiveSwift.xcworkspace` - 1. Build `Result-iOS` scheme 1. Build `ReactiveSwift-iOS` scheme 1. Finally open the `ReactiveSwift-UIExamples.playground` through the workspace. 1. Choose `View > Assistant Editor > Show Assistant Editor` From bc833776eb6fff2476ea388248ba15765f0645e7 Mon Sep 17 00:00:00 2001 From: Duncan Cunningham Date: Mon, 18 Mar 2024 11:07:06 +0100 Subject: [PATCH 2/2] Add extension to ScopedDisposable for SerialDisposable (#873) * Add extension to ScopedDisposable for SerialDisposable * Fix user name --------- Co-authored-by: Michael Brown --- CHANGELOG.md | 1 + Sources/Disposable.swift | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e53e5cc5d..ed97c225c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 1. Fix minimum deployment target of iOS 11 in CocoaPods 1. Fix CI release git tag push trigger (#869, kudos to @p4checo) 1. Find and remove items from Bag using a binary search to improve performance when the collection gets large. +2. Add extension to `ScopedDisposable` for inner `SerialDisposable` (#873, kudos to @sirnacnud) # 7.1.1 1. Bumped deployment target to iOS 11, tvOS 11, watchOS 4, macOS 10.13, per Xcode 14 warnings (#865, kudos to @lickel) diff --git a/Sources/Disposable.swift b/Sources/Disposable.swift index 4930c83cf..0614d36ac 100644 --- a/Sources/Disposable.swift +++ b/Sources/Disposable.swift @@ -378,3 +378,19 @@ public final class SerialDisposable: Disposable { state.deinitialize() } } + +extension ScopedDisposable where Inner == SerialDisposable { + /// The current inner disposable of the `SerialDisposable` wrapped + /// in the `ScopedDisposable` to dispose of. + /// + /// Whenever this property is set (even to the same value!), the previous + /// disposable is automatically disposed. + public var inner: Disposable? { + get { + return inner.inner + } + set { + inner.inner = newValue + } + } +}