Skip to content

Commit 6f5e6e9

Browse files
author
Ruben Nine
committed
Declaring BaseOperation open and Error public.
1 parent b7248da commit 6f5e6e9

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

FilestackSDK.xcodeproj/project.pbxproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@
383383
4502F71E1F1F4C28000875D6 /* Operations */ = {
384384
isa = PBXGroup;
385385
children = (
386-
4502F7321F1F4D20000875D6 /* BaseOperation.swift */,
387386
4528C7451F2F24FB00A4BEF6 /* CommitPartUploadOperation.swift */,
388387
456FF4C01F27799D00E9F192 /* CompleteUploadOperation.swift */,
389388
4502F7301F1F4C3A000875D6 /* StartUploadOperation.swift */,
@@ -477,6 +476,7 @@
477476
457D5BDA1F16144B00FBD5B1 /* Enums */ = {
478477
isa = PBXGroup;
479478
children = (
479+
451BB71524AE9D080005A8A5 /* Error.swift */,
480480
45C3EA0E1F262ED30003598D /* MetadataOptions.swift */,
481481
457D5BF21F1614D400FBD5B1 /* PolicyCall.swift */,
482482
45C8F2071F18B3AF001A6558 /* StorageAccess.swift */,
@@ -508,12 +508,19 @@
508508
path = Uploaders;
509509
sourceTree = "<group>";
510510
};
511+
45A6102A24B5B01200225738 /* Operations */ = {
512+
isa = PBXGroup;
513+
children = (
514+
4502F7321F1F4D20000875D6 /* BaseOperation.swift */,
515+
);
516+
path = Operations;
517+
sourceTree = "<group>";
518+
};
511519
45B63AFE23279C790040BFBB /* Internal */ = {
512520
isa = PBXGroup;
513521
children = (
514522
45DC974524ACECDE0014ECE3 /* Config.swift */,
515523
4589A4871F0A4B1900C39405 /* Constants.swift */,
516-
451BB71524AE9D080005A8A5 /* Error.swift */,
517524
45DC974124ACC0840014ECE3 /* Loggers.swift */,
518525
45DC974324ACE38D0014ECE3 /* TaskRetrier.swift */,
519526
45B66480232838C200DF5706 /* Tools.swift */,
@@ -535,6 +542,7 @@
535542
45B63B122327D2640040BFBB /* Extensions */,
536543
45B830DE1F03BCF20053742A /* Models */,
537544
45B63B172327D6CC0040BFBB /* Objective-C */,
545+
45A6102A24B5B01200225738 /* Operations */,
538546
45B63B0223279E5D0040BFBB /* Protocols */,
539547
452055431F4B192000A6795D /* Transforms */,
540548
);
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88

99
import Foundation
1010

11-
enum Error: Swift.Error {
11+
/// :nodoc:
12+
public enum Error: Swift.Error {
1213
case cancelled
1314
case unknown
1415
case api(_ description: String)
1516
case custom(_ description: String)
1617
case wrapped(_ error: Swift.Error)
1718
}
1819

20+
/// :nodoc:
1921
extension Error: LocalizedError {
2022
public var errorDescription: String? {
2123
switch self {

FilestackSDK/Internal/Operations/BaseOperation.swift renamed to FilestackSDK/Public/Operations/BaseOperation.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import Foundation
1818
/// - An executing operation will return `isExecuting` true.
1919
/// - A finished operation will return `isFinished` true.
2020
/// - A cancelled operation will return `isCancelled` true.
21-
class BaseOperation<Success>: Operation {
22-
typealias Result = Swift.Result<Success, Error>
21+
open class BaseOperation<Success>: Operation {
22+
public typealias Result = Swift.Result<Success, Error>
2323

2424
// MARK: - Private Properties
2525

@@ -47,27 +47,27 @@ class BaseOperation<Success>: Operation {
4747

4848
// MARK: - Property Overrides
4949

50-
override var isReady: Bool { _state.contains(.ready) }
51-
override var isExecuting: Bool { _state == .executing }
52-
override var isFinished: Bool { _state == .finished }
50+
open override var isReady: Bool { _state.contains(.ready) }
51+
open override var isExecuting: Bool { _state == .executing }
52+
open override var isFinished: Bool { _state == .finished }
5353

5454
// MARK: - Function Overrides
5555

56-
override func start() {
56+
open override func start() {
5757
state = .executing
5858

5959
if !isCancelled { main() }
6060
}
6161

62-
override func cancel() {
62+
open override func cancel() {
6363
super.cancel()
6464

6565
finish(with: .failure(.cancelled))
6666
}
6767

68-
// MARK: - Internal Functions
68+
// MARK: - Open Functions
6969

70-
func finish(with result: Result) {
70+
open func finish(with result: Result) {
7171
self.result = result
7272

7373
if state == .ready {

0 commit comments

Comments
 (0)