14wml
14wml

Reputation: 4166

When trying to use cocoapods with swift getting error: bridging header does not exist?

I'm trying to use this ExpandingTableView pod. When I tried to use it in my project Expense, it didn't work, so I looked at this Stackoverflow post and followed the linked tutorial. Except now I'm getting an error:

error: bridging header '/Users/Monica/Documents/CS 4999/Project/Expense/Expense/Expense-Bridging-Header.h' does not exist

As part of the tutorial, you are suppose to go into your project's Build Settings and edit the key Objective-C Bridging Header to project_name/project_name-Bridging-Header.h (in my case: Expense/Expense-Bridging-Header.h). And that's what I did as you can see.

In attempt to fix this error, I edited the key Objective-C Bridging Header from Expense/Expense-Bridging-Header.h to Expense/Header.h, Expense-Bridging-Header.h, Bridging.h, ./Expense/Bridging.h, or ./Expense/Expense-Bridging-Header.h. Nothing solved the error.

If anyone could tell me why this is happening & how to fix this—it would be greatly appreciated!


This is how the files in my project Expense are arranged in Xcode.

These are the files of ExpandingTableView pod in Xcode.

This is where Bridging.h is located on my computer.

My podfile:

# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'Expense' do
pod 'ExpandingTableView'
end

target 'ExpenseTests' do

end

target 'ExpenseUITests' do

end

Upvotes: 0

Views: 355

Answers (1)

pbush25
pbush25

Reputation: 5258

If you're using frameworks, then you no longer need a bridging header. Instead, you will import the framework directly in the swift file in which you will be using it like so:

import ExpandingTableView

class MyTableView: UITableViewController{}

Upvotes: 2

Related Questions