Я создал модуль Objective-C с двумя файлами:
Source/SomeViewController.h
Source/SomeViewController.m
Я также создал связующий заголовок в модуле:
Source/Bridging-Header.h
с содержанием:
#import "SomeViewController.h"
Мой podspec выглядит так:
Pod::Spec.new do |s|
s.name = 'TestLib'
s.version = '0.0.1'
s.license = 'MIT'
s.ios.deployment_target = '7.0'
s.source_files = 'Source/*.{h,m}'
s.requires_arc = true
s.xcconfig = { 'SWIFT_OBJC_BRIDGING_HEADER' => 'Source/Bridging-Header.h' }
end
Я создал демонстрационный проект, сделал pod init
и вставил свой модуль. Затем после pod install
я получаю следующий вывод:
Установка TestLib 0.0.1 (была 0.0.1) Генерация проекта Pods Интеграция клиентского проекта
[!] The `TestLibProject [Debug]` target overrides the `SWIFT_OBJC_BRIDGING_HEADER` build setting defined in `Pods/Target Support Files/Pods-TestLibProject/Pods-TestLibProject.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `TestLibProject [Release]` target overrides the `SWIFT_OBJC_BRIDGING_HEADER` build setting defined in `Pods/Target Support Files/Pods-TestLibProject/Pods-TestLibProject.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
Когда я открываю свой файл TestLibProject.xcworkspace
, я вижу, что модуль был установлен правильно, но соединительный заголовок из модуля не установлен правильно. В моем проекте Swift я пытался сделать:
let vc: SomeViewController
Это дает ошибку, потому что заголовок моста из пода не установлен.
Как мне настроить podspec
, чтобы правильно установить соединительный заголовок модуля?