Переглянути джерело

Merge pull request #1353 from onevcat/fix/xcode10-build

Add init method for Xcode compiler
Wei Wang 6 роки тому
батько
коміт
def408f3f3

+ 5 - 0
Sources/General/KingfisherManager.swift

@@ -589,6 +589,11 @@ struct RetrievingContext {
     let originalSource: Source
     var propagationErrors: [PropagationError] = []
 
+    init(options: KingfisherParsedOptionsInfo, originalSource: Source) {
+        self.originalSource = originalSource
+        self.options = options
+    }
+
     mutating func popAlternativeSource() -> Source? {
         guard var alternativeSources = options.alternativeSources, !alternativeSources.isEmpty else {
             return nil

+ 1 - 1
Tests/KingfisherTests/KingfisherManagerTests.swift

@@ -700,7 +700,7 @@ class KingfisherManagerTests: XCTestCase {
         ]
         let info = KingfisherParsedOptionsInfo([.alternativeSources(allSources)])
         var context = RetrievingContext(
-            options: info, originalSource: .network(URL(string: "0")!), propagationErrors: [])
+            options: info, originalSource: .network(URL(string: "0")!))
 
         let source1 = context.popAlternativeSource()
         XCTAssertNotNil(source1)