krzyzanowskim / Natalie

Natalie - Storyboard Code Generator (for Swift)
http://blog.krzyzanowskim.com/2015/04/15/natalie-storyboard-code-generator/
MIT License
1.17k stars 74 forks source link

Natalie breaks when using IBAnimatable #91

Closed waltermvp closed 6 years ago

waltermvp commented 7 years ago

I'm not even sure if a fix is possible since it's caused by a third party dependency. But I get build errors when Natalie generates code for a view controller that is subclassed from AnimatableViewController of IBAnimatable

krzyzanowskim commented 7 years ago

what kind of errors? can you make an example project?

cupojoe commented 7 years ago

Here is a blank project with IBAnimatable and Natalie. See if you get the error: IBAnimatableNatalieError.zip

/Users/cupojoe/Code_Repos/NatalieError/IBAnimatableNatalieError/IBAnimatableNatalieError/Storyboards.swift:239:9: Property 'storyboardIdentifier' must be declared public because it matches a requirement in public protocol 'IdentifiableProtocol'

Edit: please, not this is a local build of Natalie based on master, since the inheritance issue (#78) hasn't made it to the build yet it would seem.

krzyzanowskim commented 7 years ago

one more question. do you use master branch, or last release? I should do the release with the latest fixes

cupojoe commented 7 years ago

We are using the release of IBAnimatable (Cocoa Pods) and the master of Natalie, built from source.

phimage commented 7 years ago

the code is

output += "extension IdentifiableProtocol where Self: \(customClass) {\n"
if viewController.customModule != nil {
       output += "    var storyboardIdentifier: String? { return \"\(storyboardIdentifier)\" }\n"
} else {
       output += "    public var storyboardIdentifier: String? { return \"\(storyboardIdentifier)\" }\n"
}

customModule is not nil (because of IBAnimatable module is used)

I do not remember why there is this two case

phimage commented 6 years ago

duplicate of new one with more information #124