Skip to content

Commit

Permalink
Add init method for Xcode compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Nov 19, 2019
1 parent 9ceea64 commit 44c67d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Sources/General/KingfisherManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Tests/KingfisherTests/KingfisherManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 44c67d4

Please sign in to comment.