قالب وردپرس درنا توس
Home / IOS Development / IOS – Problem Integration ObjC pod into a Swift framework

IOS – Problem Integration ObjC pod into a Swift framework



I have an iOS App MY-App that uses my own framework MY-Framework . Both are written in swift . The app only handles authentication of the user and sends an access to MY Framework . MY-Framework then handles the entire screen flow and business logic. The goal is to distribute MY-Framework to customers to use it in their apps.

is a minimal sample of the project setup showing this issue available here: https://github.com/vprimachenko / lottie-pod-problem-try

now I was to improve my framework that provided impressions with some animations and would use lottie for it. I use cocoapod version 1

.6.0-pre

Naive attempt

I created a Podfile with the following content

  goals & # 39; fw & # 39;
pod & lottie ios & # 39;
end

which resulted in a compilation error in the frame

  ./ fw / fw / File.swift: 4: 8: error: no such module & # 39; Lottie & # 39;
import Lottie
^

frames

after some googling I changed my Podfile to:

  target & # 39; fw & # 39;
use_frameworks!
pod & lottie ios & # 39;
end

result: Runtime crash

  dld: Library not loaded: @ rpath / Lottie.framework / Lottie
Referred from: ... / Build / Products / Debug-iphoneimulator / fw.framework / fw
Cause: Image not found

modular headlines maybe?

cocoapods release notes mention use_modular_headers! we can try:

  goals & # 39; fw & # 39;
use_modular_headers!
pod & lottie ios & # 39;
end

result: compiler error in the containing app

  ./ app / app / ViewController.swift: 3: 8: error: missing required module & # 39; Lottie & # 39;
import fw
^

maybe both?

  goals & # 39; fw & # 39; makes
use_modular_headers!
use_frameworks!
pod & lottie ios & # 39;
end

result: run time crash

  dld: Library not loaded: @ rpath / Lottie.framework / Lottie
Referred from: ... / Build / Products / Debug-iphoneimulator / fw.framework / fw
Cause: Image not found

hack

after someone tried me, I was able to solve the situation by committing my own bringing header for lottie but this feels more like a channel band rather than a proper solution. I will still post this later as an additional response.

How do I properly use lottie-ios cocoa pod in such a way that it is completely contained in MY-Framework so when I share it with a customer, they can just drop into their App and don't worry about any addictions?

Unfortunately, freeing it as a private pod with addictions is not an option.


Source link