diff --git a/.gitignore b/.gitignore index 49f8a58..c0d8c9a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ build/ *.dat *.dep .DS_Store +Carthage/Build diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8864518 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Carthage/Checkouts/runes"] + path = Carthage/Checkouts/runes + url = https://github.com/thoughtbot/runes.git diff --git a/Cartfile b/Cartfile new file mode 100644 index 0000000..e3520af --- /dev/null +++ b/Cartfile @@ -0,0 +1 @@ +github "thoughtbot/runes" diff --git a/Cartfile.resolved b/Cartfile.resolved new file mode 100644 index 0000000..edf6eb5 --- /dev/null +++ b/Cartfile.resolved @@ -0,0 +1 @@ +github "thoughtbot/runes" "v1.1" diff --git a/Carthage/Checkouts/runes b/Carthage/Checkouts/runes new file mode 160000 index 0000000..cee6b16 --- /dev/null +++ b/Carthage/Checkouts/runes @@ -0,0 +1 @@ +Subproject commit cee6b16f47dc766494dbd998bc17f4ca932e08c3 diff --git a/Demo/gifu-demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj similarity index 81% rename from Demo/gifu-demo.xcodeproj/project.pbxproj rename to Demo/Demo.xcodeproj/project.pbxproj index 21f47da..7cce54c 100755 --- a/Demo/gifu-demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -7,8 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 00B8C8381A36583600C188E7 /* Gifu.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B8C8371A36583000C188E7 /* Gifu.framework */; }; - 00B8C8391A36583600C188E7 /* Gifu.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 00B8C8371A36583000C188E7 /* Gifu.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 005656EB1A6EE471008A0ED1 /* Gifu.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 005656EA1A6EE471008A0ED1 /* Gifu.framework */; }; 9D25870819BCCB0F00A55A18 /* mugen.gif in Resources */ = {isa = PBXBuildFile; fileRef = 9D25870619BCCB0F00A55A18 /* mugen.gif */; }; 9D98823D19BC69CA00B790C6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D98823C19BC69CA00B790C6 /* AppDelegate.swift */; }; 9D98823F19BC69CA00B790C6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D98823E19BC69CA00B790C6 /* ViewController.swift */; }; @@ -17,23 +16,6 @@ 9D98826719BC874C00B790C6 /* FlatButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D98826619BC874C00B790C6 /* FlatButton.swift */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 00B8C8361A36583000C188E7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 00B8C8321A36583000C188E7 /* Gifu.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 00B8C73E1A364DA400C188E7; - remoteInfo = Gifu; - }; - 00B8C83A1A36583600C188E7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 00B8C8321A36583000C188E7 /* Gifu.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 00B8C73D1A364DA400C188E7; - remoteInfo = Gifu; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ 00B8C7331A364D4C00C188E7 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; @@ -41,7 +23,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 00B8C8391A36583600C188E7 /* Gifu.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -49,7 +30,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 00B8C8321A36583000C188E7 /* Gifu.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Gifu.xcodeproj; path = ../../Gifu.xcodeproj; sourceTree = ""; }; + 005656EA1A6EE471008A0ED1 /* Gifu.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Gifu.framework; path = "../../build/Debug-iphoneos/Gifu.framework"; sourceTree = ""; }; 9D25870519BCCB0F00A55A18 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9D25870619BCCB0F00A55A18 /* mugen.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = mugen.gif; sourceTree = ""; }; 9D98823719BC69CA00B790C6 /* gifu-demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "gifu-demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -65,36 +46,18 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 00B8C8381A36583600C188E7 /* Gifu.framework in Frameworks */, + 005656EB1A6EE471008A0ED1 /* Gifu.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 00B8C7621A364E8C00C188E7 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 00B8C8321A36583000C188E7 /* Gifu.xcodeproj */, - ); - name = Frameworks; - path = demo; - sourceTree = ""; - }; - 00B8C8331A36583000C188E7 /* Products */ = { - isa = PBXGroup; - children = ( - 00B8C8371A36583000C188E7 /* Gifu.framework */, - ); - name = Products; - sourceTree = ""; - }; 9D98822E19BC69CA00B790C6 = { isa = PBXGroup; children = ( 9D98823919BC69CA00B790C6 /* Source */, 9D98823819BC69CA00B790C6 /* Products */, - 00B8C7621A364E8C00C188E7 /* Frameworks */, ); sourceTree = ""; }; @@ -123,6 +86,7 @@ 9D98823A19BC69CA00B790C6 /* Supporting Files */ = { isa = PBXGroup; children = ( + 005656EA1A6EE471008A0ED1 /* Gifu.framework */, 9D25870519BCCB0F00A55A18 /* Info.plist */, 9D25870619BCCB0F00A55A18 /* mugen.gif */, ); @@ -144,7 +108,6 @@ buildRules = ( ); dependencies = ( - 00B8C83B1A36583600C188E7 /* PBXTargetDependency */, ); name = "gifu-demo"; productName = "gifu-demo"; @@ -165,7 +128,7 @@ }; }; }; - buildConfigurationList = 9D98823219BC69CA00B790C6 /* Build configuration list for PBXProject "gifu-demo" */; + buildConfigurationList = 9D98823219BC69CA00B790C6 /* Build configuration list for PBXProject "Demo" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -176,12 +139,6 @@ mainGroup = 9D98822E19BC69CA00B790C6; productRefGroup = 9D98823819BC69CA00B790C6 /* Products */; projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 00B8C8331A36583000C188E7 /* Products */; - ProjectRef = 00B8C8321A36583000C188E7 /* Gifu.xcodeproj */; - }, - ); projectRoot = ""; targets = ( 9D98823619BC69CA00B790C6 /* gifu-demo */, @@ -189,16 +146,6 @@ }; /* End PBXProject section */ -/* Begin PBXReferenceProxy section */ - 00B8C8371A36583000C188E7 /* Gifu.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Gifu.framework; - remoteRef = 00B8C8361A36583000C188E7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - /* Begin PBXResourcesBuildPhase section */ 9D98823519BC69CA00B790C6 /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -225,14 +172,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 00B8C83B1A36583600C188E7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Gifu; - targetProxy = 00B8C83A1A36583600C188E7 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ 9D98825119BC69CA00B790C6 /* Debug */ = { isa = XCBuildConfiguration; @@ -317,6 +256,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = demo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -330,6 +270,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = demo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -340,7 +281,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 9D98823219BC69CA00B790C6 /* Build configuration list for PBXProject "gifu-demo" */ = { + 9D98823219BC69CA00B790C6 /* Build configuration list for PBXProject "Demo" */ = { isa = XCConfigurationList; buildConfigurations = ( 9D98825119BC69CA00B790C6 /* Debug */, diff --git a/Demo/gifu-demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Demo/Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Demo/gifu-demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Demo/Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Demo/Demo.xcworkspace/contents.xcworkspacedata b/Demo/Demo.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3938b1a --- /dev/null +++ b/Demo/Demo.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/Gifu.xcodeproj/project.pbxproj b/Gifu.xcodeproj/project.pbxproj index e698be0..71bd76a 100644 --- a/Gifu.xcodeproj/project.pbxproj +++ b/Gifu.xcodeproj/project.pbxproj @@ -7,16 +7,18 @@ objects = { /* Begin PBXBuildFile section */ + 006F97011A6EDE7900CB5CE8 /* Runes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 006F97001A6EDE7900CB5CE8 /* Runes.framework */; }; 00B8C75E1A364DCE00C188E7 /* AnimatedImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B8C75B1A364DCE00C188E7 /* AnimatedImage.swift */; }; 00B8C75F1A364DCE00C188E7 /* ImageSourceHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B8C75C1A364DCE00C188E7 /* ImageSourceHelpers.swift */; }; 00B8C7601A364DCE00C188E7 /* UIImageView+Gifu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B8C75D1A364DCE00C188E7 /* UIImageView+Gifu.swift */; }; 00B8C7961A3650EE00C188E7 /* Gifu.h in Headers */ = {isa = PBXBuildFile; fileRef = 00B8C7951A3650EE00C188E7 /* Gifu.h */; settings = {ATTRIBUTES = (Public, ); }; }; EAF49C7F1A3A4DE000B395DF /* UIImageExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF49C7E1A3A4DE000B395DF /* UIImageExtension.swift */; }; - EAF49C811A3A4FAA00B395DF /* Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF49C801A3A4FAA00B395DF /* Functional.swift */; }; + EAF49C811A3A4FAA00B395DF /* Curry.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF49C801A3A4FAA00B395DF /* Curry.swift */; }; EAF49CB11A3B6EEB00B395DF /* AnimatedFrame.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF49CB01A3B6EEB00B395DF /* AnimatedFrame.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 006F97001A6EDE7900CB5CE8 /* Runes.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Runes.framework; path = "../Carthage/Checkouts/runes/build/Debug-iphoneos/Runes.framework"; sourceTree = ""; }; 00B8C73E1A364DA400C188E7 /* Gifu.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Gifu.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 00B8C7421A364DA400C188E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../Source/Info.plist; sourceTree = ""; }; 00B8C75B1A364DCE00C188E7 /* AnimatedImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimatedImage.swift; sourceTree = ""; }; @@ -24,7 +26,7 @@ 00B8C75D1A364DCE00C188E7 /* UIImageView+Gifu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImageView+Gifu.swift"; sourceTree = ""; }; 00B8C7951A3650EE00C188E7 /* Gifu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Gifu.h; sourceTree = ""; }; EAF49C7E1A3A4DE000B395DF /* UIImageExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIImageExtension.swift; sourceTree = ""; }; - EAF49C801A3A4FAA00B395DF /* Functional.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Functional.swift; sourceTree = ""; }; + EAF49C801A3A4FAA00B395DF /* Curry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Curry.swift; sourceTree = ""; }; EAF49CB01A3B6EEB00B395DF /* AnimatedFrame.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimatedFrame.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -33,6 +35,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 006F97011A6EDE7900CB5CE8 /* Runes.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -59,6 +62,7 @@ 00B8C7411A364DA400C188E7 /* Supporting Files */ = { isa = PBXGroup; children = ( + 006F97001A6EDE7900CB5CE8 /* Runes.framework */, 00B8C7421A364DA400C188E7 /* Info.plist */, ); name = "Supporting Files"; @@ -73,7 +77,7 @@ 00B8C75C1A364DCE00C188E7 /* ImageSourceHelpers.swift */, 00B8C75D1A364DCE00C188E7 /* UIImageView+Gifu.swift */, EAF49C7E1A3A4DE000B395DF /* UIImageExtension.swift */, - EAF49C801A3A4FAA00B395DF /* Functional.swift */, + EAF49C801A3A4FAA00B395DF /* Curry.swift */, EAF49CB01A3B6EEB00B395DF /* AnimatedFrame.swift */, ); path = Source; @@ -160,7 +164,7 @@ EAF49CB11A3B6EEB00B395DF /* AnimatedFrame.swift in Sources */, 00B8C7601A364DCE00C188E7 /* UIImageView+Gifu.swift in Sources */, 00B8C75F1A364DCE00C188E7 /* ImageSourceHelpers.swift in Sources */, - EAF49C811A3A4FAA00B395DF /* Functional.swift in Sources */, + EAF49C811A3A4FAA00B395DF /* Curry.swift in Sources */, 00B8C75E1A364DCE00C188E7 /* AnimatedImage.swift in Sources */, EAF49C7F1A3A4DE000B395DF /* UIImageExtension.swift in Sources */, ); @@ -262,6 +266,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -280,6 +285,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; diff --git a/Gifu.xcworkspace/contents.xcworkspacedata b/Gifu.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..80747bc --- /dev/null +++ b/Gifu.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Source/AnimatedImage.swift b/Source/AnimatedImage.swift index 756c468..1afae05 100755 --- a/Source/AnimatedImage.swift +++ b/Source/AnimatedImage.swift @@ -1,5 +1,6 @@ import UIKit import ImageIO +import Runes public class AnimatedImage: UIImage { // MARK: - Constants diff --git a/Source/Curry.swift b/Source/Curry.swift new file mode 100644 index 0000000..b51c761 --- /dev/null +++ b/Source/Curry.swift @@ -0,0 +1,3 @@ +func curry(f: (A, B) -> C) -> A -> B -> C { + return { a in { b in f(a, b) } } +} diff --git a/Source/Functional.swift b/Source/Functional.swift deleted file mode 100644 index 10a420d..0000000 --- a/Source/Functional.swift +++ /dev/null @@ -1,28 +0,0 @@ -infix operator >>- { associativity left precedence 150 } -infix operator <^> { associativity left precedence 150 } -infix operator <*> { associativity left precedence 150 } - -func >>-(a: A?, f: A -> B?) -> B? { - switch a { - case let .Some(x): return f(x) - case .None: return .None - } -} - -func <^>(f: A -> B, a: A?) -> B? { - switch a { - case let .Some(x): return f(x) - case .None: return .None - } -} - -func <*>(f: (A -> B)?, a: A?) -> B? { - switch f { - case let .Some(fx): return fx <^> a - case .None: return .None - } -} - -func curry(f: (A, B) -> C) -> A -> B -> C { - return { a in { b in f(a, b) } } -} diff --git a/Source/ImageSourceHelpers.swift b/Source/ImageSourceHelpers.swift index e64680c..38823ee 100755 --- a/Source/ImageSourceHelpers.swift +++ b/Source/ImageSourceHelpers.swift @@ -1,6 +1,7 @@ import UIKit import ImageIO import MobileCoreServices +import Runes internal typealias GIFProperties = [String : Double] private let defaultDuration: Double = 0