Skip to content

Commit

Permalink
Merge pull request #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 authored Nov 19, 2019
2 parents 0e8604c + ac88445 commit b3f982c
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 @@ -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
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 b3f982c

Please sign in to comment.