Skip to content

Commit

Permalink
Fix SPM support and request to tag 1.8.3: fix for #63
Browse files Browse the repository at this point in the history
  • Loading branch information
4taras4 authored Aug 10, 2022
2 parents 01134ab + 2e05eb4 commit 5397b89
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
7 changes: 6 additions & 1 deletion CountryPicker/Classes/CountryPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ public struct Country {
}

public var flag: UIImage? {
return UIImage(named: flagName, in: Bundle(for: CountryPicker.self), compatibleWith: nil)
#if SWIFT_PACKAGE
let bundle = Bundle.module
#else
let bundle = Bundle(for: CountryPicker.self)
#endif
return UIImage(named: flagName, in: bundle, compatibleWith: nil)
}
}

Expand Down
4 changes: 4 additions & 0 deletions CountryPicker/Classes/CountryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ class NibLoadingView: UIView {
///
/// - Returns: XIBView
fileprivate func loadViewFromNib() -> UIView {
#if SWIFT_PACKAGE
let bundle = Bundle.module
#else
let bundle = Bundle(for: type(of: self))
#endif
let nib = UINib(nibName: String(describing: type(of: self)), bundle: bundle)
let nibView = nib.instantiate(withOwner: self, options: nil).first as! UIView

Expand Down
2 changes: 1 addition & 1 deletion CountryPickerSwift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'CountryPickerSwift'
s.version = '1.8.2'
s.version = '1.8.3'
s.summary = 'Swift CountryPicker'

# This description is used to generate tags and improve search results.
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- CountryPickerSwift (1.8.2)
- CountryPickerSwift (1.8.3)

DEPENDENCIES:
- CountryPickerSwift (from `../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
CountryPickerSwift: f969cd261fc03978c0a556c4863b1047188bb4ca
CountryPickerSwift: 70dcf23b7f28895eb97d7e461a661524126b349a

PODFILE CHECKSUM: 24f5b92c2a79e38c578da696a7b6140d7772a81d

Expand Down
4 changes: 2 additions & 2 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let package = Package(
dependencies: [],
path: "CountryPicker",
resources: [
.copy("Assets")]
.copy("Assets/CountryPicker.bundle")]
),
.testTarget(
name: "CountryCodeTests",
Expand Down

0 comments on commit 5397b89

Please sign in to comment.