-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #428 from BookerSoftwareInc/SPM-compatibility
Fix Swift PM compatibility by creating a separate ObjC target
- Loading branch information
Showing
9 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// UIImage+BundledImage.swift | ||
// | ||
// | ||
// Created by Aleksandr Solovev on 09.06.2022. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIImage { | ||
static func bundledImage(named imageName: String) -> UIImage { | ||
let imagePath = "SKPhotoBrowser.bundle/images/\(imageName)" | ||
#if SWIFT_PACKAGE | ||
return UIImage(named: imagePath, in: .module, compatibleWith: nil) ?? UIImage() | ||
#else | ||
let bundle = Bundle(for: SKPhotoBrowser.self) | ||
return UIImage(named: imagePath, in: bundle, compatibleWith: nil) ?? UIImage() | ||
#endif | ||
} | ||
} |