Procházet zdrojové kódy

Add init method for Xcode compiler

onevcat před 6 roky
rodič
revize
44c67d439d

+ 5 - 0
Sources/General/KingfisherManager.swift

@@ -582,6 +582,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)