Skip to content

Commit

Permalink
Merge pull request onevcat#1353 from onevcat/fix/xcode10-build
Browse files Browse the repository at this point in the history
Add init method for Xcode compiler
  • Loading branch information
onevcat committed Nov 19, 2019
2 parents 1bcb180 + 44c67d4 commit def408f
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
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Tests/KingfisherTests/KingfisherManagerTests.swift
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 def408f

Please sign in to comment.