Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support swift package manager #338

Merged
merged 17 commits into from
Jan 25, 2021
Merged

Conversation

mr-fixit
Copy link
Contributor

@mr-fixit mr-fixit commented Jan 7, 2021

Based on @mattpolzin's #333, but with the extra step of rearranging sources and resources to avoid needing symlinks.

Couldn't figure out how to add unit-test support, so left it out.

Addresses issue #332.

Package.swift Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link

@mattpolzin mattpolzin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not a required reviewer, but I'll approve nonetheless because the changes here align with the ones I made in prior passes at this task and I've pulled this branch into a real project and confirmed the package builds, gets linked, and runs with access to its resources (the close button "x").

README.md Show resolved Hide resolved
Package.swift Outdated Show resolved Hide resolved
Package.swift Outdated Show resolved Hide resolved
@mr-fixit
Copy link
Contributor Author

@Cam and/or @ZevEisenberg, no pressure, but i've love to merge this and #336, then release as v5.1...

@@ -12,6 +12,9 @@
@implementation NSBundle (NYTPhotoViewer)

+ (instancetype)nyt_photoViewerResourceBundle {
#if SWIFT_PACKAGE
return SWIFTPM_MODULE_BUNDLE;
#endif
static NSBundle *resourceBundle = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the name used below still accurate given the change from NYTPhotoView.bundle to Media.xcasssets in the podspec?

Copy link
Contributor Author

@mr-fixit mr-fixit Jan 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, because the contents of Media.xcassets are copied into NYTPhotoViewer.bundle/Assets.car

tested with BP:

po [UIImage imageNamed:@"NYTPhotoViewerCloseButtonX" inBundle:resourceBundle compatibleWithTraitCollection:nil]
<UIImage:0x600002a24c60 named(org.cocoapods.NYTPhotoViewer: NYTPhotoViewerCloseButtonX) {15, 15}>

tested visually:

Copy link
Contributor Author

@mr-fixit mr-fixit Jan 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test with actool:
(ha, i wish i could figure out how to get actool to list or extract contents!)

but we can see the names in the file...

$ strings  $B/Assets.car | grep -i closebutton 
NYTPhotoViewerCloseButtonX
NYTPhotoViewerCloseButtonXLandscape
[email protected]
[email protected]

Copy link
Contributor

@ZevEisenberg ZevEisenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but please update the "TK" in the readme before merging

@@ -23,6 +23,18 @@ Clone this locally, then in your local workspace of the `NYTPhotoViewer` repo, r

## Installation

### Swift Package Manager

NYTPhotoViewer may be installed via SPM, by pointing at this repo's URL and.. (more TK)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"more TK"

@mr-fixit mr-fixit merged commit 2fff7cb into develop Jan 25, 2021
@mr-fixit mr-fixit deleted the feature/swift-package-manager branch January 25, 2021 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants