I'm building a Framework, originally named Iris.
When trying to publish it as a Cocoapod I found out that there is an "Iris" framework already.
And while they have completely diferent purposes and authors, I cannot publish it as a pod with this name. So I did the unthinkable!
I tried renaming the whole thing to IrisKit.
My Xcode project, now named IrisKit, has 6 targets:
3 Framework targets
- IrisKit iOS
- IrisKit tvOS
- IrisKit macOS
3 Example Projects
- IrisKit Example iOS
- IrisKit Example tvOS
- IrisKit Example macOS
Unfortunatly, my Example projects won't let me import IrisKit with an error that states:
warning: file 'FeedTableViewController.swift' is part of module 'IrisKit'; ignoring import
What's a developer to do?
Backup your project, or if you're under source control, create a new branch and work from there.
Here are the steps taken:
1. Renamed the Project in the project's "Identity and Type"
2. Renamed Schemes to IrisKit
3. Renamed Folders and Groups to IrisKit
4. Updated the info.plist references under Build-Settings > Packaging
5. Updated the Bundle Identifiers under Build-Settings > Packaging
6. Updated the Public Header to IrisKit.h
7. Updated Example projects import to IrisKit
8. Updated Dependency Management:
- Swift Package Manager
- Cocoapods specs
9. Finally, and good lord this is important:
Targets that are not meant to be built with the framework, must have a different product name than the Framework they use. e.g. An Example Project that showcases the framework
It may sound obvious, but can be easy to miss when mass renaming things
-
The framework with the same name for multiple build targets:
And the Example target. Notice that the name is different from the framework targets.
Took me a while to figure this one out. Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With