Skip to content

Commit

Permalink
Removed problematic function for known issue in Xcode 13.0 as a worka…
Browse files Browse the repository at this point in the history
…round for apps with deployment targets before iOS 11.
  • Loading branch information
Thomas Kalhøj Clemensen committed Sep 23, 2021
1 parent 96f0b23 commit 355d6d7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ import Combine

@available(iOS 13.0, *)
extension Publisher {

/// THIS FUNCTION IS REMOVED TO SUPPORT pre iOS 11 apps for Xcode 13.0. There is a known issue where Combine code fails to build when building for armv7
/// (this is in the release notes of Xcode 13.0)
/// THIS FUNCTION IS ONLY REMOVED IN A WORKAROUND VERSION OF THIS FRAMEWORK.
/// Receives on `DispatchQueue.main`
public func receiveOnMain() -> Publishers.ReceiveOn<Self, DispatchQueue> {
return self.receive(on: DispatchQueue.main)
}
// public func receiveOnMain() -> Publishers.ReceiveOn<Self, DispatchQueue> {
// return self.receive(on: DispatchQueue.main)
// }

/// Zips conditionally based on `condition`.
/// Uses `Just` with fallback value if `condition` is `false`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ final class PublisherTests: XCTestCase {
super.tearDown()
}

func testIsOnMain() {
var cancelBag = Set<AnyCancellable>()

PassthroughSubject<Void, Never>()
.receive(on: DispatchQueue.global(qos: .background))
.receiveOnMain()
.sink(receiveValue: { _ in
XCTAssertTrue(Thread.isMainThread)
})
.store(in: &cancelBag)
}
// func testIsOnMain() {
// var cancelBag = Set<AnyCancellable>()
//
// PassthroughSubject<Void, Never>()
// .receive(on: DispatchQueue.global(qos: .background))
// .receiveOnMain()
// .sink(receiveValue: { _ in
// XCTAssertTrue(Thread.isMainThread)
// })
// .store(in: &cancelBag)
// }

func testZipIf() {
let expectationFalseCondition = XCTestExpectation(description: "False expectation never returned")
Expand Down

0 comments on commit 355d6d7

Please sign in to comment.