Skip to content
Permalink
Browse files

Merge pull request #106 from ReactorKit/swift-5.0

Let's Swift 5.0 🚀
  • Loading branch information...
devxoul committed Jun 15, 2019
2 parents 4b78322 + 900bf02 commit c1db4126e4069aab5c0c4dcafa88a3c8fde8eda1

This file was deleted.

@@ -1,18 +1,18 @@
osx_image: xcode10
osx_image: xcode10.2
language: objective-c
sudo: required
env:
global:
- PROJECT="ReactorKit.xcodeproj"
- SCHEME="ReactorKit-Package"
- IOS_SDK="iphonesimulator12.0"
- IOS_SDK="iphonesimulator12.2"
- MACOS_SDK="macosx10.14"
- TVOS_SDK="appletvsimulator12.0"
- TVOS_SDK="appletvsimulator12.2"
- FRAMEWORK="ReactorKit"
matrix:
- SDK="$IOS_SDK" DESTINATION="platform=iOS Simulator,name=iPhone 8,OS=12.0"
- SDK="$IOS_SDK" DESTINATION="platform=iOS Simulator,name=iPhone 8,OS=12.2"
- SDK="$MACOS_SDK" DESTINATION="arch=x86_64"
- SDK="$TVOS_SDK" DESTINATION="OS=12.0,name=Apple TV 4K"
- SDK="$TVOS_SDK" DESTINATION="OS=12.2,name=Apple TV 4K"

install:
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
@@ -6,17 +6,17 @@
"repositoryURL": "https://github.com/devxoul/RxExpect.git",
"state": {
"branch": null,
"revision": "d27d2f730a41728e0f4ed7d8326e14296d3a2766",
"version": "1.1.0"
"revision": "c3a3bb3d46ee831582c6619ecc48cda1cdbff890",
"version": "2.0.0"
}
},
{
"package": "RxSwift",
"repositoryURL": "https://github.com/ReactiveX/RxSwift.git",
"state": {
"branch": null,
"revision": "0df62b4d562f8620d4b795b18e4adf0b631527a1",
"version": "4.3.1"
"revision": "b3e888b4972d9bc76495dd74d30a8c7fad4b9395",
"version": "5.0.1"
}
}
]
@@ -1,19 +1,23 @@
// swift-tools-version:4.2
// swift-tools-version:5.0
import PackageDescription

let package = Package(
name: "ReactorKit",
platforms: [
.macOS(.v10_11), .iOS(.v8), .tvOS(.v9), .watchOS(.v3)
],
products: [
.library(name: "ReactorKit", targets: ["ReactorKit"]),
],
dependencies: [
.package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "4.0.0")),
.package(url: "https://github.com/devxoul/RxExpect.git", .upToNextMajor(from: "1.0.0"))
.package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "5.0.0")),
.package(url: "https://github.com/devxoul/RxExpect.git", .upToNextMajor(from: "2.0.0"))
],
targets: [
.target(name: "ReactorKit", dependencies: ["ReactorKitRuntime", "RxSwift"]),
.target(name: "ReactorKitRuntime", dependencies: []),
.testTarget(name: "ReactorKitTests", dependencies: ["ReactorKit", "RxExpect"]),
]
],
swiftLanguageVersions: [.v5]
)
@@ -1,7 +1,7 @@
<img alt="ReactorKit" src="https://cloud.githubusercontent.com/assets/931655/25277625/6aa05998-26da-11e7-9b85-e48bec938a6e.png" style="max-width: 100%">

<p align="center">
<img alt="Swift" src="https://img.shields.io/badge/Swift-4.2-orange.svg">
<img alt="Swift" src="https://img.shields.io/badge/Swift-5.0-orange.svg">
<a href="https://cocoapods.org/pods/ReactorKit" target="_blank">
<img alt="CocoaPods" src="http://img.shields.io/cocoapods/v/ReactorKit.svg">
</a>
@@ -360,11 +360,11 @@ func testIsLoading() {
## Dependencies
* [RxSwift](https://github.com/ReactiveX/RxSwift) >= 4.0
* [RxSwift](https://github.com/ReactiveX/RxSwift) >= 5.0
## Requirements
* Swift 4
* Swift 5
* iOS 8
* macOS 10.11
* tvOS 9.0
@@ -9,10 +9,11 @@ Pod::Spec.new do |s|
:tag => s.version.to_s }
s.source_files = "Sources/**/*.{swift,h,m}"
s.frameworks = "Foundation"
s.dependency "RxSwift", ">= 4.0.0"
s.swift_version = "5.0"
s.dependency "RxSwift", "~> 5.0"

s.ios.deployment_target = "8.0"
s.osx.deployment_target = "10.11"
s.tvos.deployment_target = "9.0"
s.watchos.deployment_target = "2.0"
s.watchos.deployment_target = "3.0"
end
@@ -12,7 +12,6 @@ import RxSwift

/// A special subject for Reactor's Action. It only emits `.next` event.
public final class ActionSubject<Element>: ObservableType, ObserverType, SubjectType {
public typealias E = Element
typealias Key = UInt

var lock = NSRecursiveLock()
@@ -32,7 +31,7 @@ public final class ActionSubject<Element>: ObservableType, ObserverType, Subject
}
#endif

public func subscribe<O: ObserverType>(_ observer: O) -> Disposable where O.E == Element {
public func subscribe<O: ObserverType>(_ observer: O) -> Disposable where O.Element == Element {
self.lock.lock()
let key = self.nextKey
self.nextKey += 1
@@ -11,8 +11,6 @@ import RxSwift
///
/// Unlike `BehaviorSubject` it can't terminate with error or completed.
public final class StateRelay<Element>: ObservableType {
public typealias E = Element

private let _subject: BehaviorSubject<Element>

/// Accepts `event` and emits it to subscribers
@@ -41,7 +39,7 @@ public final class StateRelay<Element>: ObservableType {
}

/// Subscribes observer
public func subscribe<O: ObserverType>(_ observer: O) -> Disposable where O.E == E {
public func subscribe<O: ObserverType>(_ observer: O) -> Disposable where O.Element == Element {
return _subject.subscribe(observer)
}

@@ -295,7 +295,7 @@ private final class StopwatchReactor: Reactor {
switch action {
case .start:
let stopAction = self.action.filter { $0 == .stop }
return Observable<Int>.interval(1, scheduler: self.scheduler)
return Observable<Int>.interval(.seconds(1), scheduler: self.scheduler)
.map { _ in 1 }
.takeUntil(stopAction)

0 comments on commit c1db412

Please sign in to comment.
You can’t perform that action at this time.