diff --git a/DropDown/resources/DropDownCell.xib b/DropDown/resources/DropDownCell.xib index 75ac9a4..ec78e80 100644 --- a/DropDown/resources/DropDownCell.xib +++ b/DropDown/resources/DropDownCell.xib @@ -1,24 +1,26 @@ - - + + + - + + - + - + @@ -30,6 +32,7 @@ + diff --git a/DropDown/src/DropDown.swift b/DropDown/src/DropDown.swift index e7f7c94..f41e8dd 100644 --- a/DropDown/src/DropDown.swift +++ b/DropDown/src/DropDown.swift @@ -357,13 +357,22 @@ public final class DropDown: UIView { Changing the cell nib automatically reloads the drop down. */ - public var cellNib = UINib(nibName: "DropDownCell", bundle: Bundle(for: DropDownCell.self)) { + public var cellNib = UINib(nibName: "DropDownCell", bundle: bundle) { didSet { tableView.register(cellNib, forCellReuseIdentifier: DPDConstant.ReusableIdentifier.DropDownCell) templateCell = nil reloadAllComponents() } } + + /// Correctly specify Bundle for Swift Packages + fileprivate static var bundle: Bundle { + #if SWIFT_PACKAGE + return Bundle.module + #else + return Bundle(for: DropDownCell.self) + #endif + } //MARK: Content diff --git a/Package.swift b/Package.swift index e8586b4..38fcacb 100644 --- a/Package.swift +++ b/Package.swift @@ -1,20 +1,27 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.3 import PackageDescription let package = Package( name: "DropDown", platforms: [ - .iOS(.v8) + .iOS(.v9) ], products: [ .library( name: "DropDown", - targets: ["DropDown"]) + targets: ["DropDown"] + ) ], targets: [ .target( name: "DropDown", - path: "DropDown" + dependencies: [], + path: "DropDown", + exclude: ["Info.plist", "DropDown.h"], + resources: [ + .process("DropDown/resources") + ] ) - ] + ], + swiftLanguageVersions: [.v5] )