Add a xib file to a Swift Package
Currently Swift packages only support source code so you can't add a xib file to the package. Read the What's Missing? section in the following article:
Creating Swift Packages in Xcode
UPDATE
Xcode 12 allows you to add files that are not source code files to Swift packages. I have not created a Swift package so I cannot provide detailed instructions on how to add a xib file to a Swift package. But as @ffritz mentioned in a comment to this answer, Apple's documentation has an article on bundling resources in Swift packages.
Bundling Resources with a Swift Package
Package XIB in Swift framework for distribution?
You can load your .xib file from your framework like this :
UINib(nibName: "MyXib", bundle: NSBundle(identifier: "bundleName")
or if you know the name of a class in the framework
UINib(nibName: "MyXib", bundle: NSBundle(forClass: MyClass.self)
Framework iOS-XIB can't load NIB in package
I found a solution to this problem,
push the xib file to the resource folder
spec.resources = "MobileAds/**/*.{png,jpeg,jpg,storyboard,xib,xcassets}"
Related Topics
Type of Expression Is Ambiguous Without More Context in Xcode 11
File Couldn't Be Opened Because You Don't Have Permission to View It Error
How to Sum the Numbers(Int16) of Stored Core Data - Swift 3
How to Capture Multiple Arguments Weakly in a Swift Closure
Nsbutton Background Transparent After Getting Focus
Manually Disposing a Disposebag in Rxswift
Swiftui Navigation: How to Switch Detail View to a Different Item
Integer Literal Overflows When Stored into 'Int'
Read and Write CSV Files in Swift 3
Convert String to Staticstring
Swift: Incrementing Label with Delay
Hmac Sha512 Using Commoncrypto in Swift 3.1
Swiftui: @Observedobject Redraws Every View
How to Remove Node from Parent If Touched More Than Once
Swift - How to Resize a Uiview Based on Its Uilabel Size (That Is Inside)