Swinject / SwinjectStoryboard

Swinject extension for automatic dependency injection via Storyboard
MIT License
268 stars 142 forks source link

Cannot convert value of type 'Container.Controller' (aka 'UIViewController') to closure result type 'Any' #89

Closed phatfly closed 6 years ago

phatfly commented 6 years ago

Hello, I am just starting a new project today and have been having an issue with this error:

Cannot convert value of type 'Container.Controller' (aka 'UIViewController') to closure result type 'Any'

It's at line 108 in SwinjectStoryboard.swift.

Is this a known issue?

Thanks.

Xcode 9.2 Swift 4 pod 'SwinjectStoryboard', '1.1.2'

zarochintsev commented 6 years ago

Hi, yes, i have the same problem when Swinject v2.3.0 and SwinjectStoryboard v1.1.2, but when i use Swinject v2.2.0everything is fine.

phatfly commented 6 years ago

Golden! That combination worked. Thank you for the quick response!

pastmos commented 6 years ago

Yes, it works! The problem has just appeared after pod update, with SwinjectStoryboard 2.3.0. If you change for 2.2.0 it's all goes fine. Thanks a lot! Saved my day

jakubvano commented 6 years ago

Thanks for pointing this out! 👍 Indeed, 1.1.2 is not compatible with Swinject 2.3.0. 1.2.0 fixes the issue, and has already been released.

Resolved by #88.

ihorodnikoff commented 6 years ago

Still not works in Swinject 2.3.0. SwinjectStoryboard 1.2.0

zarochintsev commented 6 years ago

@jakubvano Oops, the problem has remained, I used Swinject v2.3.0 and SwinjectStoryboard v1.2.0, installed from cocoa pods.

jakubvano commented 6 years ago

I see, the issue remained due to the Swift3 / Swift4 differences: 1.2.x is intended to be fully compatible with Swift3 and unfortunately this branch is not setup to be tested with Swift4 compilation.

Should be resolved by #91

zarochintsev commented 6 years ago

@jakubvano Good job! Thanks you!

jakubvano commented 6 years ago

1.2.1 has been released, as well as 2.0.0-beta.1 which includes Swift4 compatibility for OSX