funct7
funct7

Reputation: 3601

iOS framework to wrap existing framework

I'm trying to define a common framework in a project that provides an implementation-agnostic layer. For example, provide a protocol like Analytics and a set of methods/properties as its interface, and provide the implementation through a singleton object so different app targets would use the same implementation.

The issue is when importing the framework from within an app target, a compiler error occurs like so:

import Core // Missing required module 'Firebase'

What needs to be done?

In the Podfile, dependencies are installed only for the framework targets, not the app targets.

Upvotes: 0

Views: 331

Answers (3)

funct7
funct7

Reputation: 3601

It turns out to be a pod installation configuration issue. Changed the installation targets and the hierarchy, and things were solved.

Upvotes: 0

J.Doe
J.Doe

Reputation: 96

iOS framework to wrap existing framework,You have astray when you have this idea, One framework depends on the other. put the depends framework together with it when you use it, not contain or wrap. Cocoapods provides a simple way, create a new warehouse containing the two dependent frameworks, The idea of the first floor is right.

Upvotes: 0

KelaKing
KelaKing

Reputation: 146

Dependencies should set to Core.podspec if you make framework manager by Cocoapods

Pod::Spec.new do |s|
  s.name = 'Core'

  s.dependency 'Firebase'
end

Upvotes: 1

Related Questions