Adding pods to nested targets in iOS Xcode

I had this weird structure in one of my project.

SO, I wanted to add a framework to the InnerTarget via pods.

The InnerTarget is a framework target inside TalkTab project which is added as a subproject to the MainTarget workspace.

I tried different ways. Like the given podfile below.

This might work . But for the custom pods framework that I had to add, it was throwing some error.

This is what I ended up doing.

# Uncomment the next line to define a global platform for your project
# platform :ios, ‘9.0’
workspace ‘MainTarget’target ‘MainTarget’ do
# Comment the next line if you don’t want to use dynamic frameworks
use_frameworks!
target 'Ucc' do
project 'TalkTab/TalkTab.xcodeproj'
target 'InnerTarget' do
inherit! :search_paths
end
end
end

In the below line, we need to follow the folderName/Projectname.xcodeproj format.

project 'TalkTab/TalkTab.xcodeproj'

You can know more about configuring the podfile from the cocoapods official documentation here:

  1. https://guides.cocoapods.org/using/the-podfile.html
  2. https://guides.cocoapods.org/syntax/podfile.html#podfile

Hope it might help someone. thanks for reading.

That’s it.

Enjoy!!

If you enjoyed reading this post, please share and give some claps so others can find it 👏👏👏👏👏 !!!!

You can follow me on Medium for fresh articles. Also, connect with me on LinkedIn.

If you have any comment, question, or recommendation, feel free to post them in the comment section below!

--

--

--

iOS and tvOS developer, dreamer, photographer 🤨

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Creating Custom Controls in SwiftUI

Short Explanation On How To Use Protocols in Swift Xcode

How to use protocols in Swift Xcode

SwiftUI Series (Part 1)

UICollection Compositional Layout Part 4 DataSource

Create a Command-Line Tool Using Swift Package Manager

A command-line tool written in Swift

SwiftUI Tutorial on Reactive Design

FragmentPagerAdapter vs FragmentStatePagerAdapter

Advanced Argument Parsing for a Swift-Based CLI Application

Laptop keyboard

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhimuralidharan

Abhimuralidharan

iOS and tvOS developer, dreamer, photographer 🤨

More from Medium

Spying vs. Stubbing

How to compare strings based on the number of vowels it has in Swift?

Ephemeral CI for iOS with GitHub Actions and Orka Just Got Better

How to convert .ogg/.oga audio into .wav in Swift using C++, Objective-C and Swift Package Manager