首页 > 解决方案 > How to include CoreMl model into the cocoa pod framework?

问题描述

I'm trying to create a framework which will be reused across couple of the apps we're currently developing and this framework will include two things:

  1. CoreMl model
  2. Some amount of code written around this model which will make the work with the model easier

The obstacle I'm currently struggling with is that I can not figure out how to make sure XCode generates the interface class for this model. The thing is, if I'm trying to build the pod itself, I can clearly see that the interface class is being generated. But, if I switch over to the test project I created in order to use this pod, the framework classes start complaining about the use of the unresolved identifier MyModel.

Is there anything I'm missing in my podspec or something like that? I'm new to iOS development (was working on Android solely), so pardon me if I accidentally omitted some important parts of my description.

标签: iosswiftcocoapodscoremlcoremltools

解决方案


The solution I ended up with was to disable the code generation and add the Model class along with ModelInput and ModelOutput which were generated before into the project. After that the test project seems to work just fine with the pod framework containing the model.


推荐阅读