Skip to content

Commit be07cca

Browse files
committed
switch to FLAnimatedImage, from PINRemoteImage
1 parent e807f8c commit be07cca

File tree

10 files changed

+73
-128
lines changed

10 files changed

+73
-128
lines changed

Examples/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
source "https://rubygems.org"
22

3-
gem 'cocoapods', '1.10.0'
3+
gem 'cocoapods', '1.11.3'

Examples/Gemfile.lock

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.2)
5-
activesupport (5.2.4.4)
4+
CFPropertyList (3.0.5)
5+
rexml
6+
activesupport (6.1.7)
67
concurrent-ruby (~> 1.0, >= 1.0.2)
7-
i18n (>= 0.7, < 2)
8-
minitest (~> 5.1)
9-
tzinfo (~> 1.1)
10-
addressable (2.8.0)
11-
public_suffix (>= 2.0.2, < 5.0)
8+
i18n (>= 1.6, < 2)
9+
minitest (>= 5.1)
10+
tzinfo (~> 2.0)
11+
zeitwerk (~> 2.3)
12+
addressable (2.8.1)
13+
public_suffix (>= 2.0.2, < 6.0)
1214
algoliasearch (1.27.5)
1315
httpclient (~> 2.8, >= 2.8.3)
1416
json (>= 1.5.1)
1517
atomos (0.1.3)
16-
claide (1.0.3)
17-
cocoapods (1.10.0)
18-
addressable (~> 2.6)
18+
claide (1.1.0)
19+
cocoapods (1.11.3)
20+
addressable (~> 2.8)
1921
claide (>= 1.0.2, < 2.0)
20-
cocoapods-core (= 1.10.0)
22+
cocoapods-core (= 1.11.3)
2123
cocoapods-deintegrate (>= 1.0.3, < 2.0)
2224
cocoapods-downloader (>= 1.4.0, < 2.0)
2325
cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -28,66 +30,68 @@ GEM
2830
escape (~> 0.0.4)
2931
fourflusher (>= 2.3.0, < 3.0)
3032
gh_inspector (~> 1.0)
31-
molinillo (~> 0.6.6)
33+
molinillo (~> 0.8.0)
3234
nap (~> 1.0)
33-
ruby-macho (~> 1.4)
34-
xcodeproj (>= 1.19.0, < 2.0)
35-
cocoapods-core (1.10.0)
36-
activesupport (> 5.0, < 6)
37-
addressable (~> 2.6)
35+
ruby-macho (>= 1.0, < 3.0)
36+
xcodeproj (>= 1.21.0, < 2.0)
37+
cocoapods-core (1.11.3)
38+
activesupport (>= 5.0, < 7)
39+
addressable (~> 2.8)
3840
algoliasearch (~> 1.0)
3941
concurrent-ruby (~> 1.1)
4042
fuzzy_match (~> 2.0.4)
4143
nap (~> 1.0)
4244
netrc (~> 0.11)
43-
public_suffix
45+
public_suffix (~> 4.0)
4446
typhoeus (~> 1.0)
45-
cocoapods-deintegrate (1.0.4)
47+
cocoapods-deintegrate (1.0.5)
4648
cocoapods-downloader (1.6.3)
4749
cocoapods-plugins (1.0.0)
4850
nap
49-
cocoapods-search (1.0.0)
50-
cocoapods-trunk (1.5.0)
51+
cocoapods-search (1.0.1)
52+
cocoapods-trunk (1.6.0)
5153
nap (>= 0.8, < 2.0)
5254
netrc (~> 0.11)
5355
cocoapods-try (1.2.0)
5456
colored2 (3.1.2)
55-
concurrent-ruby (1.1.7)
57+
concurrent-ruby (1.1.10)
5658
escape (0.0.4)
57-
ethon (0.12.0)
58-
ffi (>= 1.3.0)
59-
ffi (1.13.1)
59+
ethon (0.15.0)
60+
ffi (>= 1.15.0)
61+
ffi (1.15.5)
6062
fourflusher (2.3.1)
6163
fuzzy_match (2.0.4)
6264
gh_inspector (1.1.3)
6365
httpclient (2.8.3)
64-
i18n (1.8.5)
66+
i18n (1.12.0)
6567
concurrent-ruby (~> 1.0)
66-
json (2.3.1)
67-
minitest (5.14.2)
68-
molinillo (0.6.6)
68+
json (2.6.2)
69+
minitest (5.16.3)
70+
molinillo (0.8.0)
6971
nanaimo (0.3.0)
7072
nap (1.1.0)
7173
netrc (0.11.0)
72-
public_suffix (4.0.6)
73-
ruby-macho (1.4.0)
74-
thread_safe (0.3.6)
74+
public_suffix (4.0.7)
75+
rexml (3.2.5)
76+
ruby-macho (2.5.1)
7577
typhoeus (1.4.0)
7678
ethon (>= 0.9.0)
77-
tzinfo (1.2.10)
78-
thread_safe (~> 0.1)
79-
xcodeproj (1.19.0)
79+
tzinfo (2.0.5)
80+
concurrent-ruby (~> 1.0)
81+
xcodeproj (1.22.0)
8082
CFPropertyList (>= 2.3.3, < 4.0)
8183
atomos (~> 0.1.3)
8284
claide (>= 1.0.2, < 2.0)
8385
colored2 (~> 3.1)
8486
nanaimo (~> 0.3.0)
87+
rexml (~> 3.2.4)
88+
zeitwerk (2.6.1)
8589

8690
PLATFORMS
8791
ruby
8892

8993
DEPENDENCIES
90-
cocoapods (= 1.10.0)
94+
cocoapods (= 1.11.3)
9195

9296
BUNDLED WITH
9397
2.1.4

Examples/Podfile.lock

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,32 @@
11
PODS:
2-
- NYTPhotoViewer (5.0.7):
3-
- NYTPhotoViewer/AnimatedGifSupport (= 5.0.7)
4-
- NYTPhotoViewer/Core (= 5.0.7)
5-
- NYTPhotoViewer/AnimatedGifSupport (5.0.7):
2+
- FLAnimatedImage (1.0.17)
3+
- NYTPhotoViewer (5.0.8):
4+
- NYTPhotoViewer/AnimatedGifSupport (= 5.0.8)
5+
- NYTPhotoViewer/Core (= 5.0.8)
6+
- NYTPhotoViewer/AnimatedGifSupport (5.0.8):
7+
- FLAnimatedImage
68
- NYTPhotoViewer/Core
7-
- PINRemoteImage/iOS
8-
- PINRemoteImage/PINCache
9-
- NYTPhotoViewer/Core (5.0.7)
9+
- NYTPhotoViewer/Core (5.0.8)
1010
- OCMock (3.7.1)
11-
- PINCache (3.0.3):
12-
- PINCache/Arc-exception-safe (= 3.0.3)
13-
- PINCache/Core (= 3.0.3)
14-
- PINCache/Arc-exception-safe (3.0.3):
15-
- PINCache/Core
16-
- PINCache/Core (3.0.3):
17-
- PINOperation (~> 1.2.1)
18-
- PINOperation (1.2.1)
19-
- PINRemoteImage/Core (3.0.3):
20-
- PINOperation
21-
- PINRemoteImage/iOS (3.0.3):
22-
- PINRemoteImage/Core
23-
- PINRemoteImage/PINCache (3.0.3):
24-
- PINCache (~> 3.0.3)
25-
- PINRemoteImage/Core
2611

2712
DEPENDENCIES:
2813
- NYTPhotoViewer (from `..`)
2914
- OCMock
3015

3116
SPEC REPOS:
3217
trunk:
18+
- FLAnimatedImage
3319
- OCMock
34-
- PINCache
35-
- PINOperation
36-
- PINRemoteImage
3720

3821
EXTERNAL SOURCES:
3922
NYTPhotoViewer:
4023
:path: ".."
4124

4225
SPEC CHECKSUMS:
43-
NYTPhotoViewer: 64f9c45438a0e6a8f6fa67fd924bd090dea54ad4
26+
FLAnimatedImage: bbf914596368867157cc71b38a8ec834b3eeb32b
27+
NYTPhotoViewer: 56bb5fd5c90524ef2e8bd23e660440934bc5764d
4428
OCMock: 75fbeaa46a9b11f8c182bbb1d1f7e9a35ccc9955
45-
PINCache: 7a8fc1a691173d21dbddbf86cd515de6efa55086
46-
PINOperation: 00c935935f1e8cf0d1e2d6b542e75b88fc3e5e20
47-
PINRemoteImage: f1295b29f8c5e640e25335a1b2bd9d805171bd01
4829

4930
PODFILE CHECKSUM: 2d91d58ac59e8440027da7c7b8b5f2e362fb3857
5031

51-
COCOAPODS: 1.10.0
32+
COCOAPODS: 1.11.3

NYTPhotoViewer.podspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ Pod::Spec.new do |s|
2424
s.subspec 'AnimatedGifSupport' do |ss|
2525
ss.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ANIMATED_GIF_SUPPORT=1' }
2626
ss.dependency 'NYTPhotoViewer/Core'
27-
ss.dependency 'PINRemoteImage/iOS'
28-
ss.dependency 'PINRemoteImage/PINCache'
27+
ss.dependency 'FLAnimatedImage'
2928
end
3029

3130
end

NYTPhotoViewer/NYTPhotoViewController.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212

1313
#ifdef ANIMATED_GIF_SUPPORT
1414
#if SWIFT_PACKAGE
15-
#import "PINRemoteImage.h"
16-
#import "PINAnimatedImageView.h"
15+
#import "FLAnimatedImageView.h"
1716
#else
18-
#import <PINRemoteImage/PINRemoteImage.h>
19-
#import <PINRemoteImage/PINAnimatedImageView.h>
17+
#import <FLAnimatedImage/FLAnimatedImageView.h>
2018
#endif
2119
#endif
2220

NYTPhotoViewer/NYTPhotosViewController.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@
2121

2222
#ifdef ANIMATED_GIF_SUPPORT
2323
#if SWIFT_PACKAGE
24-
#import "PINRemoteImage.h"
25-
#import "PINAnimatedImageView.h"
24+
#import "FLAnimatedImageView.h"
2625
#else
27-
#import <PINRemoteImage/PINRemoteImage.h>
28-
#import <PINRemoteImage/PINAnimatedImageView.h>
26+
#import <FLAnimatedImage/FLAnimatedImageView.h>
2927
#endif
3028
#endif
3129

NYTPhotoViewer/NYTScalingImageView.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212

1313
#ifdef ANIMATED_GIF_SUPPORT
1414
#if SWIFT_PACKAGE
15-
#import "PINRemoteImage.h"
16-
#import "PINAnimatedImageView.h"
15+
#import "FLAnimatedImageView.h"
1716
#else
18-
#import <PINRemoteImage/PINRemoteImage.h>
19-
#import <PINRemoteImage/PINAnimatedImageView.h>
17+
#import <FLAnimatedImage/FLAnimatedImageView.h>
18+
#import <FLAnimatedImage/FLAnimatedImage.h>
2019
#endif
2120
#endif
2221

@@ -25,7 +24,7 @@ @interface NYTScalingImageView ()
2524
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
2625

2726
#ifdef ANIMATED_GIF_SUPPORT
28-
@property (nonatomic) PINAnimatedImageView *imageView;
27+
@property (nonatomic) FLAnimatedImageView *imageView;
2928
#else
3029
@property (nonatomic) UIImageView *imageView;
3130
#endif
@@ -94,7 +93,8 @@ - (void)setupInternalImageViewWithImage:(UIImage *)image imageData:(NSData *)ima
9493
UIImage *imageToUse = image ?: [UIImage imageWithData:imageData];
9594

9695
#ifdef ANIMATED_GIF_SUPPORT
97-
self.imageView = [[PINAnimatedImageView alloc] initWithAnimatedImage:[[PINCachedAnimatedImage alloc] initWithAnimatedImageData:imageData]];
96+
self.imageView = FLAnimatedImageView.new;
97+
self.imageView.animatedImage = [FLAnimatedImage animatedImageWithGIFData:imageData];
9898
#else
9999
self.imageView = [[UIImageView alloc] initWithImage:imageToUse];
100100
#endif
@@ -127,8 +127,8 @@ - (void)updateImage:(UIImage *)image imageData:(NSData *)imageData {
127127
self.imageView.image = imageToUse;
128128

129129
#ifdef ANIMATED_GIF_SUPPORT
130-
// It's necessarry to first assign the UIImage so calulations for layout go right (see above)
131-
self.imageView.animatedImage = [[PINCachedAnimatedImage alloc] initWithAnimatedImageData:imageData];
130+
// It's necessary to first assign the UIImage so calculations for layout go right (see above)
131+
self.imageView.animatedImage = [FLAnimatedImage animatedImageWithGIFData:imageData];
132132
#endif
133133

134134
self.imageView.frame = CGRectMake(0, 0, imageToUse.size.width, imageToUse.size.height);

NYTPhotoViewer/include/NYTScalingImageView.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@import UIKit;
1010

1111
#ifdef ANIMATED_GIF_SUPPORT
12-
@class PINAnimatedImageView;
12+
@class FLAnimatedImageView;
1313
#endif
1414

1515
NS_ASSUME_NONNULL_BEGIN
@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
2020
* The image view used internally as the contents of the scroll view.
2121
*/
2222
#ifdef ANIMATED_GIF_SUPPORT
23-
@property (nonatomic, readonly) PINAnimatedImageView *imageView;
23+
@property (nonatomic, readonly) FLAnimatedImageView *imageView;
2424
#else
2525
@property (nonatomic, readonly) UIImageView *imageView;
2626
#endif

Package.resolved

Lines changed: 4 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,16 @@ let package = Package(
99
products: [
1010
.library(
1111
name: "NYTPhotoViewer",
12-
targets: ["NYTPhotoViewer", "NYTPhotoViewerGIF"]
12+
targets: ["NYTPhotoViewer"]
1313
),
1414
],
1515
dependencies: [
16-
.package(url: "https://github.com/pinterest/PINRemoteImage.git", from: "3.0.1")
16+
.package(url: "https://github.com/Flipboard/FLAnimatedImage.git", .upToNextMajor(from: "1.0.17"))
1717
],
1818
targets: [
1919
.target(
2020
name: "NYTPhotoViewer",
2121
path: "NYTPhotoViewer"
2222
),
23-
.target(
24-
name: "NYTPhotoViewerGIF",
25-
dependencies: ["PINRemoteImage"],
26-
path: "SourceSymLink",
27-
cSettings: [
28-
.define("ANIMATED_GIF_SUPPORT", to: "1")
29-
]
30-
)
3123
]
3224
)

0 commit comments

Comments
 (0)