From 026e8876ec3c4354f66090a55d6238fd338fac69 Mon Sep 17 00:00:00 2001 From: Reda Lemeden Date: Mon, 8 Dec 2014 23:11:24 +0100 Subject: [PATCH] Import framework in demo --- Demo/demo/classes/ViewController.swift | 2 +- Demo/gifu-demo.xcodeproj/project.pbxproj | 75 ++++++++++++++++++++++-- gifu.xcodeproj/project.pbxproj | 4 ++ gifu/Gifu.h | 4 ++ gifu/Gifu.swift | 8 +-- gifu/UIImageView+Gifu.swift | 2 +- 6 files changed, 83 insertions(+), 12 deletions(-) create mode 100644 gifu/Gifu.h diff --git a/Demo/demo/classes/ViewController.swift b/Demo/demo/classes/ViewController.swift index 7199c8e..b1dfd4e 100755 --- a/Demo/demo/classes/ViewController.swift +++ b/Demo/demo/classes/ViewController.swift @@ -1,5 +1,5 @@ import UIKit -import gifu +import Gifu class ViewController: UIViewController { diff --git a/Demo/gifu-demo.xcodeproj/project.pbxproj b/Demo/gifu-demo.xcodeproj/project.pbxproj index fde5e67..21f47da 100755 --- a/Demo/gifu-demo.xcodeproj/project.pbxproj +++ b/Demo/gifu-demo.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ 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, ); }; }; 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 */; }; @@ -15,6 +17,23 @@ 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; @@ -22,6 +41,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + 00B8C8391A36583600C188E7 /* Gifu.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -29,6 +49,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 00B8C8321A36583000C188E7 /* Gifu.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Gifu.xcodeproj; path = ../../Gifu.xcodeproj; 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; }; @@ -44,17 +65,36 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 00B8C8381A36583600C188E7 /* 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 /* gifu-demo */, + 9D98823919BC69CA00B790C6 /* Source */, 9D98823819BC69CA00B790C6 /* Products */, + 00B8C7621A364E8C00C188E7 /* Frameworks */, ); sourceTree = ""; }; @@ -66,7 +106,7 @@ name = Products; sourceTree = ""; }; - 9D98823919BC69CA00B790C6 /* gifu-demo */ = { + 9D98823919BC69CA00B790C6 /* Source */ = { isa = PBXGroup; children = ( 9D98823C19BC69CA00B790C6 /* AppDelegate.swift */, @@ -76,7 +116,7 @@ 9D98824319BC69CA00B790C6 /* Images.xcassets */, 9D98823A19BC69CA00B790C6 /* Supporting Files */, ); - name = "gifu-demo"; + name = Source; path = demo; sourceTree = ""; }; @@ -104,6 +144,7 @@ buildRules = ( ); dependencies = ( + 00B8C83B1A36583600C188E7 /* PBXTargetDependency */, ); name = "gifu-demo"; productName = "gifu-demo"; @@ -135,6 +176,12 @@ mainGroup = 9D98822E19BC69CA00B790C6; productRefGroup = 9D98823819BC69CA00B790C6 /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 00B8C8331A36583000C188E7 /* Products */; + ProjectRef = 00B8C8321A36583000C188E7 /* Gifu.xcodeproj */; + }, + ); projectRoot = ""; targets = ( 9D98823619BC69CA00B790C6 /* gifu-demo */, @@ -142,6 +189,16 @@ }; /* 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; @@ -168,6 +225,14 @@ }; /* 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; @@ -253,7 +318,7 @@ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; INFOPLIST_FILE = demo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -266,7 +331,7 @@ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; INFOPLIST_FILE = demo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; diff --git a/gifu.xcodeproj/project.pbxproj b/gifu.xcodeproj/project.pbxproj index fbffe93..05e366a 100644 --- a/gifu.xcodeproj/project.pbxproj +++ b/gifu.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 00B8C75E1A364DCE00C188E7 /* Gifu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B8C75B1A364DCE00C188E7 /* Gifu.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, ); }; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -18,6 +19,7 @@ 00B8C75B1A364DCE00C188E7 /* Gifu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Gifu.swift; sourceTree = ""; }; 00B8C75C1A364DCE00C188E7 /* ImageSourceHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageSourceHelpers.swift; sourceTree = ""; }; 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -67,6 +69,7 @@ 00B8C75A1A364DBE00C188E7 /* Source */ = { isa = PBXGroup; children = ( + 00B8C7951A3650EE00C188E7 /* Gifu.h */, 00B8C75B1A364DCE00C188E7 /* Gifu.swift */, 00B8C75C1A364DCE00C188E7 /* ImageSourceHelpers.swift */, 00B8C75D1A364DCE00C188E7 /* UIImageView+Gifu.swift */, @@ -81,6 +84,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + 00B8C7961A3650EE00C188E7 /* Gifu.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/gifu/Gifu.h b/gifu/Gifu.h new file mode 100644 index 0000000..a0c3a63 --- /dev/null +++ b/gifu/Gifu.h @@ -0,0 +1,4 @@ +#import + +FOUNDATION_EXPORT double GifuVersionNumber; +FOUNDATION_EXPORT const unsigned char GifuVersionString[]; diff --git a/gifu/Gifu.swift b/gifu/Gifu.swift index f343dd0..4c76ba1 100755 --- a/gifu/Gifu.swift +++ b/gifu/Gifu.swift @@ -1,9 +1,7 @@ -// Gifu 0.6.1 - import UIKit import ImageIO -class AnimatedImage: UIImage { +public class AnimatedImage: UIImage { // MARK: - Constants let framesToPreload = 10 let maxTimeStep = 1.0 @@ -31,11 +29,11 @@ class AnimatedImage: UIImage { } // MARK: - Initializers - required init(coder aDecoder: NSCoder) { + required public init(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } - required init(data: NSData, delegate: UIImageView?) { + required public init(data: NSData, delegate: UIImageView?) { let imageSource = CGImageSourceCreateWithData(data, nil) self.delegate = delegate diff --git a/gifu/UIImageView+Gifu.swift b/gifu/UIImageView+Gifu.swift index 6cae739..6db3ccb 100755 --- a/gifu/UIImageView+Gifu.swift +++ b/gifu/UIImageView+Gifu.swift @@ -1,6 +1,6 @@ import UIKit -extension UIImageView { +public extension UIImageView { // MARK: - Computed Properties var animatableImage: AnimatedImage? { if image is AnimatedImage {