Browse files

Updated to version 1.2.3

  • Loading branch information...
1 parent b67c045 commit 259e9feff093a5b62c260a183175a9dad25b57ec @nicklockwood committed Aug 25, 2012
View
307 Examples/ARC Example/FXImageViewDemo.xcodeproj/project.pbxproj
@@ -0,0 +1,307 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 01E993FE159BCA9C0059DD43 /* IMG_0150.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 01E993FD159BCA9C0059DD43 /* IMG_0150.jpg */; };
+ 01E99409159BD4B30059DD43 /* FXImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 01E99406159BD4B30059DD43 /* FXImageView.m */; };
+ 01E9940A159BD4B30059DD43 /* UIImage+FX.m in Sources */ = {isa = PBXBuildFile; fileRef = 01E99408159BD4B30059DD43 /* UIImage+FX.m */; };
+ 01FA10C2145E9951001906CB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01FA10C1145E9951001906CB /* UIKit.framework */; };
+ 01FA10C4145E9951001906CB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01FA10C3145E9951001906CB /* Foundation.framework */; };
+ 01FA10C6145E9951001906CB /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01FA10C5145E9951001906CB /* CoreGraphics.framework */; };
+ 01FA10CC145E9951001906CB /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 01FA10CA145E9951001906CB /* InfoPlist.strings */; };
+ 01FA10CE145E9951001906CB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 01FA10CD145E9951001906CB /* main.m */; };
+ 01FA10D2145E9951001906CB /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 01FA10D1145E9951001906CB /* AppDelegate.m */; };
+ 01FA10D5145E9951001906CB /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 01FA10D4145E9951001906CB /* ViewController.m */; };
+ 01FA10D8145E9951001906CB /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 01FA10D6145E9951001906CB /* ViewController.xib */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 01E993FD159BCA9C0059DD43 /* IMG_0150.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = IMG_0150.jpg; sourceTree = "<group>"; };
+ 01E99405159BD4B30059DD43 /* FXImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FXImageView.h; sourceTree = "<group>"; };
+ 01E99406159BD4B30059DD43 /* FXImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FXImageView.m; sourceTree = "<group>"; };
+ 01E99407159BD4B30059DD43 /* UIImage+FX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+FX.h"; sourceTree = "<group>"; };
+ 01E99408159BD4B30059DD43 /* UIImage+FX.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+FX.m"; sourceTree = "<group>"; };
+ 01FA10BD145E9951001906CB /* FXImageViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FXImageViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 01FA10C1145E9951001906CB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 01FA10C3145E9951001906CB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 01FA10C5145E9951001906CB /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 01FA10C9145E9951001906CB /* FXImageViewDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FXImageViewDemo-Info.plist"; sourceTree = "<group>"; };
+ 01FA10CB145E9951001906CB /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 01FA10CD145E9951001906CB /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 01FA10CF145E9951001906CB /* FXImageViewDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FXImageViewDemo-Prefix.pch"; sourceTree = "<group>"; };
+ 01FA10D0145E9951001906CB /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 01FA10D1145E9951001906CB /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ 01FA10D3145E9951001906CB /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
+ 01FA10D4145E9951001906CB /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+ 01FA10D7145E9951001906CB /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 01FA10BA145E9951001906CB /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 01FA10C2145E9951001906CB /* UIKit.framework in Frameworks */,
+ 01FA10C4145E9951001906CB /* Foundation.framework in Frameworks */,
+ 01FA10C6145E9951001906CB /* CoreGraphics.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 01E99404159BD4B30059DD43 /* FXImageView */ = {
+ isa = PBXGroup;
+ children = (
+ 01E99407159BD4B30059DD43 /* UIImage+FX.h */,
+ 01E99408159BD4B30059DD43 /* UIImage+FX.m */,
+ 01E99405159BD4B30059DD43 /* FXImageView.h */,
+ 01E99406159BD4B30059DD43 /* FXImageView.m */,
+ );
+ name = FXImageView;
+ path = ../../FXImageView;
+ sourceTree = "<group>";
+ };
+ 01FA10B2145E994F001906CB = {
+ isa = PBXGroup;
+ children = (
+ 01E99404159BD4B30059DD43 /* FXImageView */,
+ 01FA10C7145E9951001906CB /* FXImageViewDemo */,
+ 01FA10C0145E9951001906CB /* Frameworks */,
+ 01FA10BE145E9951001906CB /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 01FA10BE145E9951001906CB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 01FA10BD145E9951001906CB /* FXImageViewDemo.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 01FA10C0145E9951001906CB /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 01FA10C1145E9951001906CB /* UIKit.framework */,
+ 01FA10C3145E9951001906CB /* Foundation.framework */,
+ 01FA10C5145E9951001906CB /* CoreGraphics.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 01FA10C7145E9951001906CB /* FXImageViewDemo */ = {
+ isa = PBXGroup;
+ children = (
+ 01FA10D0145E9951001906CB /* AppDelegate.h */,
+ 01FA10D1145E9951001906CB /* AppDelegate.m */,
+ 01FA10D3145E9951001906CB /* ViewController.h */,
+ 01FA10D4145E9951001906CB /* ViewController.m */,
+ 01FA10D6145E9951001906CB /* ViewController.xib */,
+ 01FA10C8145E9951001906CB /* Supporting Files */,
+ );
+ path = FXImageViewDemo;
+ sourceTree = "<group>";
+ };
+ 01FA10C8145E9951001906CB /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 01E993FD159BCA9C0059DD43 /* IMG_0150.jpg */,
+ 01FA10C9145E9951001906CB /* FXImageViewDemo-Info.plist */,
+ 01FA10CA145E9951001906CB /* InfoPlist.strings */,
+ 01FA10CD145E9951001906CB /* main.m */,
+ 01FA10CF145E9951001906CB /* FXImageViewDemo-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 01FA10BC145E9951001906CB /* FXImageViewDemo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 01FA10DB145E9951001906CB /* Build configuration list for PBXNativeTarget "FXImageViewDemo" */;
+ buildPhases = (
+ 01FA10B9145E9951001906CB /* Sources */,
+ 01FA10BA145E9951001906CB /* Frameworks */,
+ 01FA10BB145E9951001906CB /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = FXImageViewDemo;
+ productName = ImageFXViewDemo;
+ productReference = 01FA10BD145E9951001906CB /* FXImageViewDemo.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 01FA10B4145E994F001906CB /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0450;
+ };
+ buildConfigurationList = 01FA10B7145E994F001906CB /* Build configuration list for PBXProject "FXImageViewDemo" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 01FA10B2145E994F001906CB;
+ productRefGroup = 01FA10BE145E9951001906CB /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 01FA10BC145E9951001906CB /* FXImageViewDemo */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 01FA10BB145E9951001906CB /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 01FA10CC145E9951001906CB /* InfoPlist.strings in Resources */,
+ 01FA10D8145E9951001906CB /* ViewController.xib in Resources */,
+ 01E993FE159BCA9C0059DD43 /* IMG_0150.jpg in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 01FA10B9145E9951001906CB /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 01FA10CE145E9951001906CB /* main.m in Sources */,
+ 01FA10D2145E9951001906CB /* AppDelegate.m in Sources */,
+ 01FA10D5145E9951001906CB /* ViewController.m in Sources */,
+ 01E99409159BD4B30059DD43 /* FXImageView.m in Sources */,
+ 01E9940A159BD4B30059DD43 /* UIImage+FX.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 01FA10CA145E9951001906CB /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 01FA10CB145E9951001906CB /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ 01FA10D6145E9951001906CB /* ViewController.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 01FA10D7145E9951001906CB /* en */,
+ );
+ name = ViewController.xib;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 01FA10D9145E9951001906CB /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ 01FA10DA145E9951001906CB /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 01FA10DC145E9951001906CB /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "FXImageViewDemo/FXImageViewDemo-Prefix.pch";
+ INFOPLIST_FILE = "FXImageViewDemo/FXImageViewDemo-Info.plist";
+ PRODUCT_NAME = FXImageViewDemo;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ 01FA10DD145E9951001906CB /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "FXImageViewDemo/FXImageViewDemo-Prefix.pch";
+ INFOPLIST_FILE = "FXImageViewDemo/FXImageViewDemo-Info.plist";
+ PRODUCT_NAME = FXImageViewDemo;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 01FA10B7145E994F001906CB /* Build configuration list for PBXProject "FXImageViewDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 01FA10D9145E9951001906CB /* Debug */,
+ 01FA10DA145E9951001906CB /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 01FA10DB145E9951001906CB /* Build configuration list for PBXNativeTarget "FXImageViewDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 01FA10DC145E9951001906CB /* Debug */,
+ 01FA10DD145E9951001906CB /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 01FA10B4145E994F001906CB /* Project object */;
+}
View
18 Examples/ARC Example/FXImageViewDemo/AppDelegate.h
@@ -0,0 +1,18 @@
+//
+// AppDelegate.h
+// ImageFXViewDemo
+//
+// Created by Nick Lockwood on 31/10/2011.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class ViewController;
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+@property (strong, nonatomic) ViewController *viewController;
+
+@end
View
68 Examples/ARC Example/FXImageViewDemo/AppDelegate.m
@@ -0,0 +1,68 @@
+//
+// AppDelegate.m
+// ImageFXViewDemo
+//
+// Created by Nick Lockwood on 31/10/2011.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+#import "ViewController.h"
+
+@implementation AppDelegate
+
+@synthesize window = _window;
+@synthesize viewController = _viewController;
+
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ // Override point for customization after application launch.
+ self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
+ self.window.rootViewController = self.viewController;
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ /*
+ Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+ */
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ /*
+ Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+ */
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ /*
+ Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+ */
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ /*
+ Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+ */
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ /*
+ Called when the application is about to terminate.
+ Save data if appropriate.
+ See also applicationDidEnterBackground:.
+ */
+}
+
+@end
View
40 Examples/ARC Example/FXImageViewDemo/FXImageViewDemo-Info.plist
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFiles</key>
+ <array/>
+ <key>CFBundleIdentifier</key>
+ <string>com.charcoaldesign.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
View
14 Examples/ARC Example/FXImageViewDemo/FXImageViewDemo-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'ImageFXViewDemo' target in the 'ImageFXViewDemo' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_4_0
+#warning "This project uses features only available in iOS SDK 4.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
View
BIN Examples/ARC Example/FXImageViewDemo/IMG_0150.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
16 Examples/ARC Example/FXImageViewDemo/ViewController.h
@@ -0,0 +1,16 @@
+//
+// ViewController.h
+// ImageFXViewDemo
+//
+// Created by Nick Lockwood on 31/10/2011.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "FXImageView.h"
+
+@interface ViewController : UIViewController
+
+@property (nonatomic, strong) IBOutlet FXImageView *imageView;
+
+@end
View
34 Examples/ARC Example/FXImageViewDemo/ViewController.m
@@ -0,0 +1,34 @@
+//
+// ViewController.m
+// ImageFXViewDemo
+//
+// Created by Nick Lockwood on 31/10/2011.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "ViewController.h"
+
+@implementation ViewController
+
+@synthesize imageView = _imageView;
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ _imageView.reflectionScale = 0.5f;
+ _imageView.reflectionAlpha = 0.25f;
+ _imageView.reflectionGap = 10.0f;
+ _imageView.shadowOffset = CGSizeMake(0.0f, 2.0f);
+ _imageView.shadowBlur = 5.0f;
+ _imageView.cornerRadius = 10.0f;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ // Return YES for supported orientations
+ return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
+}
+
+
+@end
View
2 Examples/ARC Example/FXImageViewDemo/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
183 Examples/ARC Example/FXImageViewDemo/en.lproj/ViewController.xib
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1296</int>
+ <string key="IBDocument.SystemVersion">11E53</string>
+ <string key="IBDocument.InterfaceBuilderVersion">2182</string>
+ <string key="IBDocument.AppKitVersion">1138.47</string>
+ <string key="IBDocument.HIToolboxVersion">569.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">1181</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>IBProxyObject</string>
+ <string>IBUIView</string>
+ <string>IBUIImageView</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="843779117">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="774585933">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="IBUIImageView" id="136534547">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">319</int>
+ <string key="NSFrame">{{48, 91}, {224, 178}}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <int key="IBUIContentMode">1</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSCustomResource" key="IBUIImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">IMG_0150.jpg</string>
+ </object>
+ </object>
+ </array>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="136534547"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC43NQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="774585933"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">imageView</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="136534547"/>
+ </object>
+ <int key="connectionID">9</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="843779117"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="774585933"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="136534547"/>
+ </array>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="136534547"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.CustomClassName">ViewController</string>
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="-2.CustomClassName">UIResponder</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="8.CustomClassName">FXImageView</string>
+ <string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">9</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">FXImageView</string>
+ <string key="superclassName">UIImageView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/FXImageView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">ViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">imageView</string>
+ <string key="NS.object.0">FXImageView</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">imageView</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">imageView</string>
+ <string key="candidateClassName">FXImageView</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/ViewController.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
+ <real value="1296" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+ <string key="NS.key.0">IMG_0150.jpg</string>
+ <string key="NS.object.0">{512, 384}</string>
+ </object>
+ <string key="IBCocoaTouchPluginVersion">1181</string>
+ </data>
+</archive>
View
18 Examples/ARC Example/FXImageViewDemo/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// ImageFXViewDemo
+//
+// Created by Nick Lockwood on 31/10/2011.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
View
1 Examples/Advanced Example/FXImageViewDemo/ViewController.m
@@ -58,6 +58,7 @@ - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index
imageView.shadowOffset = CGSizeMake(0.0f, 2.0f);
imageView.shadowBlur = 5.0f;
imageView.cornerRadius = 10.0f;
+
view = imageView;
}
View
2 Examples/KVO Example/FXImageViewDemo/ViewController.m
@@ -50,7 +50,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
- (IBAction)update
{
//reset display
- //_imageView.image = nil;
+ _imageView.image = nil;
_successLabel.text = nil;
[_activityView startAnimating];
_button.enabled = NO;
View
4 FXImageView/FXImageView.h 100644 → 100755
@@ -1,7 +1,7 @@
//
// FXImageView.h
//
-// Version 1.2.2
+// Version 1.2.3
//
// Created by Nick Lockwood on 31/10/2011.
// Copyright (c) 2011 Charcoal Design
@@ -49,7 +49,7 @@
@property (nonatomic, strong) UIImage *processedImage;
@property (nonatomic, copy) UIImage *(^customEffectsBlock)(UIImage *image);
-@property (nonatomic, copy) NSString *customEffectsIdentifier;
+@property (nonatomic, copy) NSString *cacheKey;
- (void)setImageWithContentsOfFile:(NSString *)file;
- (void)setImageWithContentsOfURL:(NSURL *)URL;
View
72 FXImageView/FXImageView.m 100644 → 100755
@@ -1,7 +1,7 @@
//
// FXImageView.m
//
-// Version 1.2.2
+// Version 1.2.3
//
// Created by Nick Lockwood on 31/10/2011.
// Copyright (c) 2011 Charcoal Design
@@ -88,9 +88,8 @@ @implementation FXImageView
@synthesize shadowOffset = _shadowOffset;
@synthesize shadowBlur = _shadowBlur;
@synthesize cornerRadius = _cornerRadius;
-
@synthesize customEffectsBlock = _customEffectsBlock;
-@synthesize customEffectsIdentifier = _customEffectsIdentifier;
+@synthesize cacheKey = _cacheKey;
@synthesize originalImage = _originalImage;
@synthesize imageView = _imageView;
@@ -176,7 +175,7 @@ - (id)initWithCoder:(NSCoder *)aDecoder
- (void)dealloc
{
[_customEffectsBlock release];
- [_customEffectsIdentifier release];
+ [_cacheKey release];
[_originalImage release];
[_shadowColor release];
[_imageView release];
@@ -190,7 +189,7 @@ - (void)dealloc
#pragma mark -
#pragma mark Caching
-- (NSString *)colorString:(UIColor *)color
+- (NSString *)colorHash:(UIColor *)color
{
NSString *colorString = @"{0.00,0.00}";
if (color && ![color isEqual:[UIColor clearColor]])
@@ -207,31 +206,43 @@ - (NSString *)colorString:(UIColor *)color
return colorString;
}
-- (NSString *)cacheKey
+- (NSString *)imageHash:(UIImage *)image
{
- NSString *key = [NSString stringWithFormat:@"%@_%@_%.2f_%.2f_%.2f_%@_%@_%.2f_%.2f_%i",
- _imageContentURL ?: _originalImage,
- NSStringFromCGSize(self.bounds.size),
- _reflectionGap,
- _reflectionScale,
- _reflectionAlpha,
- [self colorString:_shadowColor],
- NSStringFromCGSize(_shadowOffset),
- _shadowBlur,
- _cornerRadius,
- self.contentMode];
-
- if (_customEffectsBlock)
+ static NSInteger hashKey = 1;
+ NSString *number = objc_getAssociatedObject(image, @"FXImageHash");
+ if (!number && image)
{
- key = [key stringByAppendingFormat:@"_%@", _customEffectsIdentifier];
+ number = [NSString stringWithFormat:@"%i", hashKey++];
+ objc_setAssociatedObject(image, @"FXImageHash", number, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- return key;
+ return number;
+}
+
+- (NSString *)cacheKey
+{
+ if (_cacheKey) return _cacheKey;
+
+ return [NSString stringWithFormat:@"%@_%@_%.2f_%.2f_%.2f_%@_%@_%.2f_%.2f_%i",
+ _imageContentURL ?: [self imageHash:_originalImage],
+ NSStringFromCGSize(self.bounds.size),
+ _reflectionGap,
+ _reflectionScale,
+ _reflectionAlpha,
+ [self colorHash:_shadowColor],
+ NSStringFromCGSize(_shadowOffset),
+ _shadowBlur,
+ _cornerRadius,
+ self.contentMode];
+}
+
+- (void)cacheProcessedImage:(UIImage *)processedImage forKey:(NSString *)cacheKey
+{
+ [[[self class] processedImageCache] setObject:processedImage forKey:cacheKey];
}
- (UIImage *)cachedProcessedImage
{
- NSString *key = [self cacheKey];
- return [[[self class] processedImageCache] objectForKey:key];
+ return [[[self class] processedImageCache] objectForKey:[self cacheKey]];
}
#pragma mark -
@@ -247,7 +258,7 @@ - (void)setProcessedImageOnMainThread:(NSArray *)array
if (processedImage)
{
//cache image
- [[[self class] processedImageCache] setObject:processedImage forKey:cacheKey];
+ [self cacheProcessedImage:processedImage forKey:cacheKey];
}
//set image
@@ -284,7 +295,10 @@ - (void)processImage
#if !__has_feature(objc_arc)
- [_customEffectsBlock autorelease];
+ [[image retain] autorelease];
+ [[imageURL retain] autorelease];
+ [[shadowColor retain] autorelease];
+ [customEffectsBlock autorelease];
#endif
@@ -358,7 +372,7 @@ - (void)processImage
{
if (processedImage)
{
- [[[self class] processedImageCache] setObject:processedImage forKey:cacheKey];
+ [self cacheProcessedImage:processedImage forKey:cacheKey];
}
[self willChangeValueForKey:@"processedImage"];
_imageView.image = processedImage;
@@ -586,11 +600,11 @@ - (void)setCustomEffectsBlock:(UIImage *(^)(UIImage *))customEffectsBlock
}
}
-- (void)setCustomEffectsIdentifier:(NSString *)customEffectsIdentifier
+- (void)setCacheKey:(NSString *)cacheKey
{
- if (![customEffectsIdentifier isEqual:_customEffectsIdentifier])
+ if (![cacheKey isEqual:_cacheKey])
{
- _customEffectsIdentifier = [customEffectsIdentifier copy];
+ _cacheKey = [cacheKey copy];
[self setNeedsLayout];
}
}
View
2 FXImageView/UIImage+FX.h 100644 → 100755
@@ -1,7 +1,7 @@
//
// UIImage+FX.h
//
-// Version 1.2.2
+// Version 1.2.3
//
// Created by Nick Lockwood on 31/10/2011.
// Copyright (c) 2011 Charcoal Design
View
6 FXImageView/UIImage+FX.m 100644 → 100755
@@ -1,7 +1,7 @@
//
// UIImage+FX.m
//
-// Version 1.2.2
+// Version 1.2.3
//
// Created by Nick Lockwood on 31/10/2011.
// Copyright (c) 2011 Charcoal Design
@@ -396,7 +396,7 @@ - (UIImage *)maskImageFromImageAlpha
//create alpha image
NSInteger bytesPerRow = ((width + 3) / 4) * 4;
- unsigned char *data = calloc(bytesPerRow * height, sizeof(unsigned char *));
+ void *data = calloc(bytesPerRow * height, sizeof(unsigned char *));
CGContextRef context = CGBitmapContextCreate(data, width, height, 8, bytesPerRow, NULL, kCGImageAlphaOnly);
CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, width, height), self.CGImage);
@@ -406,7 +406,7 @@ - (UIImage *)maskImageFromImageAlpha
for (int x = 0; x < width; x++)
{
NSInteger index = y * bytesPerRow + x;
- data[index] = 255 - data[index];
+ ((unsigned char *)data)[index] = 255 - ((unsigned char *)data)[index];
}
}
View
2 LICENCE.md
@@ -1,6 +1,6 @@
FXImageView
-Version 1.2.2, August 23rd, 2012
+Version 1.2.3, August 25th, 2012
Copyright (C) 2011 Charcoal Design
View
10 README.md 100644 → 100755
@@ -9,9 +9,9 @@ As a bonus, FXImageView includes a standalone UIImage category for cropping, sca
Supported iOS & SDK Versions
-----------------------------
-* Supported build target - iOS 5.1 / Mac OS 10.7 (Xcode 4.3, Apple LLVM compiler 3.1)
-* Earliest supported deployment target - iOS 4.3 / Mac OS 10.6
-* Earliest compatible deployment target - iOS 4.0 / Mac OS 10.6
+* Supported build target - iOS 5.1 (Xcode 4.4, Apple LLVM compiler 4.0)
+* Earliest supported deployment target - iOS 4.3
+* Earliest compatible deployment target - iOS 4.0
NOTE: 'Supported' means that the library has been tested with this version. 'Compatible' means that the library should work on this iOS version (i.e. it doesn't rely on any unavailable SDK features) but is no longer being tested for compatibility and may require tweaking or bug fixes to run correctly.
@@ -157,6 +157,6 @@ The resultant image after applying reflection and shadow effects. It can sometim
If you want to apply a custom effect to your image, you can do your custom drawing using the `customEffectsBlock` property. The block is passed the correctly cropped and scaled image, and you code should return a new version with your custom effects applied. Your custom drawing block is applied prior to any other effects (apart from cropping and scaling). FXImageView's caching mechanism doesn't know about your custom effects, so if your app uses multiple effects blocks, or your block relies on any external data, you should update the `customEffectsIdentifier` property so that the FXImageView cache can handle it correctly. Note that you should ensure that your block code is thread-safe if used in asynchronous mode.
- @property (nonatomic, copy) NSDictionary *customEffectsIdentifier;
+ @property (nonatomic, copy) NSString *cacheKey;
-If you are using the `customEffectsBlock` property, FXImageView's caching mechanism doesn't know about your custom effects and doesn't know if they need to change, so if your block relies on any external data you should update the `customEffectsIdentifier` property so that the FXImageView cache can handle it correctly. The customEffectsIdentifier is just a string used to generate a cache key, so it doesn't matter what you put in it as long as it uniquely distinguishes the effects you are applying to this image from any other.
+FXImageView caches processed images based on the image object or URL that you specify, combined with the specific set of effects you've selected. This mechanism works effectively in most cases, but for image objects that are generated on the fly, or ones that are loaded from the ALAssets library, you don't get any benefit from the caching because the same image objects are never used twice. In these cases you can improve performance by using a custom cache key. The key can be any string, the only requirement is that is should be unique for each unique image & effects combination that you use with FXImageView. If you are displaying your images in a carousel, a string based on the carousel item index would be a good choice for the cache key. Set the cacheKey property to nil to revert to the default cache key calculation.
View
6 RELEASE NOTES.md
@@ -1,3 +1,9 @@
+Version 1.2.3
+
+- Fixed potential crash when using custom effects block
+- Replaced customEffectsIdentifier property with more generally useful cacheKey
+- Fixed a compiler warning in UIImage+FX category
+
Version 1.2.2
- Fixed some additional caching bugs

0 comments on commit 259e9fe

Please sign in to comment.