Skip to content
Browse files

Cleanup and removal of some confusing bits

- Simple demo added for quick grab of core functionality
- Removal of dependency on EDStorage, a simple singleton using NSOperationQueue is used instead that can be easily modified
  • Loading branch information...
1 parent a7e5fb5 commit 789bae62f758b70a3c5712b715a92c62b369c5a6 @Dillion committed
Showing with 821 additions and 602 deletions.
  1. BIN EssentialImagerDemo/Default-568h@2x.png
  2. +191 −63 EssentialImagerDemo/EssentialImagerDemo.xcodeproj/project.pbxproj
  3. BIN ...mo.xcodeproj/project.xcworkspace/xcuserdata/dilliontan.xcuserdatad/UserInterfaceState.xcuserstate
  4. +10 −0 ...Demo.xcodeproj/project.xcworkspace/xcuserdata/dilliontan.xcuserdatad/WorkspaceSettings.xcsettings
  5. +5 −0 ...EssentialImagerDemo.xcodeproj/xcuserdata/dilliontan.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  6. +86 −0 ...Demo/EssentialImagerDemo.xcodeproj/xcuserdata/dilliontan.xcuserdatad/xcschemes/Full Demo.xcscheme
  7. +9 −8 ...xcuserdata/dilliontan.xcuserdatad/xcschemes/{EssentialImagerDemo.xcscheme → Simple Demo.xcscheme}
  8. +11 −1 ...ssentialImagerDemo.xcodeproj/xcuserdata/dilliontan.xcuserdatad/xcschemes/xcschememanagement.plist
  9. +0 −11 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/EDStorage.h
  10. +0 −70 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/EDStorageManager.h
  11. +0 −175 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/EDStorageManager.m
  12. +0 −23 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/EDStorageOperation.h
  13. +0 −62 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/EDStorageOperation.m
  14. +0 −94 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/NSData+Storage.m
  15. +20 −0 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EIOperationManager.h
  16. +73 −0 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EIOperationManager.m
  17. +2 −1 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EssentialImager.h
  18. +8 −6 ...alImagerDemo/EssentialImagerDemo/EssentialImager/{EDStorage/UIImage+Storage.h → NSData+Storage.h}
  19. +31 −16 ...ialImagerDemo/EssentialImagerDemo/EssentialImager/{EDStorage/NSData+Storage.h → NSData+Storage.m}
  20. +19 −13 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/UIImage+Resize.m
  21. +3 −3 ...gerDemo/EssentialImagerDemo/{EssentialImagerDemo-Info.plist → EssentialImagerFullDemo-Info.plist}
  22. +42 −0 EssentialImagerDemo/EssentialImagerDemo/EssentialImagerSimpleDemo-Info.plist
  23. +1 −1 ...ialImagerDemo/EssentialImagerDemo/{EIDemoViewController.h → Full Demo/EIFullDemoViewController.h}
  24. +18 −22 ...ialImagerDemo/EssentialImagerDemo/{EIDemoViewController.m → Full Demo/EIFullDemoViewController.m}
  25. +3 −3 EssentialImagerDemo/EssentialImagerDemo/{AppDelegate.h → Full Demo/FullDemoAppDelegate.h}
  26. +3 −5 EssentialImagerDemo/EssentialImagerDemo/{AppDelegate.m → Full Demo/FullDemoAppDelegate.m}
  27. +2 −3 EssentialImagerDemo/EssentialImagerDemo/{ → Full Demo}/main.m
  28. +12 −22 ...agerDemo/{EssentialImager/EDStorage/UIImage+Storage.m → Simple Demo/EISimpleDemoViewController.h}
  29. +183 −0 EssentialImagerDemo/EssentialImagerDemo/Simple Demo/EISimpleDemoViewController.m
  30. +17 −0 EssentialImagerDemo/EssentialImagerDemo/Simple Demo/SimpleDemoAppDelegate.h
  31. +55 −0 EssentialImagerDemo/EssentialImagerDemo/Simple Demo/SimpleDemoAppDelegate.m
  32. +17 −0 EssentialImagerDemo/EssentialImagerDemo/Simple Demo/main.m
View
BIN EssentialImagerDemo/Default-568h@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
254 EssentialImagerDemo/EssentialImagerDemo.xcodeproj/project.pbxproj
@@ -7,48 +7,71 @@
objects = {
/* Begin PBXBuildFile section */
+ 4D19929E171D01AC009F6E18 /* EIOperationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D19929B171D01AC009F6E18 /* EIOperationManager.m */; };
+ 4D19929F171D01AC009F6E18 /* NSData+Storage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D19929D171D01AC009F6E18 /* NSData+Storage.m */; };
+ 4D1992A1171D094D009F6E18 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D1992A0171D094D009F6E18 /* Default-568h@2x.png */; };
+ 4D1992A5171D097B009F6E18 /* EIImagePickerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC6215B0816E007C9A90 /* EIImagePickerDelegate.m */; };
+ 4D1992A6171D097B009F6E18 /* StandardPaths.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC6615B0816E007C9A90 /* StandardPaths.m */; };
+ 4D1992A7171D097B009F6E18 /* UIImage+Resize.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC6815B0816E007C9A90 /* UIImage+Resize.m */; };
+ 4D1992AA171D097B009F6E18 /* EIOperationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D19929B171D01AC009F6E18 /* EIOperationManager.m */; };
+ 4D1992AB171D097B009F6E18 /* NSData+Storage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D19929D171D01AC009F6E18 /* NSData+Storage.m */; };
+ 4D1992AD171D097B009F6E18 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D79EC4E15B08127007C9A90 /* QuartzCore.framework */; };
+ 4D1992AE171D097B009F6E18 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D79EC3715B08111007C9A90 /* UIKit.framework */; };
+ 4D1992AF171D097B009F6E18 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D79EC3915B08111007C9A90 /* Foundation.framework */; };
+ 4D1992B0171D097B009F6E18 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D79EC3B15B08111007C9A90 /* CoreGraphics.framework */; };
+ 4D1992B2171D097B009F6E18 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4D79EC4015B08111007C9A90 /* InfoPlist.strings */; };
+ 4D1992B3171D097B009F6E18 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D79EC5015B08161007C9A90 /* Icon.png */; };
+ 4D1992B4171D097B009F6E18 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D79EC5115B08161007C9A90 /* Icon@2x.png */; };
+ 4D1992B5171D097B009F6E18 /* pattern.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D79EC5215B08161007C9A90 /* pattern.png */; };
+ 4D1992B6171D097B009F6E18 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D1992A0171D094D009F6E18 /* Default-568h@2x.png */; };
+ 4D1992C2171D0B7F009F6E18 /* EIFullDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D1992BE171D0B7F009F6E18 /* EIFullDemoViewController.m */; };
+ 4D1992C3171D0B7F009F6E18 /* FullDemoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D1992C0171D0B7F009F6E18 /* FullDemoAppDelegate.m */; };
+ 4D1992C4171D0B7F009F6E18 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D1992C1171D0B7F009F6E18 /* main.m */; };
+ 4D1992CB171D0B9C009F6E18 /* EISimpleDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D1992C7171D0B9C009F6E18 /* EISimpleDemoViewController.m */; };
+ 4D1992CC171D0B9C009F6E18 /* SimpleDemoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D1992C9171D0B9C009F6E18 /* SimpleDemoAppDelegate.m */; };
+ 4D1992CD171D0B9C009F6E18 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D1992CA171D0B9C009F6E18 /* main.m */; };
4D79EC3815B08111007C9A90 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D79EC3715B08111007C9A90 /* UIKit.framework */; };
4D79EC3A15B08111007C9A90 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D79EC3915B08111007C9A90 /* Foundation.framework */; };
4D79EC3C15B08111007C9A90 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D79EC3B15B08111007C9A90 /* CoreGraphics.framework */; };
4D79EC4215B08111007C9A90 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4D79EC4015B08111007C9A90 /* InfoPlist.strings */; };
- 4D79EC4415B08111007C9A90 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC4315B08111007C9A90 /* main.m */; };
4D79EC4F15B08127007C9A90 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D79EC4E15B08127007C9A90 /* QuartzCore.framework */; };
4D79EC5315B08161007C9A90 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D79EC5015B08161007C9A90 /* Icon.png */; };
4D79EC5415B08161007C9A90 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D79EC5115B08161007C9A90 /* Icon@2x.png */; };
4D79EC5515B08161007C9A90 /* pattern.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D79EC5215B08161007C9A90 /* pattern.png */; };
- 4D79EC6915B0816E007C9A90 /* EDStorageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC5A15B0816E007C9A90 /* EDStorageManager.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 4D79EC6A15B0816E007C9A90 /* EDStorageOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC5C15B0816E007C9A90 /* EDStorageOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 4D79EC6B15B0816E007C9A90 /* NSData+Storage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC5E15B0816E007C9A90 /* NSData+Storage.m */; };
- 4D79EC6C15B0816E007C9A90 /* UIImage+Storage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC6015B0816E007C9A90 /* UIImage+Storage.m */; };
4D79EC6D15B0816E007C9A90 /* EIImagePickerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC6215B0816E007C9A90 /* EIImagePickerDelegate.m */; };
4D79EC6E15B0816E007C9A90 /* StandardPaths.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC6615B0816E007C9A90 /* StandardPaths.m */; };
4D79EC6F15B0816E007C9A90 /* UIImage+Resize.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC6815B0816E007C9A90 /* UIImage+Resize.m */; };
- 4D79EC7415B08187007C9A90 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC7115B08187007C9A90 /* AppDelegate.m */; };
- 4D79EC7515B08187007C9A90 /* EIDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79EC7315B08187007C9A90 /* EIDemoViewController.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
- 4D79EC3315B08111007C9A90 /* EssentialImagerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EssentialImagerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 4D19929A171D01AC009F6E18 /* EIOperationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EIOperationManager.h; sourceTree = "<group>"; };
+ 4D19929B171D01AC009F6E18 /* EIOperationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EIOperationManager.m; sourceTree = "<group>"; };
+ 4D19929C171D01AC009F6E18 /* NSData+Storage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Storage.h"; sourceTree = "<group>"; };
+ 4D19929D171D01AC009F6E18 /* NSData+Storage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Storage.m"; sourceTree = "<group>"; };
+ 4D1992A0171D094D009F6E18 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = "<group>"; };
+ 4D1992BA171D097B009F6E18 /* EssentialImagerFullDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EssentialImagerFullDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 4D1992BD171D0B7F009F6E18 /* EIFullDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EIFullDemoViewController.h; sourceTree = "<group>"; };
+ 4D1992BE171D0B7F009F6E18 /* EIFullDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EIFullDemoViewController.m; sourceTree = "<group>"; };
+ 4D1992BF171D0B7F009F6E18 /* FullDemoAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullDemoAppDelegate.h; sourceTree = "<group>"; };
+ 4D1992C0171D0B7F009F6E18 /* FullDemoAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FullDemoAppDelegate.m; sourceTree = "<group>"; };
+ 4D1992C1171D0B7F009F6E18 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 4D1992C6171D0B9C009F6E18 /* EISimpleDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EISimpleDemoViewController.h; sourceTree = "<group>"; };
+ 4D1992C7171D0B9C009F6E18 /* EISimpleDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EISimpleDemoViewController.m; sourceTree = "<group>"; };
+ 4D1992C8171D0B9C009F6E18 /* SimpleDemoAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleDemoAppDelegate.h; sourceTree = "<group>"; };
+ 4D1992C9171D0B9C009F6E18 /* SimpleDemoAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleDemoAppDelegate.m; sourceTree = "<group>"; };
+ 4D1992CA171D0B9C009F6E18 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 4D1992CE171D0D7A009F6E18 /* EssentialImagerFullDemo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "EssentialImagerFullDemo-Info.plist"; path = "EssentialImagerDemo/EssentialImagerFullDemo-Info.plist"; sourceTree = "<group>"; };
+ 4D1992D0171D0D82009F6E18 /* EssentialImagerSimpleDemo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "EssentialImagerSimpleDemo-Info.plist"; path = "EssentialImagerDemo/EssentialImagerSimpleDemo-Info.plist"; sourceTree = "<group>"; };
+ 4D79EC3315B08111007C9A90 /* EssentialImagerSimpleDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EssentialImagerSimpleDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
4D79EC3715B08111007C9A90 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
4D79EC3915B08111007C9A90 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
4D79EC3B15B08111007C9A90 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
- 4D79EC3F15B08111007C9A90 /* EssentialImagerDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "EssentialImagerDemo-Info.plist"; sourceTree = "<group>"; };
4D79EC4115B08111007C9A90 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- 4D79EC4315B08111007C9A90 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
4D79EC4515B08111007C9A90 /* EssentialImagerDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "EssentialImagerDemo-Prefix.pch"; sourceTree = "<group>"; };
4D79EC4E15B08127007C9A90 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
4D79EC5015B08161007C9A90 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
4D79EC5115B08161007C9A90 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; };
4D79EC5215B08161007C9A90 /* pattern.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pattern.png; sourceTree = "<group>"; };
- 4D79EC5815B0816E007C9A90 /* EDStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EDStorage.h; sourceTree = "<group>"; };
- 4D79EC5915B0816E007C9A90 /* EDStorageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EDStorageManager.h; sourceTree = "<group>"; };
- 4D79EC5A15B0816E007C9A90 /* EDStorageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EDStorageManager.m; sourceTree = "<group>"; };
- 4D79EC5B15B0816E007C9A90 /* EDStorageOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EDStorageOperation.h; sourceTree = "<group>"; };
- 4D79EC5C15B0816E007C9A90 /* EDStorageOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EDStorageOperation.m; sourceTree = "<group>"; };
- 4D79EC5D15B0816E007C9A90 /* NSData+Storage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Storage.h"; sourceTree = "<group>"; };
- 4D79EC5E15B0816E007C9A90 /* NSData+Storage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Storage.m"; sourceTree = "<group>"; };
- 4D79EC5F15B0816E007C9A90 /* UIImage+Storage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Storage.h"; sourceTree = "<group>"; };
- 4D79EC6015B0816E007C9A90 /* UIImage+Storage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Storage.m"; sourceTree = "<group>"; };
4D79EC6115B0816E007C9A90 /* EIImagePickerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EIImagePickerDelegate.h; sourceTree = "<group>"; };
4D79EC6215B0816E007C9A90 /* EIImagePickerDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EIImagePickerDelegate.m; sourceTree = "<group>"; };
4D79EC6315B0816E007C9A90 /* EssentialImager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EssentialImager.h; sourceTree = "<group>"; };
@@ -56,13 +79,20 @@
4D79EC6615B0816E007C9A90 /* StandardPaths.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StandardPaths.m; sourceTree = "<group>"; };
4D79EC6715B0816E007C9A90 /* UIImage+Resize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Resize.h"; sourceTree = "<group>"; };
4D79EC6815B0816E007C9A90 /* UIImage+Resize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Resize.m"; sourceTree = "<group>"; };
- 4D79EC7015B08187007C9A90 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
- 4D79EC7115B08187007C9A90 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
- 4D79EC7215B08187007C9A90 /* EIDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EIDemoViewController.h; sourceTree = "<group>"; };
- 4D79EC7315B08187007C9A90 /* EIDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EIDemoViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
+ 4D1992AC171D097B009F6E18 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 4D1992AD171D097B009F6E18 /* QuartzCore.framework in Frameworks */,
+ 4D1992AE171D097B009F6E18 /* UIKit.framework in Frameworks */,
+ 4D1992AF171D097B009F6E18 /* Foundation.framework in Frameworks */,
+ 4D1992B0171D097B009F6E18 /* CoreGraphics.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
4D79EC3015B08111007C9A90 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -77,10 +107,36 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
+ 4D1992BC171D0B7E009F6E18 /* Full Demo */ = {
+ isa = PBXGroup;
+ children = (
+ 4D1992BD171D0B7F009F6E18 /* EIFullDemoViewController.h */,
+ 4D1992BE171D0B7F009F6E18 /* EIFullDemoViewController.m */,
+ 4D1992BF171D0B7F009F6E18 /* FullDemoAppDelegate.h */,
+ 4D1992C0171D0B7F009F6E18 /* FullDemoAppDelegate.m */,
+ 4D1992C1171D0B7F009F6E18 /* main.m */,
+ );
+ path = "Full Demo";
+ sourceTree = "<group>";
+ };
+ 4D1992C5171D0B9C009F6E18 /* Simple Demo */ = {
+ isa = PBXGroup;
+ children = (
+ 4D1992C6171D0B9C009F6E18 /* EISimpleDemoViewController.h */,
+ 4D1992C7171D0B9C009F6E18 /* EISimpleDemoViewController.m */,
+ 4D1992C8171D0B9C009F6E18 /* SimpleDemoAppDelegate.h */,
+ 4D1992C9171D0B9C009F6E18 /* SimpleDemoAppDelegate.m */,
+ 4D1992CA171D0B9C009F6E18 /* main.m */,
+ );
+ path = "Simple Demo";
+ sourceTree = "<group>";
+ };
4D79EC2815B08111007C9A90 = {
isa = PBXGroup;
children = (
4D79EC3D15B08111007C9A90 /* EssentialImagerDemo */,
+ 4D1992D0171D0D82009F6E18 /* EssentialImagerSimpleDemo-Info.plist */,
+ 4D1992CE171D0D7A009F6E18 /* EssentialImagerFullDemo-Info.plist */,
4D79EC3615B08111007C9A90 /* Frameworks */,
4D79EC3415B08111007C9A90 /* Products */,
);
@@ -89,7 +145,8 @@
4D79EC3415B08111007C9A90 /* Products */ = {
isa = PBXGroup;
children = (
- 4D79EC3315B08111007C9A90 /* EssentialImagerDemo.app */,
+ 4D79EC3315B08111007C9A90 /* EssentialImagerSimpleDemo.app */,
+ 4D1992BA171D097B009F6E18 /* EssentialImagerFullDemo.app */,
);
name = Products;
sourceTree = "<group>";
@@ -108,10 +165,8 @@
4D79EC3D15B08111007C9A90 /* EssentialImagerDemo */ = {
isa = PBXGroup;
children = (
- 4D79EC7015B08187007C9A90 /* AppDelegate.h */,
- 4D79EC7115B08187007C9A90 /* AppDelegate.m */,
- 4D79EC7215B08187007C9A90 /* EIDemoViewController.h */,
- 4D79EC7315B08187007C9A90 /* EIDemoViewController.m */,
+ 4D1992C5171D0B9C009F6E18 /* Simple Demo */,
+ 4D1992BC171D0B7E009F6E18 /* Full Demo */,
4D79EC5615B0816E007C9A90 /* EssentialImager */,
4D79EC3E15B08111007C9A90 /* Supporting Files */,
);
@@ -121,12 +176,11 @@
4D79EC3E15B08111007C9A90 /* Supporting Files */ = {
isa = PBXGroup;
children = (
+ 4D1992A0171D094D009F6E18 /* Default-568h@2x.png */,
4D79EC5015B08161007C9A90 /* Icon.png */,
4D79EC5115B08161007C9A90 /* Icon@2x.png */,
4D79EC5215B08161007C9A90 /* pattern.png */,
- 4D79EC3F15B08111007C9A90 /* EssentialImagerDemo-Info.plist */,
4D79EC4015B08111007C9A90 /* InfoPlist.strings */,
- 4D79EC4315B08111007C9A90 /* main.m */,
4D79EC4515B08111007C9A90 /* EssentialImagerDemo-Prefix.pch */,
);
name = "Supporting Files";
@@ -135,7 +189,10 @@
4D79EC5615B0816E007C9A90 /* EssentialImager */ = {
isa = PBXGroup;
children = (
- 4D79EC5715B0816E007C9A90 /* EDStorage */,
+ 4D19929A171D01AC009F6E18 /* EIOperationManager.h */,
+ 4D19929B171D01AC009F6E18 /* EIOperationManager.m */,
+ 4D19929C171D01AC009F6E18 /* NSData+Storage.h */,
+ 4D19929D171D01AC009F6E18 /* NSData+Storage.m */,
4D79EC6115B0816E007C9A90 /* EIImagePickerDelegate.h */,
4D79EC6215B0816E007C9A90 /* EIImagePickerDelegate.m */,
4D79EC6315B0816E007C9A90 /* EssentialImager.h */,
@@ -146,22 +203,6 @@
path = EssentialImager;
sourceTree = "<group>";
};
- 4D79EC5715B0816E007C9A90 /* EDStorage */ = {
- isa = PBXGroup;
- children = (
- 4D79EC5815B0816E007C9A90 /* EDStorage.h */,
- 4D79EC5915B0816E007C9A90 /* EDStorageManager.h */,
- 4D79EC5A15B0816E007C9A90 /* EDStorageManager.m */,
- 4D79EC5B15B0816E007C9A90 /* EDStorageOperation.h */,
- 4D79EC5C15B0816E007C9A90 /* EDStorageOperation.m */,
- 4D79EC5D15B0816E007C9A90 /* NSData+Storage.h */,
- 4D79EC5E15B0816E007C9A90 /* NSData+Storage.m */,
- 4D79EC5F15B0816E007C9A90 /* UIImage+Storage.h */,
- 4D79EC6015B0816E007C9A90 /* UIImage+Storage.m */,
- );
- path = EDStorage;
- sourceTree = "<group>";
- };
4D79EC6415B0816E007C9A90 /* StandardPaths */ = {
isa = PBXGroup;
children = (
@@ -174,9 +215,26 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
- 4D79EC3215B08111007C9A90 /* EssentialImagerDemo */ = {
+ 4D1992A2171D097B009F6E18 /* EssentialImagerFullDemo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 4D1992B7171D097B009F6E18 /* Build configuration list for PBXNativeTarget "EssentialImagerFullDemo" */;
+ buildPhases = (
+ 4D1992A3171D097B009F6E18 /* Sources */,
+ 4D1992AC171D097B009F6E18 /* Frameworks */,
+ 4D1992B1171D097B009F6E18 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = EssentialImagerFullDemo;
+ productName = EssentialImagerDemo;
+ productReference = 4D1992BA171D097B009F6E18 /* EssentialImagerFullDemo.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 4D79EC3215B08111007C9A90 /* EssentialImagerSimpleDemo */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 4D79EC4B15B08111007C9A90 /* Build configuration list for PBXNativeTarget "EssentialImagerDemo" */;
+ buildConfigurationList = 4D79EC4B15B08111007C9A90 /* Build configuration list for PBXNativeTarget "EssentialImagerSimpleDemo" */;
buildPhases = (
4D79EC2F15B08111007C9A90 /* Sources */,
4D79EC3015B08111007C9A90 /* Frameworks */,
@@ -186,9 +244,9 @@
);
dependencies = (
);
- name = EssentialImagerDemo;
+ name = EssentialImagerSimpleDemo;
productName = EssentialImagerDemo;
- productReference = 4D79EC3315B08111007C9A90 /* EssentialImagerDemo.app */;
+ productReference = 4D79EC3315B08111007C9A90 /* EssentialImagerSimpleDemo.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@@ -197,7 +255,7 @@
4D79EC2A15B08111007C9A90 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0430;
+ LastUpgradeCheck = 0460;
};
buildConfigurationList = 4D79EC2D15B08111007C9A90 /* Build configuration list for PBXProject "EssentialImagerDemo" */;
compatibilityVersion = "Xcode 3.2";
@@ -211,12 +269,25 @@
projectDirPath = "";
projectRoot = "";
targets = (
- 4D79EC3215B08111007C9A90 /* EssentialImagerDemo */,
+ 4D79EC3215B08111007C9A90 /* EssentialImagerSimpleDemo */,
+ 4D1992A2171D097B009F6E18 /* EssentialImagerFullDemo */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
+ 4D1992B1171D097B009F6E18 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 4D1992B2171D097B009F6E18 /* InfoPlist.strings in Resources */,
+ 4D1992B3171D097B009F6E18 /* Icon.png in Resources */,
+ 4D1992B4171D097B009F6E18 /* Icon@2x.png in Resources */,
+ 4D1992B5171D097B009F6E18 /* pattern.png in Resources */,
+ 4D1992B6171D097B009F6E18 /* Default-568h@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
4D79EC3115B08111007C9A90 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -225,26 +296,40 @@
4D79EC5315B08161007C9A90 /* Icon.png in Resources */,
4D79EC5415B08161007C9A90 /* Icon@2x.png in Resources */,
4D79EC5515B08161007C9A90 /* pattern.png in Resources */,
+ 4D1992A1171D094D009F6E18 /* Default-568h@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+ 4D1992A3171D097B009F6E18 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 4D1992A5171D097B009F6E18 /* EIImagePickerDelegate.m in Sources */,
+ 4D1992A6171D097B009F6E18 /* StandardPaths.m in Sources */,
+ 4D1992A7171D097B009F6E18 /* UIImage+Resize.m in Sources */,
+ 4D1992AA171D097B009F6E18 /* EIOperationManager.m in Sources */,
+ 4D1992AB171D097B009F6E18 /* NSData+Storage.m in Sources */,
+ 4D1992C2171D0B7F009F6E18 /* EIFullDemoViewController.m in Sources */,
+ 4D1992C3171D0B7F009F6E18 /* FullDemoAppDelegate.m in Sources */,
+ 4D1992C4171D0B7F009F6E18 /* main.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
4D79EC2F15B08111007C9A90 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 4D79EC4415B08111007C9A90 /* main.m in Sources */,
- 4D79EC6915B0816E007C9A90 /* EDStorageManager.m in Sources */,
- 4D79EC6A15B0816E007C9A90 /* EDStorageOperation.m in Sources */,
- 4D79EC6B15B0816E007C9A90 /* NSData+Storage.m in Sources */,
- 4D79EC6C15B0816E007C9A90 /* UIImage+Storage.m in Sources */,
4D79EC6D15B0816E007C9A90 /* EIImagePickerDelegate.m in Sources */,
4D79EC6E15B0816E007C9A90 /* StandardPaths.m in Sources */,
4D79EC6F15B0816E007C9A90 /* UIImage+Resize.m in Sources */,
- 4D79EC7415B08187007C9A90 /* AppDelegate.m in Sources */,
- 4D79EC7515B08187007C9A90 /* EIDemoViewController.m in Sources */,
+ 4D19929E171D01AC009F6E18 /* EIOperationManager.m in Sources */,
+ 4D19929F171D01AC009F6E18 /* NSData+Storage.m in Sources */,
+ 4D1992CB171D0B9C009F6E18 /* EISimpleDemoViewController.m in Sources */,
+ 4D1992CC171D0B9C009F6E18 /* SimpleDemoAppDelegate.m in Sources */,
+ 4D1992CD171D0B9C009F6E18 /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -262,12 +347,40 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
+ 4D1992B8171D097B009F6E18 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "EssentialImagerDemo/EssentialImagerDemo-Prefix.pch";
+ INFOPLIST_FILE = "$(SRCROOT)/EssentialImagerDemo/EssentialImagerFullDemo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ PRODUCT_NAME = EssentialImagerFullDemo;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ 4D1992B9171D097B009F6E18 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "EssentialImagerDemo/EssentialImagerDemo-Prefix.pch";
+ INFOPLIST_FILE = "$(SRCROOT)/EssentialImagerDemo/EssentialImagerFullDemo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ PRODUCT_NAME = EssentialImagerFullDemo;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
4D79EC4915B08111007C9A90 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -293,6 +406,10 @@
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -312,7 +429,8 @@
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EssentialImagerDemo/EssentialImagerDemo-Prefix.pch";
- INFOPLIST_FILE = "EssentialImagerDemo/EssentialImagerDemo-Info.plist";
+ INFOPLIST_FILE = "$(SRCROOT)/EssentialImagerDemo/EssentialImagerSimpleDemo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -323,7 +441,8 @@
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EssentialImagerDemo/EssentialImagerDemo-Prefix.pch";
- INFOPLIST_FILE = "EssentialImagerDemo/EssentialImagerDemo-Info.plist";
+ INFOPLIST_FILE = "$(SRCROOT)/EssentialImagerDemo/EssentialImagerSimpleDemo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -332,6 +451,15 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ 4D1992B7171D097B009F6E18 /* Build configuration list for PBXNativeTarget "EssentialImagerFullDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 4D1992B8171D097B009F6E18 /* Debug */,
+ 4D1992B9171D097B009F6E18 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
4D79EC2D15B08111007C9A90 /* Build configuration list for PBXProject "EssentialImagerDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -341,7 +469,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- 4D79EC4B15B08111007C9A90 /* Build configuration list for PBXNativeTarget "EssentialImagerDemo" */ = {
+ 4D79EC4B15B08111007C9A90 /* Build configuration list for PBXNativeTarget "EssentialImagerSimpleDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4D79EC4C15B08111007C9A90 /* Debug */,
View
BIN ...proj/project.xcworkspace/xcuserdata/dilliontan.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
View
10 ...deproj/project.xcworkspace/xcuserdata/dilliontan.xcuserdatad/WorkspaceSettings.xcsettings
@@ -0,0 +1,10 @@
+<?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>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
+ <true/>
+ <key>SnapshotAutomaticallyBeforeSignificantChanges</key>
+ <false/>
+</dict>
+</plist>
View
5 ...lImagerDemo.xcodeproj/xcuserdata/dilliontan.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Bucket
+ type = "1"
+ version = "1.0">
+</Bucket>
View
86 ...entialImagerDemo.xcodeproj/xcuserdata/dilliontan.xcuserdatad/xcschemes/Full Demo.xcscheme
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0460"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "4D1992A2171D097B009F6E18"
+ BuildableName = "EssentialImagerFullDemo.app"
+ BlueprintName = "EssentialImagerFullDemo"
+ ReferencedContainer = "container:EssentialImagerDemo.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "4D1992A2171D097B009F6E18"
+ BuildableName = "EssentialImagerFullDemo.app"
+ BlueprintName = "EssentialImagerFullDemo"
+ ReferencedContainer = "container:EssentialImagerDemo.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "4D1992A2171D097B009F6E18"
+ BuildableName = "EssentialImagerFullDemo.app"
+ BlueprintName = "EssentialImagerFullDemo"
+ ReferencedContainer = "container:EssentialImagerDemo.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "4D1992A2171D097B009F6E18"
+ BuildableName = "EssentialImagerFullDemo.app"
+ BlueprintName = "EssentialImagerFullDemo"
+ ReferencedContainer = "container:EssentialImagerDemo.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
View
17 ...ad/xcschemes/EssentialImagerDemo.xcscheme → ...cuserdatad/xcschemes/Simple Demo.xcscheme
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
+ LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -14,8 +15,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D79EC3215B08111007C9A90"
- BuildableName = "EssentialImagerDemo.app"
- BlueprintName = "EssentialImagerDemo"
+ BuildableName = "EssentialImagerSimpleDemo.app"
+ BlueprintName = "EssentialImagerSimpleDemo"
ReferencedContainer = "container:EssentialImagerDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@@ -32,8 +33,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D79EC3215B08111007C9A90"
- BuildableName = "EssentialImagerDemo.app"
- BlueprintName = "EssentialImagerDemo"
+ BuildableName = "EssentialImagerSimpleDemo.app"
+ BlueprintName = "EssentialImagerSimpleDemo"
ReferencedContainer = "container:EssentialImagerDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
@@ -51,8 +52,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D79EC3215B08111007C9A90"
- BuildableName = "EssentialImagerDemo.app"
- BlueprintName = "EssentialImagerDemo"
+ BuildableName = "EssentialImagerSimpleDemo.app"
+ BlueprintName = "EssentialImagerSimpleDemo"
ReferencedContainer = "container:EssentialImagerDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
@@ -69,8 +70,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D79EC3215B08111007C9A90"
- BuildableName = "EssentialImagerDemo.app"
- BlueprintName = "EssentialImagerDemo"
+ BuildableName = "EssentialImagerSimpleDemo.app"
+ BlueprintName = "EssentialImagerSimpleDemo"
ReferencedContainer = "container:EssentialImagerDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
View
12 ...ImagerDemo.xcodeproj/xcuserdata/dilliontan.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -4,7 +4,12 @@
<dict>
<key>SchemeUserState</key>
<dict>
- <key>EssentialImagerDemo.xcscheme</key>
+ <key>Full Demo.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>1</integer>
+ </dict>
+ <key>Simple Demo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
@@ -12,6 +17,11 @@
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
+ <key>4D1992A2171D097B009F6E18</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
<key>4D79EC3215B08111007C9A90</key>
<dict>
<key>primary</key>
View
11 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/EDStorage.h
@@ -1,11 +0,0 @@
-//
-// EDStorage.h
-// storage
-//
-// Created by Andrew Sliwinski on 6/23/12.
-// Copyright (c) 2012 Andrew Sliwinski. All rights reserved.
-//
-
-#import "EDStorageManager.h"
-#import "NSData+Storage.h"
-#import "UIImage+Storage.h"
View
70 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/EDStorageManager.h
@@ -1,70 +0,0 @@
-/*
-
- File: EDStorageManager.h
- Abstract: Modified to use directory paths from StandardPaths,
- add scale suffix to extension
-
- Copyright (c) 2012 Dillion Tan
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the "Software"), to deal in the Software without
- restriction, including without limitation the rights to use,
- copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following
- conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- */
-
-//
-// EDStorageManager.h
-// storage
-//
-// Created by Andrew Sliwinski on 6/23/12.
-// Copyright (c) 2012 DIY, Co. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-//
-
-#define DEFINE_SHARED_INSTANCE_USING_BLOCK(block) \
-static dispatch_once_t pred = 0; \
-__strong static id _sharedObject = nil; \
-dispatch_once(&pred, ^{ \
-_sharedObject = block(); \
-}); \
-return _sharedObject; \
-
-typedef enum // changed to match paths from StandardPaths
-{
- kDirectoryPublic,
- kDirectoryPrivate,
- kDirectoryCache,
- kDirectoryOffline,
- kDirectoryTemporary,
- kDirectoryResource,
-} Location;
-
-@interface EDStorageManager : NSObject
-{
- @private NSOperationQueue *queue;
-}
-
-+ (EDStorageManager *)sharedInstance;
-- (void)persistData:(id)data withExtension:(NSString *)ext toLocation:(Location)location success:(void (^)(NSURL *url, NSUInteger size))success failure:(void (^)(NSError *error))failure;
-
-@end
View
175 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/EDStorageManager.m
@@ -1,175 +0,0 @@
-/*
-
- File: EDStorageManager.m
- Abstract: Modified to use directory paths from StandardPaths,
- add scale suffix to extension
-
- Copyright (c) 2012 Dillion Tan
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the "Software"), to deal in the Software without
- restriction, including without limitation the rights to use,
- copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following
- conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- */
-
-//
-// EDStorageManager.m
-// storage
-//
-// Created by Andrew Sliwinski on 6/23/12.
-// Copyright (c) 2012 DIY, Co. All rights reserved.
-//
-
-#import "EDStorageManager.h"
-#import "EDStorageOperation.h"
-
-//
-
-@interface EDStorageManager ()
-@property (nonatomic, retain) NSOperationQueue *queue;
-@end
-
-//
-
-@implementation EDStorageManager
-
-@synthesize queue = _queue;
-
-#pragma mark - Init
-
-+ (EDStorageManager *)sharedInstance
-{
- DEFINE_SHARED_INSTANCE_USING_BLOCK(^{
- return [[self alloc] init];
- });
-}
-
-- (id)init
-{
- self = [super init];
- if (self)
- {
- _queue = [[NSOperationQueue alloc] init];
- self.queue.maxConcurrentOperationCount = 2;
- }
- return self;
-}
-
-#pragma mark - Public methods
-
-/**
- * Generic persistence adapter for category extensions.
- *
- * @param {id} Data
- * @param {NSString} File extension (e.g. @"jpg")
- * @param {Location} File location (see interface for enum)
- * @param {block} Success block
- * @param {block} Failure block
- *
- * @return {void}
- */
-- (void)persistData:(id)data withExtension:(NSString *)ext toLocation:(Location)location success:(void (^)(NSURL *, NSUInteger))success failure:(void (^)(NSError *))failure
-{
- // Create URL
- NSURL *url = [self createAssetFileURLForLocation:location withExtension:ext];
-
- // Perform operation
- EDStorageOperation *operation = [[EDStorageOperation alloc] initWithData:data forURL:url];
- [operation setCompletionBlock:^{
- if (operation.complete)
- {
- success(operation.target, operation.size);
- } else {
- if (operation.error != NULL)
- {
- failure(operation.error);
- } else {
- failure([NSError errorWithDomain:@"com.ed.storage" code:100 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:operation, @"operation", url, @"url", nil]]);
- }
- }
-
- //
-
- [operation setCompletionBlock:nil]; // Force dealloc
- }];
- [self.queue addOperation:operation];
- [operation release];
-}
-
-#pragma mark - Private methods
-
-/**
- * Creates an asset file url (path) using location declaration and file extension.
- *
- * @param {Location} ENUM type
- * @param {NSString} Extension (e.g. @"jpg")
- *
- * @return {NSURL}
- */
-- (NSURL *)createAssetFileURLForLocation:(Location)location withExtension:(NSString *)extension
-{
- NSString *directoryPath = nil;
- NSString *assetName = nil;
-
- switch (location) {
- case kDirectoryPublic:
- directoryPath = [[NSFileManager defaultManager] publicDataPath];
- break;
- case kDirectoryPrivate:
- directoryPath = [[NSFileManager defaultManager] privateDataPath];
- break;
- case kDirectoryCache:
- directoryPath = [[NSFileManager defaultManager] cacheDataPath];
- break;
- case kDirectoryOffline:
- directoryPath = [[NSFileManager defaultManager] offlineDataPath];
- break;
- case kDirectoryTemporary:
- directoryPath = [[NSFileManager defaultManager] temporaryDataPath];
- break;
- case kDirectoryResource:
- directoryPath = [[NSFileManager defaultManager] resourcePath];
- break;
- default:
- [NSException raise:@"Invalid location value" format:@"Location %@ is invalid", location];
- break;
- }
-
- assetName = [NSString stringWithFormat:@"%@.%@", [[NSProcessInfo processInfo] globallyUniqueString], extension];
- assetName = [assetName stringByAppendingScaleSuffix]; // add scale suffix to extension
- NSString *assetPath = [directoryPath stringByAppendingPathComponent:assetName];
-
- return [NSURL fileURLWithPath:assetPath];
-}
-
-#pragma mark - Dealloc
-
-- (void)releaseObjects
-{
- [_queue release]; _queue = nil;
-}
-
-- (void)dealloc
-{
- [self releaseObjects];
- [super dealloc];
-}
-
-@end
View
23 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/EDStorageOperation.h
@@ -1,23 +0,0 @@
-//
-// EDStorageOperation.h
-// storage
-//
-// Created by Andrew Sliwinski on 6/23/12.
-// Copyright (c) 2012 DIY, Co. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface EDStorageOperation : NSOperation
-{
- id dataset;
-}
-
-@property (atomic, retain) NSURL *target;
-@property (atomic, assign) NSUInteger size;
-@property (atomic, assign) BOOL complete;
-@property (atomic, retain) NSError *error;
-
-- (id)initWithData:(id)data forURL:(NSURL *)url;
-
-@end
View
62 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/EDStorageOperation.m
@@ -1,62 +0,0 @@
-//
-// EDStorageOperation.m
-// storage
-//
-// Created by Andrew Sliwinski on 6/23/12.
-// Copyright (c) 2012 DIY, Co. All rights reserved.
-//
-
-#import "EDStorageOperation.h"
-
-@implementation EDStorageOperation
-
-@synthesize target = _target;
-@synthesize size = _size;
-@synthesize complete = _complete;
-@synthesize error = _error;
-
-#pragma mark - Init
-
-- (id)initWithData:(id)data forURL:(NSURL *)url
-{
- if (![super init]) return nil;
-
- dataset = [data retain];
- _size = [dataset length];
- _complete = false;
-
- _target = [[NSURL alloc] init];
- self.target = url;
-
- _error = [[NSError alloc] init];
- self.error = NULL;
-
- return self;
-}
-
-#pragma mark - Inherit
-
-- (void)main
-{
- @try
- {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- self.complete = [dataset writeToURL:self.target options:NSDataWritingAtomic error:&_error];
- [pool release];
- } @catch (NSException *exception) {
- [exception raise];
- }
-}
-
-#pragma mark - Dealloc
-
-- (void)dealloc
-{
- [dataset release]; dataset = nil;
- [_target release]; _target = nil;
- [_error release]; _error = nil;
-
- [super dealloc];
-}
-
-@end
View
94 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EDStorage/NSData+Storage.m
@@ -1,94 +0,0 @@
-/*
-
- File: NSData+Storage.m
- Abstract: Modified to add retrieval of image from file url and
- set scale based on suffix
-
- Copyright (c) 2012 Dillion Tan
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the "Software"), to deal in the Software without
- restriction, including without limitation the rights to use,
- copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following
- conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- */
-
-//
-// NSData+Storage.m
-// storage
-//
-// Created by Andrew Sliwinski on 6/24/12.
-// Copyright (c) 2012 DIY, Co. All rights reserved.
-//
-
-#import "NSData+Storage.h"
-#import "EDStorageManager.h"
-#import "StandardPaths.h"
-
-@implementation NSData (Storage)
-
-+ (UIImage *)imageFromFile:(NSString *)filePath
-{
- float scale = [filePath scale];
-
- NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:filePath]];
-
- if (!imageData) {
- NSLog(@"file at %@ does not contain valid data", filePath);
- return nil;
- }
-
- UIImage *image = [UIImage imageWithData:imageData];
-
- if (!image) {
- NSLog(@"could not initialize image from data");
- return nil;
- }
-
- return [UIImage imageWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation];
-}
-
-- (void)persistToCacheWithExtension:(NSString *)extension success:(void (^)(NSURL *, NSUInteger))success failure:(void (^)(NSError *))failure
-{
- [[EDStorageManager sharedInstance] persistData:self withExtension:extension toLocation:kDirectoryCache success:^(NSURL *url, NSUInteger size) {
- success(url, size);
- } failure:^(NSError *error) {
- failure(error);
- }];
-}
-
-- (void)persistToTempWithExtension:(NSString *)extension success:(void (^)(NSURL *, NSUInteger))success failure:(void (^)(NSError *))failure
-{
- [[EDStorageManager sharedInstance] persistData:self withExtension:extension toLocation:kDirectoryTemporary success:^(NSURL *url, NSUInteger size) {
- success(url, size);
- } failure:^(NSError *error) {
- failure(error);
- }];
-}
-
-- (void)persistToDocumentsWithExtension:(NSString *)extension success:(void (^)(NSURL *, NSUInteger))success failure:(void (^)(NSError *))failure
-{
- [[EDStorageManager sharedInstance] persistData:self withExtension:extension toLocation:kDirectoryPublic success:^(NSURL *url, NSUInteger size) {
- success(url, size);
- } failure:^(NSError *error) {
- failure(error);
- }];
-}
-
-@end
View
20 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EIOperationManager.h
@@ -0,0 +1,20 @@
+//
+// EIOperationManager.h
+// EssentialImagerDemo
+//
+// Created by Dillion Tan on 16/4/13.
+//
+//
+
+#import <Foundation/Foundation.h>
+
+@interface EIOperationManager : NSObject
+
+@property (nonatomic, strong) NSOperationQueue *storageQueue;
+@property (nonatomic, strong) NSMutableDictionary *storageOperationDictionary;
+
++ (EIOperationManager *)defaultManager;
+
+- (void)saveImage:(UIImage *)image toPath:(NSString *)pathString withBlock:(void(^)(BOOL success))block;
+
+@end
View
73 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EIOperationManager.m
@@ -0,0 +1,73 @@
+//
+// EIOperationManager.m
+// EssentialImagerDemo
+//
+// Created by Dillion Tan on 16/4/13.
+//
+//
+
+#import "EIOperationManager.h"
+
+@implementation EIOperationManager
+
+@synthesize storageQueue;
+@synthesize storageOperationDictionary;
+
++ (EIOperationManager *)defaultManager
+{
+ static dispatch_once_t pred = 0;
+ __strong static id _defaultManager = nil;
+ dispatch_once(&pred, ^{
+ _defaultManager = [[self alloc] init];
+ });
+ return _defaultManager;
+}
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ storageQueue = [[NSOperationQueue alloc] init];
+ storageOperationDictionary = [NSMutableDictionary dictionary];
+ }
+ return self;
+}
+
+// assume we are saving PNG
+- (void)saveImage:(UIImage *)image toPath:(NSString *)pathString withBlock:(void(^)(BOOL success))block
+{
+ if (![storageOperationDictionary objectForKey:pathString]) {
+ __block UIImage *imageToSave = image;
+
+ NSBlockOperation *writeBlockOperation = [[NSBlockOperation alloc] init];
+ __weak NSBlockOperation *weakSelf = writeBlockOperation;
+
+ [writeBlockOperation addExecutionBlock:^{
+ NSData *imageData = UIImagePNGRepresentation(imageToSave);
+
+ if (!weakSelf.isCancelled) {
+
+ [imageData writeToFile:pathString atomically:YES];
+
+ if (!weakSelf.isCancelled) {
+ [storageOperationDictionary removeObjectForKey:pathString];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ block(YES);
+ });
+ } else {
+ block(NO);
+ }
+ } else {
+ block(NO);
+ }
+ }];
+
+ [storageOperationDictionary setObject:writeBlockOperation forKey:pathString];
+
+ [storageQueue addOperation:writeBlockOperation];
+ } else { // already queued for writing
+ block(NO);
+ }
+}
+
+@end
View
3 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/EssentialImager.h
@@ -32,8 +32,9 @@
#define EssentialImager_EssentialImager_h
#import "StandardPaths.h"
-#import "EDStorage.h"
#import "UIImage+Resize.h"
+#import "NSData+Storage.h"
#import "EIImagePickerDelegate.h"
+#import "EIOperationManager.h"
#endif
View
14 ...sentialImager/EDStorage/UIImage+Storage.h → ...agerDemo/EssentialImager/NSData+Storage.h
@@ -1,7 +1,8 @@
/*
- File: UIImage+Storage.h
- Abstract: Modified to replace with persist PNG function
+ File: NSData+Storage.h
+ Abstract: Modified to add retrieval of image from file url and
+ set scale based on suffix
Copyright (c) 2012 Dillion Tan
@@ -29,17 +30,18 @@
*/
//
-// UIImage+Storage.h
+// NSData+Storage.h
// storage
//
-// Created by Andrew Sliwinski on 6/23/12.
+// Created by Andrew Sliwinski on 6/24/12.
// Copyright (c) 2012 DIY, Co. All rights reserved.
//
+#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
-@interface UIImage (Storage)
+@interface NSData (Storage)
-- (void)persistToCacheAsPNG:(void (^)(NSURL *url, NSUInteger size))success failure:(void (^)(NSError *error))failure;
++ (UIImage *)imageFromFile:(NSString *)filePath;
@end
View
47 ...ssentialImager/EDStorage/NSData+Storage.h → ...agerDemo/EssentialImager/NSData+Storage.m
@@ -1,11 +1,11 @@
/*
-
- File: NSData+Storage.h
+
+ File: NSData+Storage.m
Abstract: Modified to add retrieval of image from file url and
set scale based on suffix
-
+
Copyright (c) 2012 Dillion Tan
-
+
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
@@ -14,10 +14,10 @@
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
-
+
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
-
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -26,26 +26,41 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-
+
*/
//
-// NSData+Storage.h
+// NSData+Storage.m
// storage
//
// Created by Andrew Sliwinski on 6/24/12.
// Copyright (c) 2012 DIY, Co. All rights reserved.
//
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
+#import "NSData+Storage.h"
+#import "StandardPaths.h"
+
+@implementation NSData (Storage)
+
++ (UIImage *)imageFromFile:(NSString *)filePath
+{
+ float scale = [filePath scale];
+
+ NSData *imageData = [NSData dataWithContentsOfFile:filePath];
+
+ if (!imageData) {
+ NSLog(@"file at %@ does not contain valid data", filePath);
+ return nil;
+ }
-@interface NSData (Storage)
+ UIImage *image = [UIImage imageWithData:imageData];
-+ (UIImage *)imageFromFile:(NSString *)filePath;
+ if (!image) {
+ NSLog(@"could not initialize image from data");
+ return nil;
+ }
-- (void)persistToCacheWithExtension:(NSString *)extension success:(void (^)(NSURL *url, NSUInteger size))success failure:(void (^)(NSError *error))failure;
-- (void)persistToTempWithExtension:(NSString *)extension success:(void (^)(NSURL *url, NSUInteger size))success failure:(void (^)(NSError *error))failure;
-- (void)persistToDocumentsWithExtension:(NSString *)extension success:(void (^)(NSURL *url, NSUInteger size))success failure:(void (^)(NSError *error))failure;
+ return [UIImage imageWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation];
+}
-@end
+@end
View
32 EssentialImagerDemo/EssentialImagerDemo/EssentialImager/UIImage+Resize.m
@@ -137,24 +137,30 @@ - (UIImage *)resizedImage:(CGSize)newSize
CGImageGetColorSpace(imageRef),
CGImageGetBitmapInfo(imageRef));
- // Rotate and/or flip the image if required by its orientation
- CGContextConcatCTM(bitmap, transform);
+ if (bitmap == NULL) {
+ NSLog(@"Failed context creation - image format is not supported by device. To force creation, try setting colorspace as CGColorSpaceCreateDeviceRGB() and/or bitmapinfo as kCGImageAlphaNone");
+ } else {
+
+ // Rotate and/or flip the image if required by its orientation
+ CGContextConcatCTM(bitmap, transform);
- // Set the quality level to use when rescaling
- CGContextSetInterpolationQuality(bitmap, quality);
+ // Set the quality level to use when rescaling
+ CGContextSetInterpolationQuality(bitmap, quality);
- // Draw into the context; this scales the image
- CGContextDrawImage(bitmap, transpose ? transposedRect : newRect, imageRef);
+ // Draw into the context; this scales the image
+ CGContextDrawImage(bitmap, transpose ? transposedRect : newRect, imageRef);
- // Get the resized image from the context and a UIImage
- CGImageRef newImageRef = CGBitmapContextCreateImage(bitmap);
- UIImage *newImage = [UIImage imageWithCGImage:newImageRef scale:screenScale orientation:UIImageOrientationUp];
+ // Get the resized image from the context and a UIImage
+ CGImageRef newImageRef = CGBitmapContextCreateImage(bitmap);
+ UIImage *newImage = [UIImage imageWithCGImage:newImageRef scale:screenScale orientation:UIImageOrientationUp];
- // Clean up
- CGContextRelease(bitmap);
- CGImageRelease(newImageRef);
+ // Clean up
+ CGContextRelease(bitmap);
+ CGImageRelease(newImageRef);
- return newImage;
+ return newImage;
+ }
+ return nil;
}
// Returns an affine transform that takes into account the image orientation when drawing a scaled image
View
6 ...ImagerDemo/EssentialImagerDemo-Info.plist → ...erDemo/EssentialImagerFullDemo-Info.plist
@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
- <string>EImager</string>
+ <string>full demo</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
@@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>1.0</string>
+ <string>1.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.0</string>
+ <string>1.1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIPrerenderedIcon</key>
View
42 EssentialImagerDemo/EssentialImagerDemo/EssentialImagerSimpleDemo-Info.plist
@@ -0,0 +1,42 @@
+<?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>simple demo</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.buuuk.${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.1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIPrerenderedIcon</key>
+ <true/>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UIStatusBarHidden</key>
+ <true/>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
View
2 ...ssentialImagerDemo/EIDemoViewController.h → ...Demo/Full Demo/EIFullDemoViewController.h
@@ -31,7 +31,7 @@
#import <UIKit/UIKit.h>
-@interface EIDemoViewController : UIViewController <UIActionSheetDelegate>
+@interface EIFullDemoViewController : UIViewController <UIActionSheetDelegate>
@property (nonatomic, strong) UILabel *summaryLabel;
@property (nonatomic, strong) UIButton *buttonWithImage;
View
40 ...ssentialImagerDemo/EIDemoViewController.m → ...Demo/Full Demo/EIFullDemoViewController.m
@@ -1,7 +1,7 @@
/*
File: EIDemoViewController.m
- Abstract: Demo Controller to show usage of image picker with blocks,
+ Abstract: Demo Controller to show usage of image picker with blocks,
and subsequent resizing, saving, clipping and masking of returned image
Copyright (c) 2012 Dillion Tan
@@ -29,13 +29,13 @@
*/
-#import "EIDemoViewController.h"
+#import "EIFullDemoViewController.h"
-@interface EIDemoViewController ()
+@interface EIFullDemoViewController ()
@end
-@implementation EIDemoViewController
+@implementation EIFullDemoViewController
@synthesize summaryLabel;
@synthesize buttonWithImage;
@@ -135,7 +135,7 @@ - (void)viewDidLoad
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"savedImage"]) { // test cached image
NSString *urlString = [[NSUserDefaults standardUserDefaults] objectForKey:@"savedImage"];
- UIImage *cachedImage = [NSData imageFromFile:urlString];
+ UIImage *cachedImage = [NSData imageFromFile:[[[NSFileManager defaultManager] cacheDataPath] stringByAppendingPathComponent:urlString]];
if (cachedImage) {
NSLog(@"logical size is %f:%f scale %f", cachedImage.size.width, cachedImage.size.height, cachedImage.scale);
@@ -162,9 +162,11 @@ - (void)presentPhotoPicker
if (!imagePickerDelegate) {
self.imagePickerDelegate = [[EIImagePickerDelegate alloc] init];
- __weak EIDemoViewController *controller = self;
+ __weak EIFullDemoViewController *weakController = self;
[imagePickerDelegate setImagePickerCompletionBlock:^(UIImage *pickerImage) {
+ __strong EIFullDemoViewController *strongController = weakController;
+
NSLog(@"logical size is %f:%f scale %f", pickerImage.size.width, pickerImage.size.height, pickerImage.scale);
// Use display size to constrain resizing
@@ -172,11 +174,11 @@ - (void)presentPhotoPicker
UIImage *resizedImage = [pickerImage resizedImageWithContentMode:UIViewContentModeScaleAspectFill bounds:CGSizeMake(120, 120) interpolationQuality:kCGInterpolationDefault];
// Use uncompressed size to constrain resizing
-// UIImage *resizedImage = [pickerImage resizedImageWithUncompressedSizeInMB:1.0 interpolationQuality:kCGInterpolationDefault];
+ // UIImage *resizedImage = [pickerImage resizedImageWithUncompressedSizeInMB:1.0 interpolationQuality:kCGInterpolationDefault];
NSLog(@"logical size is %f:%f scale %f", resizedImage.size.width, resizedImage.size.height, resizedImage.scale);
- [controller setOriginalImage:pickerImage resizedImage:resizedImage];
+ [strongController setOriginalImage:pickerImage resizedImage:resizedImage];
// remove the image if previously saved
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"savedImage"]) {
@@ -184,22 +186,16 @@ - (void)presentPhotoPicker
[[NSFileManager defaultManager] removeItemAtURL:[NSURL URLWithString:cachedFilePath] error:NULL];
}
+ NSString *assetName = [NSString stringWithFormat:@"%@.png", [[NSProcessInfo processInfo] globallyUniqueString]];
+ assetName = [assetName stringByAppendingScaleSuffix]; // add scale suffix to extension
+ NSString *assetPath = [[[NSFileManager defaultManager] cacheDataPath] stringByAppendingPathComponent:assetName];
+
// saving synchronously
-// NSString *assetName = [NSString stringWithFormat:@"%@.png", [[NSProcessInfo processInfo] globallyUniqueString]];
-// assetName = [assetName stringByAppendingScaleSuffix]; // add scale suffix to extension
-// NSString *assetPath = [[[NSFileManager defaultManager] cacheDataPath] stringByAppendingPathComponent:assetName];
-// NSURL *fileURL = [NSURL fileURLWithPath:assetPath];
-// [UIImagePNGRepresentation(resizedImage) writeToURL:fileURL atomically:NO];
-// [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%@", fileURL] forKey:@"savedImage"];
+ // [UIImagePNGRepresentation(resizedImage) writeToFile:assetPath atomically:NO];
+ // [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%@", assetName] forKey:@"savedImage"];
- // saving asynchronously
- [resizedImage persistToCacheAsPNG:^(NSURL *url, NSUInteger size) {
- NSLog(@"Complete: %@ | %d", url, size);
-
- // save the file path
- [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%@", url] forKey:@"savedImage"];
- } failure:^(NSError *error) {
- NSLog(@"Error: %@", error);
+ [[EIOperationManager defaultManager] saveImage:resizedImage toPath:assetPath withBlock:^(BOOL success) {
+ [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%@", assetName] forKey:@"savedImage"];
}];
}];
View
6 ...gerDemo/EssentialImagerDemo/AppDelegate.h → ...magerDemo/Full Demo/FullDemoAppDelegate.h
@@ -7,11 +7,11 @@
//
#import <UIKit/UIKit.h>
-#import "EIDemoViewController.h"
+#import "EIFullDemoViewController.h"
-@interface AppDelegate : UIResponder <UIApplicationDelegate>
+@interface FullDemoAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
-@property (nonatomic, strong) EIDemoViewController *rootViewController;
+@property (nonatomic, strong) EIFullDemoViewController *rootViewController;
@end
View
8 ...gerDemo/EssentialImagerDemo/AppDelegate.m → ...magerDemo/Full Demo/FullDemoAppDelegate.m
@@ -6,9 +6,9 @@
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
-#import "AppDelegate.h"
+#import "FullDemoAppDelegate.h"
-@implementation AppDelegate
+@implementation FullDemoAppDelegate
@synthesize window = _window;
@synthesize rootViewController;
@@ -19,9 +19,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
- self.rootViewController = [[EIDemoViewController alloc] init];
- [self.window addSubview:rootViewController.view];
-
+ self.window.rootViewController = [[EIFullDemoViewController alloc] init];
[self.window makeKeyAndVisible];
return YES;
View
5 ...tialImagerDemo/EssentialImagerDemo/main.m → ...Demo/EssentialImagerDemo/Full Demo/main.m
@@ -7,12 +7,11 @@
//
#import <UIKit/UIKit.h>
-
-#import "AppDelegate.h"
+#import "FullDemoAppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
- return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([FullDemoAppDelegate class]));
}
}
View
34 ...sentialImager/EDStorage/UIImage+Storage.m → .../Simple Demo/EISimpleDemoViewController.h 100755 → 100644
@@ -1,7 +1,8 @@
/*
- File: UIImage+Storage.m
- Abstract: Modified to add persist PNG function
+ File: EIDemoViewController.h
+ Abstract: Demo Controller to show usage of image picker with blocks,
+ and subsequent resizing, saving, clipping and masking of returned image
Copyright (c) 2012 Dillion Tan
@@ -28,27 +29,16 @@
*/
-//
-// UIImage+Storage.m
-// storage
-//
-// Created by Andrew Sliwinski on 6/23/12.
-// Copyright (c) 2012 DIY, Co. All rights reserved.
-//
+#import <UIKit/UIKit.h>
-#import <objc/runtime.h>
-#import "UIImage+Storage.h"
-#import "EDStorageManager.h"
+@interface EISimpleDemoViewController : UIViewController <UIActionSheetDelegate>
-@implementation UIImage (Storage)
+@property (nonatomic, strong) UIButton *buttonWithImage;
+@property (nonatomic, strong) UIImageView *imageViewWithRoundedCorners;
-- (void)persistToCacheAsPNG:(void (^)(NSURL *url, NSUInteger size))success failure:(void (^)(NSError *error))failure
-{
- [[EDStorageManager sharedInstance] persistData:UIImagePNGRepresentation(self) withExtension:@"png" toLocation:kDirectoryCache success:^(NSURL *url, NSUInteger size) {
- success(url, size);
- } failure:^(NSError *error) {
- failure(error);
- }];
-}
+@property (nonatomic, strong) EIImagePickerDelegate *imagePickerDelegate;
-@end
+- (void)presentPhotoPicker;
+- (void)setOriginalImage:(UIImage *)aImage resizedImage:(UIImage *)bImage;
+
+@end
View
183 EssentialImagerDemo/EssentialImagerDemo/Simple Demo/EISimpleDemoViewController.m
@@ -0,0 +1,183 @@
+/*
+
+ File: EIDemoViewController.m
+ Abstract: Demo Controller to show usage of image picker with blocks,
+ and subsequent resizing, saving, clipping and masking of returned image
+
+ Copyright (c) 2012 Dillion Tan
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+ */
+
+#import "EISimpleDemoViewController.h"
+
+@interface EISimpleDemoViewController ()
+
+@end
+
+@implementation EISimpleDemoViewController
+
+@synthesize buttonWithImage;
+@synthesize imageViewWithRoundedCorners;
+@synthesize imagePickerDelegate;
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+ // Custom initialization
+ }
+ return self;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ // Do any additional setup after loading the view.
+
+ // show how a button looks with returned image set as button image without resizing
+ self.buttonWithImage = [[UIButton alloc] initWithFrame:CGRectMake(70, 40, 180, 180)];
+ buttonWithImage.layer.cornerRadius = 20.0f;
+ buttonWithImage.layer.borderColor = [UIColor blueColor].CGColor;
+ buttonWithImage.layer.borderWidth = 1.0f;
+ [buttonWithImage setImage:[UIImage imageNamed:@"Icon.png"] forState:UIControlStateNormal];
+ [buttonWithImage addTarget:self action:@selector(presentPhotoPicker) forControlEvents:UIControlEventTouchUpInside];
+ [self.view addSubview:buttonWithImage];
+
+ // displaying the image in a rounded rect
+ UIImageView *backingViewForRoundedCorner = [[UIImageView alloc] initWithFrame:CGRectMake(70, 260, 180, 180)];
+ backingViewForRoundedCorner.layer.cornerRadius = 20.0f;
+ backingViewForRoundedCorner.clipsToBounds = YES;
+ [self.view addSubview:backingViewForRoundedCorner];
+
+ self.imageViewWithRoundedCorners = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 180, 180)];
+ imageViewWithRoundedCorners.backgroundColor = [UIColor lightGrayColor];
+ [backingViewForRoundedCorner addSubview:imageViewWithRoundedCorners];
+
+ if ([[NSUserDefaults standardUserDefaults] objectForKey:@"savedImage"]) { // test cached image
+ NSString *urlString = [[NSUserDefaults standardUserDefaults] objectForKey:@"savedImage"];
+
+ UIImage *cachedImage = [NSData imageFromFile:[[[NSFileManager defaultManager] cacheDataPath] stringByAppendingPathComponent:urlString]];
+
+ if (cachedImage) {
+ NSLog(@"logical size is %f:%f scale %f", cachedImage.size.width, cachedImage.size.height, cachedImage.scale);
+
+ [self setOriginalImage:[UIImage imageNamed:@"Icon.png"] resizedImage:cachedImage];
+ }
+ }
+
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+
+- (void)presentPhotoPicker
+{
+ if (!imagePickerDelegate) {
+ self.imagePickerDelegate = [[EIImagePickerDelegate alloc] init];
+
+ __weak EISimpleDemoViewController *weakController = self;
+ [imagePickerDelegate setImagePickerCompletionBlock:^(UIImage *pickerImage) {
+
+ __strong EISimpleDemoViewController *strongController = weakController;
+
+ NSLog(@"logical size is %f:%f scale %f", pickerImage.size.width, pickerImage.size.height, pickerImage.scale);
+
+ // Use display size to constrain resizing
+ // 120 is the logical display size
+ UIImage *resizedImage = [pickerImage resizedImageWithContentMode:UIViewContentModeScaleAspectFill bounds:CGSizeMake(180, 180) interpolationQuality:kCGInterpolationDefault];
+
+ // Use uncompressed size to constrain resizing
+ // UIImage *resizedImage = [pickerImage resizedImageWithUncompressedSizeInMB:1.0 interpolationQuality:kCGInterpolationDefault];
+
+ NSLog(@"logical size is %f:%f scale %f", resizedImage.size.width, resizedImage.size.height, resizedImage.scale);
+
+ [strongController setOriginalImage:pickerImage resizedImage:resizedImage];
+
+ // remove the image if previously saved
+ if ([[NSUserDefaults standardUserDefaults] objectForKey:@"savedImage"]) {
+ NSString *cachedFilePath = [[NSUserDefaults standardUserDefaults] objectForKey:@"savedImage"];
+ [[NSFileManager defaultManager] removeItemAtURL:[NSURL URLWithString:cachedFilePath] error:NULL];
+ }
+
+ NSString *assetName = [NSString stringWithFormat:@"%@.png", [[NSProcessInfo processInfo] globallyUniqueString]];
+ assetName = [assetName stringByAppendingScaleSuffix]; // add scale suffix to extension
+ NSString *assetPath = [[[NSFileManager defaultManager] cacheDataPath] stringByAppendingPathComponent:assetName];
+
+ // saving synchronously
+ // [UIImagePNGRepresentation(resizedImage) writeToFile:assetPath atomically:NO];
+ // [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%@", assetName] forKey:@"savedImage"];
+
+ [[EIOperationManager defaultManager] saveImage:resizedImage toPath:assetPath withBlock:^(BOOL success) {
+ [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%@", assetName] forKey:@"savedImage"];
+ }];
+
+ }];
+ }
+
+ if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
+ UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Photo Library", @"Camera", nil];
+ [actionSheet showInView:self.view];
+
+ } else {
+ UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Photo Library", nil];
+ [actionSheet showInView:self.view];
+ }
+}
+
+- (void)setOriginalImage:(UIImage *)aImage resizedImage:(UIImage *)bImage
+{
+ [buttonWithImage setImage:aImage forState:UIControlStateNormal];
+
+ imageViewWithRoundedCorners.image = bImage;
+ imageViewWithRoundedCorners.frame = CGRectMake(0, 0, bImage.size.width, bImage.size.height);
+ imageViewWithRoundedCorners.center = CGPointMake(imageViewWithRoundedCorners.superview.frame.size.width/2, imageViewWithRoundedCorners.superview.frame.size.height/2);
+}
+
+# pragma mark -
+# pragma mark UIActionSheetDelegate
+
+- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
+ switch (buttonIndex) {
+ case 0:
+ [imagePickerDelegate presentFromController:self withSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
+ break;
+ case 1:
+ if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
+ [imagePickerDelegate presentFromController:self withSourceType:UIImagePickerControllerSourceTypeCamera];
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+@end
View
17 EssentialImagerDemo/EssentialImagerDemo/Simple Demo/SimpleDemoAppDelegate.h
@@ -0,0 +1,17 @@
+//
+// AppDelegate.h
+// EssentialImager
+//
+// Created by Dillion Tan on 9/7/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "EISimpleDemoViewController.h"
+
+@interface SimpleDemoAppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+@property (nonatomic, strong) EISimpleDemoViewController *rootViewController;
+
+@end
View
55 EssentialImagerDemo/EssentialImagerDemo/Simple Demo/SimpleDemoAppDelegate.m
@@ -0,0 +1,55 @@
+//
+// AppDelegate.m
+// EssentialImager
+//
+// Created by Dillion Tan on 9/7/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "SimpleDemoAppDelegate.h"
+
+@implementation SimpleDemoAppDelegate
+
+@synthesize window = _window;
+@synthesize rootViewController;
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ // Override point for customization after application launch.
+ self.window.backgroundColor = [UIColor whiteColor];
+
+ self.window.rootViewController = [[EISimpleDemoViewController alloc] init];
+ [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
17 EssentialImagerDemo/EssentialImagerDemo/Simple Demo/main.m
@@ -0,0 +1,17 @@
+//
+// main.m
+// EssentialImagerDemo
+//
+// Created by Dillion Tan on 14/7/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "SimpleDemoAppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([SimpleDemoAppDelegate class]));
+ }
+}

0 comments on commit 789bae6

Please sign in to comment.
Something went wrong with that request. Please try again.