Skip to content

Commit dee2136

Browse files
carlosypuntokzaher
authored andcommitted
make all swift 4 xc9b3 for check
1 parent b5ab21f commit dee2136

29 files changed

+66
-68
lines changed

RxCocoa/Traits/SharedSequence/ObservableConvertibleType+SharedSequence.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension ObservableConvertibleType {
1717
- parameter onErrorJustReturn: Element to return in case of error and after that complete the sequence.
1818
- returns: Driving observable sequence.
1919
*/
20-
public func asSharedSequence<S: SharingStrategyProtocol>(sharingStrategy: S.Type = S.self, onErrorJustReturn: E) -> SharedSequence<S, E> {
20+
public func asSharedSequence<S>(sharingStrategy: S.Type = S.self, onErrorJustReturn: E) -> SharedSequence<S, E> {
2121
let source = self
2222
.asObservable()
2323
.observeOn(S.scheduler)
@@ -31,7 +31,7 @@ extension ObservableConvertibleType {
3131
- parameter onErrorDriveWith: SharedSequence that provides elements of the sequence in case of error.
3232
- returns: Driving observable sequence.
3333
*/
34-
public func asSharedSequence<S: SharingStrategyProtocol>(sharingStrategy: S.Type = S.self, onErrorDriveWith: SharedSequence<S, E>) -> SharedSequence<S, E> {
34+
public func asSharedSequence<S>(sharingStrategy: S.Type = S.self, onErrorDriveWith: SharedSequence<S, E>) -> SharedSequence<S, E> {
3535
let source = self
3636
.asObservable()
3737
.observeOn(S.scheduler)
@@ -47,7 +47,7 @@ extension ObservableConvertibleType {
4747
- parameter onErrorRecover: Calculates driver that continues to drive the sequence in case of error.
4848
- returns: Driving observable sequence.
4949
*/
50-
public func asSharedSequence<S: SharingStrategyProtocol>(sharingStrategy: S.Type = S.self, onErrorRecover: @escaping (_ error: Swift.Error) -> SharedSequence<S, E>) -> SharedSequence<S, E> {
50+
public func asSharedSequence<S>(sharingStrategy: S.Type = S.self, onErrorRecover: @escaping (_ error: Swift.Error) -> SharedSequence<S, E>) -> SharedSequence<S, E> {
5151
let source = self
5252
.asObservable()
5353
.observeOn(S.scheduler)

RxCocoa/Traits/SharedSequence/SharedSequence+Operators.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ extension SharedSequenceConvertibleType {
434434
- parameter resultSelector: Function to invoke for each element from the self combined with the latest element from the second source, if any.
435435
- returns: An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function.
436436
*/
437-
public func withLatestFrom<SecondO: SharedSequenceConvertibleType, ResultType>(_ second: SecondO, resultSelector: @escaping (E, SecondO.E) -> ResultType) -> SharedSequence<SharingStrategy, ResultType> where SecondO.SharingStrategy == SecondO.SharingStrategy {
437+
public func withLatestFrom<SecondO: SharedSequenceConvertibleType, ResultType>(_ second: SecondO, resultSelector: @escaping (E, SecondO.E) -> ResultType) -> SharedSequence<SharingStrategy, ResultType> where SecondO.SharingStrategy == SharingStrategy {
438438
let source = self.asObservable()
439439
.withLatestFrom(second.asSharedSequence(), resultSelector: resultSelector)
440440

RxExample/RxDataSources/DataSources/UI+SectionedViewType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extension UITableView : SectionedViewType {
5151
self.reloadSections(indexSet(sections), with: animationStyle)
5252
}
5353

54-
public func performBatchUpdates<S: SectionModelType>(_ changes: Changeset<S>, animationConfiguration: AnimationConfiguration) {
54+
public func performBatchUpdates<S>(_ changes: Changeset<S>, animationConfiguration: AnimationConfiguration) {
5555
self.beginUpdates()
5656
_performBatchUpdates(self, changes: changes, animationConfiguration: animationConfiguration)
5757
self.endUpdates()

RxExample/RxExample/Examples/GitHubSearchRepositories/GitHubSearchRepositoriesAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ extension GitHubSearchRepositoriesAPI {
105105

106106
for m in matches {
107107
let matches = (1 ..< m.numberOfRanges).map { rangeIndex -> String in
108-
let range = m.rangeAt(rangeIndex)
108+
let range = m.range(at: rangeIndex)
109109
let startIndex = links.characters.index(links.startIndex, offsetBy: range.location)
110110
let endIndex = links.characters.index(links.startIndex, offsetBy: range.location + range.length)
111111
let stringRange = startIndex ..< endIndex

RxExample/RxExample/Services/HtmlParsing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func parseImageURLsfromHTML(_ html: NSString) throws -> [URL] {
2121
return nil
2222
}
2323

24-
let url = html.substring(with: match.rangeAt(1))
24+
let url = html.substring(with: match.range(at: 1))
2525

2626
var absoluteURLString = url
2727
if url.hasPrefix("//") {

RxExample/RxExample/Services/Wireframe.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class DefaultWireframe: Wireframe {
3737
#if swift(>=4.0)
3838
NSWorkspace.shared.open(url)
3939
#else
40-
NSWorkspace.shared().open(url)
40+
NSWorkspace.shared.open(url)
4141
#endif
4242
#endif
4343
}

RxSwift/ObservableType.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
/// Represents a push style sequence.
1010
public protocol ObservableType : ObservableConvertibleType {
11-
/// Type of elements in sequence.
12-
associatedtype E
1311

1412
/**
1513
Subscribes `observer` to receive events for this sequence.

RxSwift/Observables/CombineLatest+Collection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ final fileprivate class CombineLatestCollectionType<C: Collection, R> : Producer
146146
init(sources: C, resultSelector: @escaping ResultSelector) {
147147
_sources = sources
148148
_resultSelector = resultSelector
149-
_count = Int(self._sources.count.toIntMax())
149+
_count = Int(Int64(self._sources.count))
150150
}
151151

152152
override func run<O : ObserverType>(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R {

RxSwift/Observables/Concat.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extension Observable {
5555
*/
5656
public static func concat<S: Collection >(_ collection: S) -> Observable<Element>
5757
where S.Iterator.Element == Observable<Element> {
58-
return Concat(sources: collection, count: collection.count.toIntMax())
58+
return Concat(sources: collection, count: Int64(collection.count))
5959
}
6060

6161
/**
@@ -72,7 +72,7 @@ extension Observable {
7272
- returns: An observable sequence that contains the elements of each given sequence, in sequential order.
7373
*/
7474
public static func concat(_ sources: Observable<Element> ...) -> Observable<Element> {
75-
return Concat(sources: sources, count: sources.count.toIntMax())
75+
return Concat(sources: sources, count: Int64(sources.count))
7676
}
7777
}
7878

RxSwift/Observables/ObserveOn.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ final fileprivate class ObserveOnSink<O: ObserverType> : ObserverBase<O.E> {
102102
}
103103
}
104104

105-
func run(_ state: Void, recurse: (Void) -> Void) {
105+
func run(_ state: (), _ recurse: (()) -> ()) {
106106
let (nextEvent, observer) = self._lock.calculateLocked { () -> (Event<E>?, O) in
107107
if self._queue.count > 0 {
108108
return (self._queue.dequeue(), self._observer)

0 commit comments

Comments
 (0)