Skip to content

Commit ec1adef

Browse files
authored
Merge pull request insidegui#526 from insidegui/ah/swift-5
Swift 5
2 parents b97344e + feebe25 commit ec1adef

26 files changed

+80
-88
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
os: osx
2-
osx_image: xcode10
2+
osx_image: xcode10.2
33
before_install:
44
- brew update
55
- brew outdated swiftlint || brew upgrade swiftlint

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ github "SwiftyJSON/SwiftyJSON" ~> 4.0
22

33
github "ReactiveX/RxSwift" ~> 4.0
44

5-
github "realm/realm-cocoa" ~> 3.7.3
5+
github "realm/realm-cocoa" ~> 3.14.0
66
github "RxSwiftCommunity/RxRealm" ~> 0.7
77

88
github "bustoutsolutions/siesta" ~> 1.0

Cartfile.resolved

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
github "ReactiveX/RxSwift" "4.4.0"
2-
github "RxSwiftCommunity/RxRealm" "0.7.6"
1+
github "ReactiveX/RxSwift" "4.4.2"
2+
github "RxSwiftCommunity/RxRealm" "0.7.7"
33
github "SwiftyJSON/SwiftyJSON" "4.2.0"
4-
github "apple/swift-protobuf" "1.2.0"
5-
github "bustoutsolutions/siesta" "1.4.2"
4+
github "apple/swift-protobuf" "1.4.0"
5+
github "bustoutsolutions/siesta" "1.4.3"
66
github "insidegui/ChromeCastCore" "0.2.1"
77
github "insidegui/CloudKitCodable" "0.1.4"
8-
github "realm/realm-cocoa" "v3.11.1"
9-
github "sparkle-project/Sparkle" "1.20.0"
8+
github "realm/realm-cocoa" "v3.14.0"
9+
github "sparkle-project/Sparkle" "1.21.3"

ConfCore/AppleAPIClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,12 @@ extension AppleAPIClient {
191191
fileprivate func process<M>(_ resource: Resource, event: ResourceEvent, with completion: @escaping (Result<M, APIError>) -> Void) {
192192
switch event {
193193
case .error:
194-
completion(.error(resource.error))
194+
completion(.failure(resource.error))
195195
case .newData:
196196
if let results: M = resource.typedContent() {
197197
completion(.success(results))
198198
} else {
199-
completion(.error(.adapter))
199+
completion(.failure(.adapter))
200200
}
201201
default: break
202202
}

ConfCore/ContentsResponse.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ public struct ContentsResponse: Decodable {
1717
public let instances: [SessionInstance]
1818
public let sessions: [Session]
1919

20-
init (events: [Event],
21-
rooms: [Room],
22-
tracks: [Track],
23-
resources: [RelatedResource],
24-
instances: [SessionInstance],
25-
sessions: [Session]) {
20+
init(events: [Event],
21+
rooms: [Room],
22+
tracks: [Track],
23+
resources: [RelatedResource],
24+
instances: [SessionInstance],
25+
sessions: [Session]) {
2626
self.events = events
2727
self.rooms = rooms
2828
self.resources = resources
@@ -45,7 +45,7 @@ public struct ContentsResponse: Decodable {
4545

4646
// remove duplicated sessions
4747
instances.forEach { instance in
48-
guard let index = sessions.index(where: { $0.identifier == instance.session?.identifier }) else { return }
48+
guard let index = sessions.firstIndex(where: { $0.identifier == instance.session?.identifier }) else { return }
4949

5050
sessions.remove(at: index)
5151
}

ConfCore/Download.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Cocoa
1010
import RealmSwift
1111

12-
@available(*, deprecated: 1.0.0, message: "Provided for legacy support only, do not use this!")
12+
@available(*, deprecated, message: "Provided for legacy support only, do not use this!")
1313
enum DownloadStatus: String {
1414
case none
1515
case downloading
@@ -18,7 +18,7 @@ enum DownloadStatus: String {
1818
case completed
1919
}
2020

21-
@available(*, deprecated: 1.0.0, message: "Provided for legacy support only, do not use this!")
21+
@available(*, deprecated, message: "Provided for legacy support only, do not use this!")
2222
public class Download: Object {
2323

2424
/// Unique identifier

ConfCore/Environment.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
import os.log
1111

1212
public extension Notification.Name {
13-
public static let WWDCEnvironmentDidChange = Notification.Name("WWDCEnvironmentDidChange")
13+
static let WWDCEnvironmentDidChange = Notification.Name("WWDCEnvironmentDidChange")
1414
}
1515

1616
public struct Environment: Equatable {

ConfCore/Result.swift

Lines changed: 0 additions & 14 deletions
This file was deleted.

ConfCore/Storage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public final class Storage {
8484
}
8585

8686
func store(contentResult: Result<ContentsResponse, APIError>, completion: @escaping (Error?) -> Void) {
87-
if case let .error(error) = contentResult {
87+
if case let .failure(error) = contentResult {
8888
os_log("Error downloading contents: %{public}@",
8989
log: log,
9090
type: .error,
@@ -251,7 +251,7 @@ public final class Storage {
251251
}
252252

253253
internal func store(featuredSectionsResult: Result<[FeaturedSection], APIError>, completion: @escaping (Error?) -> Void) {
254-
if case let .error(error) = featuredSectionsResult {
254+
if case let .failure(error) = featuredSectionsResult {
255255
os_log("Error downloading featured sections: %{public}@",
256256
log: log,
257257
type: .error,

PlayerUI/Definitions/Speeds.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public enum PUIPlaybackSpeed: Float {
3939
}
4040

4141
public var previous: PUIPlaybackSpeed {
42-
guard let index = PUIPlaybackSpeed.all.index(of: self) else {
42+
guard let index = PUIPlaybackSpeed.all.firstIndex(of: self) else {
4343
fatalError("Tried to get next speed from nonsensical playback speed \(self). Probably missing in collection.")
4444
}
4545

@@ -49,7 +49,7 @@ public enum PUIPlaybackSpeed: Float {
4949
}
5050

5151
public var next: PUIPlaybackSpeed {
52-
guard let index = PUIPlaybackSpeed.all.index(of: self) else {
52+
guard let index = PUIPlaybackSpeed.all.firstIndex(of: self) else {
5353
fatalError("Tried to get next speed from nonsensical playback speed \(self). Probably missing in collection.")
5454
}
5555

0 commit comments

Comments
 (0)