Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KingfisherManager.swift: Use of local variable 'handleNoCache' before its declaration #700

Closed
arismamo opened this issue Jun 3, 2017 · 6 comments

Comments

@arismamo
Copy link

arismamo commented Jun 3, 2017

Hi every body,
at first i want to thank the creator for this library.

My problem is

I have used kingfisher in one of my iOS projects which i'm trying to update the swift version from 2.x -> 3.x. All other libraries are complied except Kingfisher which throws the exception "Use of local variable 'handleNoCache' before its declaration" in file KingfisherManager.swift

My Pod file is:

platform :ios, '8.0'
use_frameworks!
inhibit_all_warnings!
target 'app_name' do
	pod 'SCLAlertView'
	pod 'ActionSheetPicker-3.0'
	pod 'SVProgressHUD', '~> 2.1.2'
        pod 'RealmSwift'
	pod 'Alamofire', '~> 4.4'
	pod 'AlamofireObjectMapper', '~> 4.0'
	pod 'SugarRecord/CoreData'
    pod 'UIBarButtonItem-Badge', :git => 'https://github.com/mikeMTOL/UIBarButtonItem-Badge'
	pod 'Firebase', '~> 3.2.0'
	pod 'Firebase/Messaging'
    pod 'Kingfisher', '~> 3.0'
end

Can someone that had faced this problem, help me solve it?

Thank you in advance

@onevcat
Copy link
Owner

onevcat commented Jun 3, 2017

May I know what the Swift / Xcode version you are using?

@arkth-araya
Copy link

arkth-araya commented Jun 4, 2017

hey,
i'm facing the same problem too. i use carthage.

the error message is
'Kingfisher/Sources/KingfisherManager.swift:224:25: error: use of local variable 'handleNoCache' before its declaration
handleNoCache()'

so, you should move handleNoCache function to above line 212.

Maybe i will create pull-request later.

@arismamo
Copy link
Author

arismamo commented Jun 4, 2017

@onevcat I am using swift 3.0.2 and xcode 8.2.1

@arismamo
Copy link
Author

arismamo commented Jun 4, 2017

@arkth-araya i can confirm that moving the function above the line, every works is fine. i think its due to the last version of swift. Thanks

arkth-araya pushed a commit to arkth-araya/Kingfisher that referenced this issue Jun 4, 2017
@onevcat
Copy link
Owner

onevcat commented Jun 4, 2017

Seem it is a non-back-compatible change in Swift 3.1. I'll merge it and tag a new version now.

@onevcat onevcat closed this as completed Jun 4, 2017
onevcat added a commit that referenced this issue Jun 4, 2017
 #700 Fix 'handleNoCache' before its declaration
@onevcat
Copy link
Owner

onevcat commented Jun 4, 2017

Fixed in 3.10.1

petarlazarov pushed a commit to dowjones-mobile/Kingfisher that referenced this issue Oct 6, 2021
petarlazarov pushed a commit to dowjones-mobile/Kingfisher that referenced this issue Oct 6, 2021
 onevcat#700 Fix 'handleNoCache' before its declaration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants