Import framework in demo

This commit is contained in:
Reda Lemeden 2014-12-08 23:11:24 +01:00
parent ecc7a62251
commit 026e8876ec
6 changed files with 83 additions and 12 deletions

View File

@ -1,5 +1,5 @@
import UIKit
import gifu
import Gifu
class ViewController: UIViewController {

View File

@ -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 = "<group>"; };
9D25870519BCCB0F00A55A18 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9D25870619BCCB0F00A55A18 /* mugen.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = mugen.gif; sourceTree = "<group>"; };
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 = "<group>";
};
00B8C8331A36583000C188E7 /* Products */ = {
isa = PBXGroup;
children = (
00B8C8371A36583000C188E7 /* Gifu.framework */,
);
name = Products;
sourceTree = "<group>";
};
9D98822E19BC69CA00B790C6 = {
isa = PBXGroup;
children = (
9D98823919BC69CA00B790C6 /* gifu-demo */,
9D98823919BC69CA00B790C6 /* Source */,
9D98823819BC69CA00B790C6 /* Products */,
00B8C7621A364E8C00C188E7 /* Frameworks */,
);
sourceTree = "<group>";
};
@ -66,7 +106,7 @@
name = Products;
sourceTree = "<group>";
};
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 = "<group>";
};
@ -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)";
};

View File

@ -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 = "<group>"; };
00B8C75C1A364DCE00C188E7 /* ImageSourceHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageSourceHelpers.swift; sourceTree = "<group>"; };
00B8C75D1A364DCE00C188E7 /* UIImageView+Gifu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImageView+Gifu.swift"; sourceTree = "<group>"; };
00B8C7951A3650EE00C188E7 /* Gifu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Gifu.h; sourceTree = "<group>"; };
/* 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;
};

4
gifu/Gifu.h Normal file
View File

@ -0,0 +1,4 @@
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double GifuVersionNumber;
FOUNDATION_EXPORT const unsigned char GifuVersionString[];

View File

@ -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

View File

@ -1,6 +1,6 @@
import UIKit
extension UIImageView {
public extension UIImageView {
// MARK: - Computed Properties
var animatableImage: AnimatedImage? {
if image is AnimatedImage {