appsquickly / typhoon

Powerful dependency injection for Objective-C ✨✨ (https://PILGRIM.PH is the pure Swift successor to Typhoon!!)✨✨
https://pilgrim.ph
Apache License 2.0
2.7k stars 269 forks source link

Swift 3 needs -initWithCoder instead of -initWithNibName:nil bundle:nil #548

Closed santiagoprieto closed 7 years ago

santiagoprieto commented 7 years ago

Hi, I've been trying to update an app to swift 3 and was having issues with the storyboard. I got so frustrated that I asked Apple DTS for help and they signaled this:

One of the third party libraries included in your project - Typhoon - is swizzling all instantiations of UIStoryboard, to return their own TyphoonStoryboard subclass. This subclass is overriding -instantiateViewControllerWithIdentifier: and their overridden implementation is returning a previously created instance of the view controller for the requested identifier that was instantiated by calling -init (which calls -initWithNibName:nil bundle:nil) instead of -initWithCoder:. As a result, this instance is not associated with any storyboard and will not load any of the views defined in the 'New Post View Controller Scene' of NewPost.storyboard.

I wonder if it's something I'm doing wrong or if it's a real issue with Typhoon.

jasperblues commented 7 years ago

Thousands of folks are using this feature so it is likely either a usage error or being used in a unique way. Someone will support you with the specifics shortly.

Meanwhile, did you know that there is a pure Swift version of Typhoon and it is ready for adoption now? You may keep using the objective-c version, but just letting you know. Updating the documentation and starting promotion in the coming days.

Sent from my iPhone

On 9 Feb 2017, at 4:57 AM, Santiago Prieto notifications@github.com wrote:

Hi, I've been trying to update an app to swift 3 and was having issues with the storyboard. I got so frustrated that I asked Apple DTS for help and they signaled this:

One of the third party libraries included in your project - Typhoon - is swizzling all instantiations of UIStoryboard, to return their own TyphoonStoryboard subclass. This subclass is overriding -instantiateViewControllerWithIdentifier: and their overridden implementation is returning a previously created instance of the view controller for the requested identifier that was instantiated by calling -init (which calls -initWithNibName:nil bundle:nil) instead of -initWithCoder:. As a result, this instance is not associated with any storyboard and will not load any of the views defined in the 'New Post View Controller Scene' of NewPost.storyboard.

I wonder if it's something I'm doing wrong or if it's a real issue with Typhoon.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

santiagoprieto commented 7 years ago

Hey Jasper, thanks for the quick reply! I updated to TyphoonSwift and it all works magically. Nice work!