Skip to content

Commit 7174155

Browse files
committed
Remove Result package
1 parent 1938b0b commit 7174155

File tree

8 files changed

+30
-35
lines changed

8 files changed

+30
-35
lines changed

Cartfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
github "apple/swift-protobuf" ~> 1.0
22
github "SwiftyJSON/SwiftyJSON" ~> 4.0
3-
github "antitypical/Result" ~> 3.2

OpenCastSwift.xcodeproj/project.pbxproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
027E35BE200E8A1400A863E6 /* HeartbeatChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 027E35B7200E8A1400A863E6 /* HeartbeatChannel.swift */; };
5959
027E35BF200E8A1400A863E6 /* HeartbeatChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 027E35B7200E8A1400A863E6 /* HeartbeatChannel.swift */; };
6060
027E35C0200E8A1400A863E6 /* HeartbeatChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 027E35B7200E8A1400A863E6 /* HeartbeatChannel.swift */; };
61-
027E35C2200E8AEA00A863E6 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 027E35C1200E8AEA00A863E6 /* Result.framework */; };
6261
027E35C5200E933800A863E6 /* CastMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 027E35C4200E933800A863E6 /* CastMessage.swift */; };
6362
027E35C6200E933800A863E6 /* CastMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 027E35C4200E933800A863E6 /* CastMessage.swift */; };
6463
027E35C7200E933800A863E6 /* CastMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 027E35C4200E933800A863E6 /* CastMessage.swift */; };
@@ -157,7 +156,6 @@
157156
isa = PBXFrameworksBuildPhase;
158157
buildActionMask = 2147483647;
159158
files = (
160-
027E35C2200E8AEA00A863E6 /* Result.framework in Frameworks */,
161159
0289007D200551B90024D80F /* SwiftyJSON.framework in Frameworks */,
162160
0289007920054B870024D80F /* SwiftProtobuf.framework in Frameworks */,
163161
);
@@ -421,7 +419,7 @@
421419
};
422420
DD674A371DB7E83400E1FC24 = {
423421
CreatedOnToolsVersion = 8.0;
424-
DevelopmentTeam = 7XLNECBC46;
422+
DevelopmentTeam = 83S62JHMRL;
425423
LastSwiftMigration = 0920;
426424
ProvisioningStyle = Automatic;
427425
};
@@ -432,6 +430,7 @@
432430
developmentRegion = English;
433431
hasScannedForEncodings = 0;
434432
knownRegions = (
433+
English,
435434
en,
436435
Base,
437436
);
@@ -820,6 +819,7 @@
820819
CODE_SIGN_IDENTITY = "";
821820
COMBINE_HIDPI_IMAGES = YES;
822821
DEFINES_MODULE = YES;
822+
DEVELOPMENT_TEAM = 83S62JHMRL;
823823
DYLIB_COMPATIBILITY_VERSION = 1;
824824
DYLIB_CURRENT_VERSION = 1;
825825
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -849,6 +849,7 @@
849849
CODE_SIGN_IDENTITY = "";
850850
COMBINE_HIDPI_IMAGES = YES;
851851
DEFINES_MODULE = YES;
852+
DEVELOPMENT_TEAM = 83S62JHMRL;
852853
DYLIB_COMPATIBILITY_VERSION = 1;
853854
DYLIB_CURRENT_VERSION = 1;
854855
DYLIB_INSTALL_NAME_BASE = "@rpath";

Sample Apps.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@
439439
buildSettings = {
440440
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
441441
CODE_SIGN_STYLE = Automatic;
442-
DEVELOPMENT_TEAM = 7XLNECBC46;
442+
DEVELOPMENT_TEAM = 83S62JHMRL;
443443
INFOPLIST_FILE = "Sample iOS App/Info.plist";
444444
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
445445
PRODUCT_BUNDLE_IDENTIFIER = "com.hollingsware.Sample-iOS-App";
@@ -454,7 +454,7 @@
454454
buildSettings = {
455455
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
456456
CODE_SIGN_STYLE = Automatic;
457-
DEVELOPMENT_TEAM = 7XLNECBC46;
457+
DEVELOPMENT_TEAM = 83S62JHMRL;
458458
INFOPLIST_FILE = "Sample iOS App/Info.plist";
459459
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
460460
PRODUCT_BUNDLE_IDENTIFIER = "com.hollingsware.Sample-iOS-App";
@@ -473,7 +473,7 @@
473473
CODE_SIGN_IDENTITY = "Mac Developer";
474474
CODE_SIGN_STYLE = Automatic;
475475
COMBINE_HIDPI_IMAGES = YES;
476-
DEVELOPMENT_TEAM = 7XLNECBC46;
476+
DEVELOPMENT_TEAM = 83S62JHMRL;
477477
FRAMEWORK_SEARCH_PATHS = (
478478
"$(inherited)",
479479
"$(PROJECT_DIR)/Carthage/Build/Mac",
@@ -498,7 +498,7 @@
498498
CODE_SIGN_IDENTITY = "Mac Developer";
499499
CODE_SIGN_STYLE = Automatic;
500500
COMBINE_HIDPI_IMAGES = YES;
501-
DEVELOPMENT_TEAM = 7XLNECBC46;
501+
DEVELOPMENT_TEAM = 83S62JHMRL;
502502
FRAMEWORK_SEARCH_PATHS = (
503503
"$(inherited)",
504504
"$(PROJECT_DIR)/Carthage/Build/Mac",

Source/Networking/CastClient.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import Foundation
1010
import SwiftProtobuf
1111
import SwiftyJSON
12-
import Result
1312

1413
public enum CastPayload {
1514
case json([String: Any])
@@ -269,7 +268,7 @@ public final class CastClient: NSObject, RequestDispatchable {
269268
sourceId: message.sourceID)
270269

271270
if let requestId = json[CastJSONPayloadKeys.requestId].int {
272-
callResponseHandler(for: requestId, with: Result(value: json))
271+
callResponseHandler(for: requestId, with: .success(json))
273272
}
274273
} else {
275274
NSLog("Unable to get UTF8 JSON data from message")
@@ -371,7 +370,7 @@ public final class CastClient: NSObject, RequestDispatchable {
371370

372371
try write(data: messageData)
373372
} catch {
374-
callResponseHandler(for: request.id, with: Result(error: .request(error.localizedDescription)))
373+
callResponseHandler(for: request.id, with: .failure(.request(error.localizedDescription)))
375374
}
376375
}
377376

@@ -394,29 +393,29 @@ public final class CastClient: NSObject, RequestDispatchable {
394393
public func join(app: CastApp? = nil, completion: @escaping (Result<CastApp, CastError>) -> Void) {
395394
guard outputStream != nil,
396395
let target = app ?? currentStatus?.apps.first else {
397-
completion(Result(error: CastError.session("No Apps Running")))
396+
completion(.failure(CastError.session("No Apps Running")))
398397
return
399398
}
400399

401400
if target == connectedApp {
402-
completion(Result(value: target))
401+
completion(.success(target))
403402
} else if let existing = currentStatus?.apps.first(where: { $0.id == target.id }) {
404403
connect(to: existing)
405-
completion(Result(value: existing))
404+
completion(.success(existing))
406405
} else {
407406
receiverControlChannel.requestStatus { [weak self] result in
408407
switch result {
409408
case .success(let status):
410409
guard let app = status.apps.first else {
411-
completion(Result(error: CastError.launch("Unable to get launched app instance")))
410+
completion(.failure(CastError.launch("Unable to get launched app instance")))
412411
return
413412
}
414413

415414
self?.connect(to: app)
416-
completion(Result(value: app))
415+
completion(.success(app))
417416

418417
case .failure(let error):
419-
completion(Result(error: error))
418+
completion(.failure(error))
420419
}
421420
}
422421
}

Source/Networking/Channels/MediaControlChannel.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//
88

99
import Foundation
10-
import Result
1110
import SwiftyJSON
1211

1312
class MediaControlChannel: CastChannel {
@@ -53,10 +52,10 @@ class MediaControlChannel: CastChannel {
5352
send(request) { result in
5453
switch result {
5554
case .success(let json):
56-
completion(Result(value: CastMediaStatus(json: json)))
55+
completion(.success(CastMediaStatus(json: json)))
5756

5857
case .failure(let error):
59-
completion(Result(error: error))
58+
completion(.failure(error))
6059
}
6160
}
6261
} else {
@@ -118,10 +117,10 @@ class MediaControlChannel: CastChannel {
118117
case .success(let json):
119118
guard let status = json["status"].array?.first else { return }
120119

121-
completion(Result(value: CastMediaStatus(json: status)))
120+
completion(.success(CastMediaStatus(json: status)))
122121

123122
case .failure(let error):
124-
completion(Result(error: CastError.load(error.localizedDescription)))
123+
completion(.failure(CastError.load(error.localizedDescription)))
125124
}
126125
}
127126
}

Source/Networking/Channels/MultizoneControlChannel.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//
88

99
import Foundation
10-
import Result
1110
import SwiftyJSON
1211

1312
class MultizoneControlChannel: CastChannel {
@@ -67,10 +66,10 @@ class MultizoneControlChannel: CastChannel {
6766
send(request) { result in
6867
switch result {
6968
case .success(let json):
70-
completion(Result(value: CastStatus(json: json)))
69+
completion(.succes(CastStatus(json: json)))
7170

7271
case .failure(let error):
73-
completion(Result(error: error))
72+
completion(.failure(error))
7473
}
7574
}
7675
} else {

Source/Networking/Channels/ReceiverControlChannel.swift

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//
88

99
import Foundation
10-
import Result
1110
import SwiftyJSON
1211

1312
class ReceiverControlChannel: CastChannel {
@@ -58,9 +57,9 @@ class ReceiverControlChannel: CastChannel {
5857
send(request) { result in
5958
switch result {
6059
case .success(let json):
61-
completion(Result(value: AppAvailability(json: json)))
60+
completion(.success(AppAvailability(json: json)))
6261
case .failure(let error):
63-
completion(Result(error: CastError.launch(error.localizedDescription)))
62+
completion(.failure(CastError.launch(error.localizedDescription)))
6463
}
6564
}
6665
}
@@ -74,10 +73,10 @@ class ReceiverControlChannel: CastChannel {
7473
send(request) { result in
7574
switch result {
7675
case .success(let json):
77-
completion(Result(value: CastStatus(json: json)))
76+
completion(Result.success(CastStatus(json: json)))
7877

7978
case .failure(let error):
80-
completion(Result(error: error))
79+
completion(Result.failure(error))
8180
}
8281
}
8382
} else {
@@ -99,14 +98,14 @@ class ReceiverControlChannel: CastChannel {
9998
switch result {
10099
case .success(let json):
101100
guard let app = CastStatus(json: json).apps.first else {
102-
completion(Result(error: CastError.launch("Unable to get launched app instance")))
101+
completion(.failure(CastError.launch("Unable to get launched app instance")))
103102
return
104103
}
105104

106-
completion(Result(value: app))
105+
completion(.success(app))
107106

108107
case .failure(let error):
109-
completion(Result(error: error))
108+
completion(.failure(error))
110109
}
111110

112111
}

Source/Networking/Channels/YoutubeChannel.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//
88

99
import Foundation
10-
import Result
1110
import SwiftyJSON
1211

1312
enum YoutubeAction: String {
@@ -378,7 +377,7 @@ public class YoutubeChannel: CastChannel {
378377
// self.screenID = screenID
379378
// completion(Result(success: screenID))
380379
case .failure(let error):
381-
completion(Result(error: CastError.load(error.localizedDescription)))
380+
completion(.failure(CastError.load(error.localizedDescription)))
382381
}
383382
}
384383
}

0 commit comments

Comments
 (0)