I created Static Framework and added it to an iOS app. In Framework I created new public protocol:
public protocol ProtocolName
{
func methodName1(arg1: Int)
}
I rebuilt framework, but I can't use this protocol in my app.
import FrameworkName
class ClassName: ProtocolName
{
func methodName1(arg1: Int)
}
(Error in class definition: Use of undeclared type 'ProtocolName')
The app sees other protocols, other classes and views. It also sees changes in my framework (I added some test print and rebuild framework to check if the app uses the newly built version and it works).
File with the protocol is in Target Membership for the framework. I tried to remove the whole framework and link it again, close and reopen XCode, clean both project few times, but nothing works.
I tried also to add next protocol - also isn't recognized in the app (but other, older protocols are).
I checked framework definition in the app (right click on a module and Jump to Definition) - there are no mentions of the new protocol.
I guess something is wrong with the generation of the framework metadata (classes and method definitions), but I can't find a way to fix it.
Any help or ideas would be appreciated.
OK, I think I can leave this question for someone with the same problem (maybe will save 3-4 hours).
The solution was quite simple: remove Derived Data for project and framework (maybe removing derived data for an app will be enough, but I removed both so I can't tell).
How to do it in XCode: https://stackoverflow.com/a/39495772/5226328
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With