diff --git a/CHANGELOG.md b/CHANGELOG.md index 8709011b..a31597ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ ## `develop` Changes for users of the library currently on `develop`: -- fixed a NaN when setting `zoomScale` in `NYTScalingImageView` when `ANIMATED_GIF_SUPPORT=1` +- fixed a NaN when setting `zoomScale` in `NYTScalingImageView` when `ANIMATED_GIF_SUPPORT=1` +- Add a SwiftPM package manifest. ## [5.0.5](https://github.com/nytimes/NYTPhotoViewer/releases/tag/5.0.5) diff --git a/NYTPhotoViewer/Resource Loading/NSBundle+NYTPhotoViewer.m b/NYTPhotoViewer/Resource Loading/NSBundle+NYTPhotoViewer.m index 19d0c12c..1487c0e0 100644 --- a/NYTPhotoViewer/Resource Loading/NSBundle+NYTPhotoViewer.m +++ b/NYTPhotoViewer/Resource Loading/NSBundle+NYTPhotoViewer.m @@ -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, ^{ diff --git a/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonX.png b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonX.png new file mode 120000 index 00000000..5d2c81ac --- /dev/null +++ b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonX.png @@ -0,0 +1 @@ +../NYTPhotoViewer.bundle/NYTPhotoViewerCloseButtonX.png \ No newline at end of file diff --git a/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonX@2x.png b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonX@2x.png new file mode 120000 index 00000000..b1b2d604 --- /dev/null +++ b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonX@2x.png @@ -0,0 +1 @@ +../NYTPhotoViewer.bundle/NYTPhotoViewerCloseButtonX@2x.png \ No newline at end of file diff --git a/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonX@3x.png b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonX@3x.png new file mode 120000 index 00000000..41ab3f14 --- /dev/null +++ b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonX@3x.png @@ -0,0 +1 @@ +../NYTPhotoViewer.bundle/NYTPhotoViewerCloseButtonX@3x.png \ No newline at end of file diff --git a/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonXLandscape.png b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonXLandscape.png new file mode 120000 index 00000000..7d327172 --- /dev/null +++ b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonXLandscape.png @@ -0,0 +1 @@ +../NYTPhotoViewer.bundle/NYTPhotoViewerCloseButtonXLandscape.png \ No newline at end of file diff --git a/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonXLandscape@2x.png b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonXLandscape@2x.png new file mode 120000 index 00000000..9d585160 --- /dev/null +++ b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonXLandscape@2x.png @@ -0,0 +1 @@ +../NYTPhotoViewer.bundle/NYTPhotoViewerCloseButtonXLandscape@2x.png \ No newline at end of file diff --git a/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonXLandscape@3x.png b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonXLandscape@3x.png new file mode 120000 index 00000000..e6f6f0b2 --- /dev/null +++ b/NYTPhotoViewer/Resources/NYTPhotoViewerCloseButtonXLandscape@3x.png @@ -0,0 +1 @@ +../NYTPhotoViewer.bundle/NYTPhotoViewerCloseButtonXLandscape@3x.png \ No newline at end of file diff --git a/NYTPhotoViewer/include/NSBundle+NYTPhotoViewer.h b/NYTPhotoViewer/include/NSBundle+NYTPhotoViewer.h new file mode 120000 index 00000000..21e7cbc6 --- /dev/null +++ b/NYTPhotoViewer/include/NSBundle+NYTPhotoViewer.h @@ -0,0 +1 @@ +../Resource Loading/NSBundle+NYTPhotoViewer.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhoto.h b/NYTPhotoViewer/include/NYTPhoto.h new file mode 120000 index 00000000..df44c70e --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhoto.h @@ -0,0 +1 @@ +../Protocols/NYTPhoto.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotoCaptionView.h b/NYTPhotoViewer/include/NYTPhotoCaptionView.h new file mode 120000 index 00000000..eeab5d6b --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotoCaptionView.h @@ -0,0 +1 @@ +../NYTPhotoCaptionView.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotoCaptionViewLayoutWidthHinting.h b/NYTPhotoViewer/include/NYTPhotoCaptionViewLayoutWidthHinting.h new file mode 120000 index 00000000..8c16d3cf --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotoCaptionViewLayoutWidthHinting.h @@ -0,0 +1 @@ +../Protocols/NYTPhotoCaptionViewLayoutWidthHinting.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotoDismissalInteractionController.h b/NYTPhotoViewer/include/NYTPhotoDismissalInteractionController.h new file mode 120000 index 00000000..bef0edd6 --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotoDismissalInteractionController.h @@ -0,0 +1 @@ +../NYTPhotoDismissalInteractionController.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotoTransitionAnimator.h b/NYTPhotoViewer/include/NYTPhotoTransitionAnimator.h new file mode 120000 index 00000000..16bf84e7 --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotoTransitionAnimator.h @@ -0,0 +1 @@ +../NYTPhotoTransitionAnimator.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotoTransitionController.h b/NYTPhotoViewer/include/NYTPhotoTransitionController.h new file mode 120000 index 00000000..5768d71d --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotoTransitionController.h @@ -0,0 +1 @@ +../NYTPhotoTransitionController.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotoViewController.h b/NYTPhotoViewer/include/NYTPhotoViewController.h new file mode 120000 index 00000000..bbd14c86 --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotoViewController.h @@ -0,0 +1 @@ +../NYTPhotoViewController.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotoViewerArrayDataSource.h b/NYTPhotoViewer/include/NYTPhotoViewerArrayDataSource.h new file mode 120000 index 00000000..24d2ec42 --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotoViewerArrayDataSource.h @@ -0,0 +1 @@ +../NYTPhotoViewerArrayDataSource.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotoViewerContainer.h b/NYTPhotoViewer/include/NYTPhotoViewerContainer.h new file mode 120000 index 00000000..f4f78e59 --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotoViewerContainer.h @@ -0,0 +1 @@ +../Protocols/NYTPhotoViewerContainer.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotoViewerDataSource.h b/NYTPhotoViewer/include/NYTPhotoViewerDataSource.h new file mode 120000 index 00000000..a48b5630 --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotoViewerDataSource.h @@ -0,0 +1 @@ +../Protocols/NYTPhotoViewerDataSource.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotoViewerSinglePhotoDataSource.h b/NYTPhotoViewer/include/NYTPhotoViewerSinglePhotoDataSource.h new file mode 120000 index 00000000..c58d9746 --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotoViewerSinglePhotoDataSource.h @@ -0,0 +1 @@ +../NYTPhotoViewerSinglePhotoDataSource.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotosOverlayView.h b/NYTPhotoViewer/include/NYTPhotosOverlayView.h new file mode 120000 index 00000000..f0045836 --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotosOverlayView.h @@ -0,0 +1 @@ +../NYTPhotosOverlayView.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTPhotosViewController.h b/NYTPhotoViewer/include/NYTPhotosViewController.h new file mode 120000 index 00000000..2a64027b --- /dev/null +++ b/NYTPhotoViewer/include/NYTPhotosViewController.h @@ -0,0 +1 @@ +../NYTPhotosViewController.h \ No newline at end of file diff --git a/NYTPhotoViewer/include/NYTScalingImageView.h b/NYTPhotoViewer/include/NYTScalingImageView.h new file mode 120000 index 00000000..2168666d --- /dev/null +++ b/NYTPhotoViewer/include/NYTScalingImageView.h @@ -0,0 +1 @@ +../NYTScalingImageView.h \ No newline at end of file diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..9a955122 --- /dev/null +++ b/Package.swift @@ -0,0 +1,40 @@ +// swift-tools-version:5.3 +import PackageDescription + +let package = Package( + name: "NYTPhotoViewer", + platforms: [ + .iOS(.v9) + ], + products: [ + .library( + name: "NYTPhotoViewer", + targets: ["NYTPhotoViewer"]), + ], + dependencies: [ + .package(url: "https://github.com/pinterest/PINRemoteImage.git", from: "3.0.1") + ], + targets: [ + .target( + name: "NYTPhotoViewer", + dependencies: ["PINRemoteImage"], + path: "NYTPhotoViewer", + exclude: [ + "NYTPhotoViewer.bundle", + "Info.plist" + ], + resources: [ + .copy("Resources/NYTPhotoViewerCloseButtonX.png"), + .copy("Resources/NYTPhotoViewerCloseButtonX@2x.png"), + .copy("Resources/NYTPhotoViewerCloseButtonX@3x.png"), + .copy("Resources/NYTPhotoViewerCloseButtonXLandscape.png"), + .copy("Resources/NYTPhotoViewerCloseButtonXLandscape@2x.png"), + .copy("Resources/NYTPhotoViewerCloseButtonXLandscape@3x.png"), + ], + cSettings: [ + .headerSearchPath("./"), + .headerSearchPath("./Protocols"), + .headerSearchPath("./Resource Loading") + ]) + ] +)