From ea5e18aa3f6c463f5fc5a74e758199bebed12846 Mon Sep 17 00:00:00 2001 From: Jan Gorman Date: Tue, 25 Sep 2018 21:20:49 +0200 Subject: [PATCH 1/5] Remove SwiftyGif submodule --- .gitmodules | 3 --- Frameworks/SwiftyGif | 1 - 2 files changed, 4 deletions(-) delete mode 160000 Frameworks/SwiftyGif diff --git a/.gitmodules b/.gitmodules index 9e921a1..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "Frameworks/SwiftyGif"] - path = Frameworks/SwiftyGif - url = https://github.com/kirualex/SwiftyGif diff --git a/Frameworks/SwiftyGif b/Frameworks/SwiftyGif deleted file mode 160000 index aa19798..0000000 --- a/Frameworks/SwiftyGif +++ /dev/null @@ -1 +0,0 @@ -Subproject commit aa197988d7293ccb4c0f35b9213a249f9dffe530 From 92f0f723fcc6926797c4e5b09b086628e52b4545 Mon Sep 17 00:00:00 2001 From: Jan Gorman Date: Tue, 25 Sep 2018 21:22:08 +0200 Subject: [PATCH 2/5] Add Zoetrope instead --- .gitmodules | 3 +++ Frameworks/Zoetrope | 1 + 2 files changed, 4 insertions(+) create mode 160000 Frameworks/Zoetrope diff --git a/.gitmodules b/.gitmodules index e69de29..b04b7ed 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Frameworks/Zoetrope"] + path = Frameworks/Zoetrope + url = https://github.com/JanGorman/Zoetrope diff --git a/Frameworks/Zoetrope b/Frameworks/Zoetrope new file mode 160000 index 0000000..ca8dd6e --- /dev/null +++ b/Frameworks/Zoetrope @@ -0,0 +1 @@ +Subproject commit ca8dd6e360ff37f64fbfc441aa67c2cf464a078e From fc5bd4d3191dc77c5489c31b1df638e88eab6500 Mon Sep 17 00:00:00 2001 From: Jan Gorman Date: Tue, 25 Sep 2018 21:22:49 +0200 Subject: [PATCH 3/5] Replace references in Cartfile and podspec --- Agrume.podspec | 4 ++-- Cartfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Agrume.podspec b/Agrume.podspec index 22a4b2c..9a68096 100644 --- a/Agrume.podspec +++ b/Agrume.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Agrume" - s.version = "5.2.0" + s.version = "5.2.1" s.summary = "An iOS image viewer written in Swift." s.swift_version = "4.2" @@ -22,6 +22,6 @@ Pod::Spec.new do |s| s.source_files = "Classes", "Agrume/*.swift" - s.dependency "SwiftyGif" + s.dependency "Zoetrope" end diff --git a/Cartfile b/Cartfile index 22a7996..154b486 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "kirualex/SwiftyGif" \ No newline at end of file +github "JanGorman/Zoetrope" \ No newline at end of file From ebae34eb5013353d3e0f450394fb0850c9ad9348 Mon Sep 17 00:00:00 2001 From: Jan Gorman Date: Tue, 25 Sep 2018 21:28:02 +0200 Subject: [PATCH 4/5] Use Zoetrope in code --- .swiftlint.yml | 3 +- Agrume.xcodeproj/project.pbxproj | 85 +++++-------------- Agrume/AgrumeCell.swift | 6 +- Agrume/ImageDownloader.swift | 2 +- .../Agrume Example.xcodeproj/project.pbxproj | 10 ++- .../AnimatedGifViewController.swift | 6 +- 6 files changed, 38 insertions(+), 74 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 9a26220..ccb4149 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -14,6 +14,7 @@ type_name: error: 50 excluded: - id + - i type_body_length: - 600 @@ -51,4 +52,4 @@ disabled_rules: - vertical_parameter_alignment excluded: - - Frameworks/SwiftyGif \ No newline at end of file + - Frameworks/Zoetrope \ No newline at end of file diff --git a/Agrume.xcodeproj/project.pbxproj b/Agrume.xcodeproj/project.pbxproj index be27961..2da5c61 100644 --- a/Agrume.xcodeproj/project.pbxproj +++ b/Agrume.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ F2609E26209F06F800E0E93D /* AgrumeImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2609E25209F06F800E0E93D /* AgrumeImage.swift */; }; F2609E28209F2BC600E0E93D /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2609E27209F2BC600E0E93D /* Configuration.swift */; }; F2609E2A209F2E0200E0E93D /* UIKit+Agrume.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2609E29209F2E0200E0E93D /* UIKit+Agrume.swift */; }; + F28DAB09215AC2F600386D57 /* Zoetrope.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F28DAB08215AC2A400386D57 /* Zoetrope.framework */; }; F2A51FF41B10E00700924912 /* Agrume.h in Headers */ = {isa = PBXBuildFile; fileRef = F2A51FF31B10E00700924912 /* Agrume.h */; settings = {ATTRIBUTES = (Public, ); }; }; F2A51FFA1B10E00700924912 /* Agrume.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2A51FEE1B10E00700924912 /* Agrume.framework */; }; F2A5200B1B10E29B00924912 /* Agrume.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2A5200A1B10E29B00924912 /* Agrume.swift */; }; @@ -22,12 +23,12 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - F2539B9820F22D5100062C80 /* PBXContainerItemProxy */ = { + F28DAB07215AC2A400386D57 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = F2D7BA1020A47C6600D5EE66 /* SwiftyGif.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 3B18BAF31E289899009C125A; - remoteInfo = SwiftyGif; + containerPortal = F28DAB03215AC2A400386D57 /* Zoetrope.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 7777C76C215900AE005C1307; + remoteInfo = Zoetrope; }; F2A51FFB1B10E00700924912 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -36,27 +37,6 @@ remoteGlobalIDString = F2A51FED1B10E00700924912; remoteInfo = Agrume; }; - F2D7BA1620A47C6600D5EE66 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F2D7BA1020A47C6600D5EE66 /* SwiftyGif.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = FA29E9321CA9340E00E579D5; - remoteInfo = SwiftyGifExample; - }; - F2D7BA1820A47C6600D5EE66 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F2D7BA1020A47C6600D5EE66 /* SwiftyGif.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = FA29E9461CA9340F00E579D5; - remoteInfo = SwiftyGifTests; - }; - F2D7BA1A20A47C6600D5EE66 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F2D7BA1020A47C6600D5EE66 /* SwiftyGif.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 3B18BAF41E289899009C125A; - remoteInfo = SwiftyGif; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -66,13 +46,13 @@ F2609E25209F06F800E0E93D /* AgrumeImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgrumeImage.swift; sourceTree = ""; }; F2609E27209F2BC600E0E93D /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; F2609E29209F2E0200E0E93D /* UIKit+Agrume.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIKit+Agrume.swift"; sourceTree = ""; }; + F28DAB03215AC2A400386D57 /* Zoetrope.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Zoetrope.xcodeproj; path = Frameworks/Zoetrope/Zoetrope.xcodeproj; sourceTree = ""; }; F2A51FEE1B10E00700924912 /* Agrume.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Agrume.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F2A51FF21B10E00700924912 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F2A51FF31B10E00700924912 /* Agrume.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Agrume.h; sourceTree = ""; }; F2A51FF91B10E00700924912 /* AgrumeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AgrumeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; F2A51FFF1B10E00700924912 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F2A5200A1B10E29B00924912 /* Agrume.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Agrume.swift; sourceTree = ""; }; - F2D7BA1020A47C6600D5EE66 /* SwiftyGif.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftyGif.xcodeproj; path = Frameworks/SwiftyGif/SwiftyGif.xcodeproj; sourceTree = ""; }; F2D9598B1B1A108800073772 /* AgrumeCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AgrumeCell.swift; sourceTree = ""; }; F2DC79D51B170C4B00818A8C /* ImageDownloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageDownloader.swift; sourceTree = ""; }; F2EE29AD209F31B800F281A2 /* Foundation+Agrume.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Foundation+Agrume.swift"; sourceTree = ""; }; @@ -83,6 +63,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F28DAB09215AC2F600386D57 /* Zoetrope.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -104,10 +85,18 @@ name = Frameworks; sourceTree = ""; }; + F28DAB04215AC2A400386D57 /* Products */ = { + isa = PBXGroup; + children = ( + F28DAB08215AC2A400386D57 /* Zoetrope.framework */, + ); + name = Products; + sourceTree = ""; + }; F2A51FE41B10E00700924912 = { isa = PBXGroup; children = ( - F2D7BA1020A47C6600D5EE66 /* SwiftyGif.xcodeproj */, + F28DAB03215AC2A400386D57 /* Zoetrope.xcodeproj */, F2A51FF01B10E00700924912 /* Agrume */, F2A51FFD1B10E00700924912 /* AgrumeTests */, F2A51FEF1B10E00700924912 /* Products */, @@ -169,16 +158,6 @@ name = "Supporting Files"; sourceTree = ""; }; - F2D7BA1120A47C6600D5EE66 /* Products */ = { - isa = PBXGroup; - children = ( - F2D7BA1720A47C6600D5EE66 /* SwiftyGifExample.app */, - F2D7BA1920A47C6600D5EE66 /* SwiftyGifTests.xctest */, - F2D7BA1B20A47C6600D5EE66 /* SwiftyGif.framework */, - ); - name = Products; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -206,7 +185,6 @@ buildRules = ( ); dependencies = ( - F2539B9920F22D5100062C80 /* PBXTargetDependency */, ); name = Agrume; productName = Agrume; @@ -264,8 +242,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = F2D7BA1120A47C6600D5EE66 /* Products */; - ProjectRef = F2D7BA1020A47C6600D5EE66 /* SwiftyGif.xcodeproj */; + ProductGroup = F28DAB04215AC2A400386D57 /* Products */; + ProjectRef = F28DAB03215AC2A400386D57 /* Zoetrope.xcodeproj */; }, ); projectRoot = ""; @@ -277,25 +255,11 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - F2D7BA1720A47C6600D5EE66 /* SwiftyGifExample.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = SwiftyGifExample.app; - remoteRef = F2D7BA1620A47C6600D5EE66 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - F2D7BA1920A47C6600D5EE66 /* SwiftyGifTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = SwiftyGifTests.xctest; - remoteRef = F2D7BA1820A47C6600D5EE66 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - F2D7BA1B20A47C6600D5EE66 /* SwiftyGif.framework */ = { + F28DAB08215AC2A400386D57 /* Zoetrope.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SwiftyGif.framework; - remoteRef = F2D7BA1A20A47C6600D5EE66 /* PBXContainerItemProxy */; + path = Zoetrope.framework; + remoteRef = F28DAB07215AC2A400386D57 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -362,11 +326,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - F2539B9920F22D5100062C80 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = SwiftyGif; - targetProxy = F2539B9820F22D5100062C80 /* PBXContainerItemProxy */; - }; F2A51FFC1B10E00700924912 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = F2A51FED1B10E00700924912 /* Agrume */; diff --git a/Agrume/AgrumeCell.swift b/Agrume/AgrumeCell.swift index d041c16..349ac68 100644 --- a/Agrume/AgrumeCell.swift +++ b/Agrume/AgrumeCell.swift @@ -3,7 +3,7 @@ // import UIKit -import SwiftyGif +import Zoetrope protocol AgrumeCellDelegate: AnyObject { @@ -41,8 +41,8 @@ final class AgrumeCell: UICollectionViewCell { var image: UIImage? { didSet { - if image?.imageData != nil, let image = image { - imageView.setGifImage(image) + if image?.zoetrope != nil, let image = image { + imageView.displayGif(image) } else { imageView.image = image } diff --git a/Agrume/ImageDownloader.swift b/Agrume/ImageDownloader.swift index 8d094b9..d6255c3 100644 --- a/Agrume/ImageDownloader.swift +++ b/Agrume/ImageDownloader.swift @@ -5,7 +5,7 @@ import UIKit import ImageIO import MobileCoreServices -import SwiftyGif +import Zoetrope final class ImageDownloader { diff --git a/Example/Agrume Example.xcodeproj/project.pbxproj b/Example/Agrume Example.xcodeproj/project.pbxproj index 172b12a..6d36ed0 100644 --- a/Example/Agrume Example.xcodeproj/project.pbxproj +++ b/Example/Agrume Example.xcodeproj/project.pbxproj @@ -11,10 +11,10 @@ E77809E31D17821400CC60F1 /* SingleImageModalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E77809E21D17821400CC60F1 /* SingleImageModalViewController.swift */; }; F20F5BD41B134CAF00F9F499 /* Agrume.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2A520401B130CC000924912 /* Agrume.framework */; }; F2539BCB20F23ABB00062C80 /* CloseButtonViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2539BCA20F23ABB00062C80 /* CloseButtonViewController.swift */; }; - F2539BCC20F23F1800062C80 /* SwiftyGif.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2539B9D20F22D9000062C80 /* SwiftyGif.framework */; }; - F2539BCD20F23F1800062C80 /* SwiftyGif.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F2539B9D20F22D9000062C80 /* SwiftyGif.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; F2539BD020F23F2F00062C80 /* Agrume.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F2A520401B130CC000924912 /* Agrume.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; F2539BD420F2418900062C80 /* CustomCloseButtonViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2539BD320F2418900062C80 /* CustomCloseButtonViewController.swift */; }; + F28DAB0C215AC37A00386D57 /* Zoetrope.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F28DAB0B215AC37A00386D57 /* Zoetrope.framework */; }; + F28DAB0D215AC37A00386D57 /* Zoetrope.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F28DAB0B215AC37A00386D57 /* Zoetrope.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; F2A5201B1B130C7E00924912 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2A5201A1B130C7E00924912 /* AppDelegate.swift */; }; F2A5201D1B130C7E00924912 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2A5201C1B130C7E00924912 /* ViewController.swift */; }; F2A520201B130C7E00924912 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F2A5201E1B130C7E00924912 /* Main.storyboard */; }; @@ -74,7 +74,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - F2539BCD20F23F1800062C80 /* SwiftyGif.framework in Embed Frameworks */, + F28DAB0D215AC37A00386D57 /* Zoetrope.framework in Embed Frameworks */, F2539BD020F23F2F00062C80 /* Agrume.framework in Embed Frameworks */, ); name = "Embed Frameworks"; @@ -88,6 +88,7 @@ F2539B9D20F22D9000062C80 /* SwiftyGif.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SwiftyGif.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F2539BCA20F23ABB00062C80 /* CloseButtonViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloseButtonViewController.swift; sourceTree = ""; }; F2539BD320F2418900062C80 /* CustomCloseButtonViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomCloseButtonViewController.swift; sourceTree = ""; }; + F28DAB0B215AC37A00386D57 /* Zoetrope.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Zoetrope.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F2A520151B130C7E00924912 /* Agrume Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Agrume Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; F2A520191B130C7E00924912 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F2A5201A1B130C7E00924912 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -112,7 +113,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F2539BCC20F23F1800062C80 /* SwiftyGif.framework in Frameworks */, + F28DAB0C215AC37A00386D57 /* Zoetrope.framework in Frameworks */, F20F5BD41B134CAF00F9F499 /* Agrume.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -138,6 +139,7 @@ F2A5200C1B130C7E00924912 = { isa = PBXGroup; children = ( + F28DAB0B215AC37A00386D57 /* Zoetrope.framework */, F2A5203A1B130CC000924912 /* Agrume.xcodeproj */, F2A520171B130C7E00924912 /* Agrume Example */, F2A5202D1B130C7E00924912 /* Agrume ExampleTests */, diff --git a/Example/Agrume Example/AnimatedGifViewController.swift b/Example/Agrume Example/AnimatedGifViewController.swift index 46c54ac..f11fc5e 100644 --- a/Example/Agrume Example/AnimatedGifViewController.swift +++ b/Example/Agrume Example/AnimatedGifViewController.swift @@ -4,12 +4,14 @@ import UIKit import Agrume -import SwiftyGif +import Zoetrope final class AnimatedGifViewController: UIViewController { @IBAction func openImage(_ sender: Any?) { - let image = UIImage(gifName: "animated.gif") + guard let image = UIImage(gifName: "animated.gif") else { + return + } let agrume = Agrume(image: image, background: .blurred(.regular)) agrume.show(from: self) } From 5620821e2fdf38aefb06d5bdba8e15933de2b081 Mon Sep 17 00:00:00 2001 From: Jan Gorman Date: Tue, 25 Sep 2018 21:36:25 +0200 Subject: [PATCH 5/5] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dd8f29..377d4c5 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ This shows a way of keeping the zoomed library and the one in the background syn ### Animated gifs -Agrume bundles [SwiftyGif](https://github.com/kirualex/SwiftyGif) to display animated gifs. You use SwiftyGif's custom `UIImage` initializer: +Agrume bundles [Zoetrope](https://github.com/JanGorman/Zoetrope) to display animated gifs. You use Zoetrope's custom `UIImage` initializer: ```swift