Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed EGOCache and EGOImageLoading classes and repalced with git su…

…bmodules. Restructured directory structure to avoid clutter. Refactored EGOPhotoController class to EGOPhotoViewController
  • Loading branch information...
commit 7e35e048d7a02bc82dfa857ad75589fb6f5df38d 1 parent 2eb528f
@shnhrrsn shnhrrsn authored
Showing with 156 additions and 881 deletions.
  1. +6 −0 .gitmodules
  2. 0  { → Demo}/Classes/EGOPhotoViewerAppDelegate.h
  3. 0  { → Demo}/Classes/EGOPhotoViewerAppDelegate.m
  4. 0  { → Demo}/Classes/RootViewController.h
  5. +3 −3 { → Demo}/Classes/RootViewController.m
  6. 0  { → Demo}/EGOPhotoViewer-Info.plist
  7. 0  { → Demo}/EGOPhotoViewer.xcodeproj/.dat5f71.d37
  8. +136 −97 { → Demo}/EGOPhotoViewer.xcodeproj/project.pbxproj
  9. 0  { → Demo}/EGOPhotoViewer_Prefix.pch
  10. 0  { → Demo}/MainWindow.xib
  11. 0  { → Demo}/RootViewController.xib
  12. 0  { → Demo}/main.m
  13. +0 −70 EGOCache.h
  14. +0 −295 EGOCache.m
  15. +0 −60 EGOImageLoadConnection.h
  16. +0 −96 EGOImageLoadConnection.m
  17. +0 −57 EGOImageLoader.h
  18. +0 −192 EGOImageLoader.m
  19. +1 −0  Library/EGOCache
  20. +1 −0  Library/EGOImageLoading
  21. 0  { → Library}/EGOPhoto.h
  22. 0  { → Library}/EGOPhoto.m
  23. 0  { → Library}/EGOPhotoCaptionView.h
  24. 0  { → Library}/EGOPhotoCaptionView.m
  25. 0  { → Library}/EGOPhotoImageView.h
  26. 0  { → Library}/EGOPhotoImageView.m
  27. 0  { → Library}/EGOPhotoScrollView.h
  28. 0  { → Library}/EGOPhotoScrollView.m
  29. 0  { → Library}/EGOPhotoSource.h
  30. 0  { → Library}/EGOPhotoSource.m
  31. +1 −1  Classes/EGOPhotoController.h → Library/EGOPhotoViewController.h
  32. +3 −3 Classes/EGOPhotoController.m → Library/EGOPhotoViewController.m
  33. +5 −7 Classes/EGOPhotoController.xib → Library/Resources/EGOPhotoViewController.xib
  34. 0  { → Library/Resources}/caption_bar_bg.png
  35. 0  { → Library/Resources}/error_placeholder.png
  36. 0  { → Library/Resources}/left.png
  37. 0  { → Library/Resources}/photo_placeholder.png
  38. 0  { → Library/Resources}/right.png
View
6 .gitmodules
@@ -0,0 +1,6 @@
+[submodule "Library/EGOCache"]
+ path = Library/EGOCache
+ url = git@github.com:enormego/EGOCache.git
+[submodule "Library/EGOImageLoading"]
+ path = Library/EGOImageLoading
+ url = git@github.com:enormego/EGOImageLoading.git
View
0  Classes/EGOPhotoViewerAppDelegate.h → Demo/Classes/EGOPhotoViewerAppDelegate.h
File renamed without changes
View
0  Classes/EGOPhotoViewerAppDelegate.m → Demo/Classes/EGOPhotoViewerAppDelegate.m
File renamed without changes
View
0  Classes/RootViewController.h → Demo/Classes/RootViewController.h
File renamed without changes
View
6 Classes/RootViewController.m → Demo/Classes/RootViewController.m
@@ -7,7 +7,7 @@
//
#import "RootViewController.h"
-#import "EGOPhotoController.h"
+#import "EGOPhotoViewController.h"
#import "EGOPhotoSource.h"
#import "EGOPhoto.h"
@@ -111,7 +111,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
EGOPhoto *photo4 = [[EGOPhoto alloc] initWithImageURL:[NSURL URLWithString:@"http://qkpic.com/13493"] name:@"title title title"];
EGOPhotoSource *source = [[EGOPhotoSource alloc] initWithEGOPhotos:[NSArray arrayWithObjects:photo, photo2, photo3, photo4, photo, photo2, photo3, photo4, nil]];
- EGOPhotoController *photoController = [[EGOPhotoController alloc] initWithPhotoSource:source];
+ EGOPhotoViewController *photoController = [[EGOPhotoViewController alloc] initWithPhotoSource:source];
[self.navigationController pushViewController:photoController animated:YES];
[photoController release];
[photo release];
@@ -124,7 +124,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
EGOPhoto *photo = [[EGOPhoto alloc] initWithImageURL:[NSURL URLWithString:@"https://s3.amazonaws.com/twitter_production/profile_images/425948730/DF-Star-Logo.png"]];
EGOPhotoSource *source = [[EGOPhotoSource alloc] initWithEGOPhotos:[NSArray arrayWithObjects:photo, nil]];
- EGOPhotoController *photoController = [[EGOPhotoController alloc] initWithPhotoSource:source];
+ EGOPhotoViewController *photoController = [[EGOPhotoViewController alloc] initWithPhotoSource:source];
[self.navigationController pushViewController:photoController animated:YES];
[photoController release];
[photo release];
View
0  EGOPhotoViewer-Info.plist → Demo/EGOPhotoViewer-Info.plist
File renamed without changes
View
0  EGOPhotoViewer.xcodeproj/.dat5f71.d37 → Demo/EGOPhotoViewer.xcodeproj/.dat5f71.d37
File renamed without changes
View
233 EGOPhotoViewer.xcodeproj/project.pbxproj → Demo/EGOPhotoViewer.xcodeproj/project.pbxproj
@@ -7,17 +7,9 @@
objects = {
/* Begin PBXBuildFile section */
- 037D16D910F8232900E41771 /* EGOPhotoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 037D16D710F8232900E41771 /* EGOPhotoController.m */; };
- 037D16DA10F8232900E41771 /* EGOPhotoController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 037D16D810F8232900E41771 /* EGOPhotoController.xib */; };
- 037D16E210F824C600E41771 /* EGOPhotoImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 037D16E110F824C600E41771 /* EGOPhotoImageView.m */; };
- 037D170410F8264500E41771 /* EGOCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 037D170310F8264500E41771 /* EGOCache.m */; };
- 037D170D10F8268300E41771 /* EGOImageLoadConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 037D170A10F8268300E41771 /* EGOImageLoadConnection.m */; };
- 037D170E10F8268300E41771 /* EGOImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 037D170C10F8268300E41771 /* EGOImageLoader.m */; };
- 037D176310F82BE800E41771 /* EGOPhotoSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 037D176210F82BE800E41771 /* EGOPhotoSource.m */; };
- 037D176810F82C2600E41771 /* EGOPhoto.m in Sources */ = {isa = PBXBuildFile; fileRef = 037D176710F82C2600E41771 /* EGOPhoto.m */; };
+ 037D16D910F8232900E41771 /* EGOPhotoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 037D16D710F8232900E41771 /* EGOPhotoViewController.m */; };
+ 037D16DA10F8232900E41771 /* EGOPhotoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 037D16D810F8232900E41771 /* EGOPhotoViewController.xib */; };
037D182B10F90B0C00E41771 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 037D182A10F90B0C00E41771 /* MessageUI.framework */; };
- 037D2E1410FA548600E41771 /* left.png in Resources */ = {isa = PBXBuildFile; fileRef = 037D2E1210FA548600E41771 /* left.png */; };
- 037D2E1510FA548600E41771 /* right.png in Resources */ = {isa = PBXBuildFile; fileRef = 037D2E1310FA548600E41771 /* right.png */; };
1D3623260D0F684500981E51 /* EGOPhotoViewerAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* EGOPhotoViewerAppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
@@ -25,34 +17,30 @@
2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; };
28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD735F0D9D9599002E5188 /* MainWindow.xib */; };
28C286E10D94DF7D0034E888 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28C286E00D94DF7D0034E888 /* RootViewController.m */; };
+ 28CB5A7111065AC5004FF608 /* EGOPhoto.m in Sources */ = {isa = PBXBuildFile; fileRef = 28CB5A7011065AC5004FF608 /* EGOPhoto.m */; };
+ 28CB5A7411065AD0004FF608 /* EGOPhotoSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 28CB5A7311065AD0004FF608 /* EGOPhotoSource.m */; };
+ 28CB5A7711065AD9004FF608 /* EGOPhotoCaptionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28CB5A7611065AD9004FF608 /* EGOPhotoCaptionView.m */; };
+ 28CB5A7A11065AE1004FF608 /* EGOPhotoScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28CB5A7911065AE1004FF608 /* EGOPhotoScrollView.m */; };
+ 28CB5A7D11065AEC004FF608 /* EGOPhotoImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28CB5A7C11065AEC004FF608 /* EGOPhotoImageView.m */; };
+ 28CB5B0C11065B5B004FF608 /* EGOCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 28CB5AAE11065B5B004FF608 /* EGOCache.m */; };
+ 28CB5B2F11065B5B004FF608 /* EGOImageButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 28CB5AED11065B5B004FF608 /* EGOImageButton.m */; };
+ 28CB5B3011065B5B004FF608 /* EGOImageLoadConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 28CB5AF011065B5B004FF608 /* EGOImageLoadConnection.m */; };
+ 28CB5B3111065B5B004FF608 /* EGOImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 28CB5AF211065B5B004FF608 /* EGOImageLoader.m */; };
+ 28CB5B3211065B5B004FF608 /* EGOImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28CB5AF511065B5B004FF608 /* EGOImageView.m */; };
+ 28CB5B4511065BA0004FF608 /* caption_bar_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 28CB5B4011065BA0004FF608 /* caption_bar_bg.png */; };
+ 28CB5B4611065BA0004FF608 /* error_placeholder.png in Resources */ = {isa = PBXBuildFile; fileRef = 28CB5B4111065BA0004FF608 /* error_placeholder.png */; };
+ 28CB5B4711065BA0004FF608 /* left.png in Resources */ = {isa = PBXBuildFile; fileRef = 28CB5B4211065BA0004FF608 /* left.png */; };
+ 28CB5B4811065BA0004FF608 /* photo_placeholder.png in Resources */ = {isa = PBXBuildFile; fileRef = 28CB5B4311065BA0004FF608 /* photo_placeholder.png */; };
+ 28CB5B4911065BA0004FF608 /* right.png in Resources */ = {isa = PBXBuildFile; fileRef = 28CB5B4411065BA0004FF608 /* right.png */; };
28F335F11007B36200424DE2 /* RootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28F335F01007B36200424DE2 /* RootViewController.xib */; };
- 3A88BE2810FBBFAC00781EFC /* EGOPhotoScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A88BE2710FBBFAC00781EFC /* EGOPhotoScrollView.m */; };
- D071EF5311025B6000CB086D /* photo_placeholder.png in Resources */ = {isa = PBXBuildFile; fileRef = D071EF5111025B6000CB086D /* photo_placeholder.png */; };
- D071EF5411025B6000CB086D /* error_placeholder.png in Resources */ = {isa = PBXBuildFile; fileRef = D071EF5211025B6000CB086D /* error_placeholder.png */; };
D071EF5C11025D3F00CB086D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D071EF5B11025D3F00CB086D /* QuartzCore.framework */; };
- D071EF851102600E00CB086D /* EGOPhotoCaptionView.m in Sources */ = {isa = PBXBuildFile; fileRef = D071EF841102600E00CB086D /* EGOPhotoCaptionView.m */; };
- D071EF89110260A900CB086D /* caption_bar_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = D071EF88110260A900CB086D /* caption_bar_bg.png */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
- 037D16D610F8232900E41771 /* EGOPhotoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOPhotoController.h; sourceTree = "<group>"; };
- 037D16D710F8232900E41771 /* EGOPhotoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOPhotoController.m; sourceTree = "<group>"; };
- 037D16D810F8232900E41771 /* EGOPhotoController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EGOPhotoController.xib; sourceTree = "<group>"; };
- 037D16E010F824C600E41771 /* EGOPhotoImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOPhotoImageView.h; sourceTree = "<group>"; };
- 037D16E110F824C600E41771 /* EGOPhotoImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOPhotoImageView.m; sourceTree = "<group>"; wrapsLines = 1; };
- 037D170210F8264500E41771 /* EGOCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOCache.h; sourceTree = "<group>"; };
- 037D170310F8264500E41771 /* EGOCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOCache.m; sourceTree = "<group>"; };
- 037D170910F8268300E41771 /* EGOImageLoadConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOImageLoadConnection.h; sourceTree = "<group>"; };
- 037D170A10F8268300E41771 /* EGOImageLoadConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOImageLoadConnection.m; sourceTree = "<group>"; };
- 037D170B10F8268300E41771 /* EGOImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOImageLoader.h; sourceTree = "<group>"; };
- 037D170C10F8268300E41771 /* EGOImageLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOImageLoader.m; sourceTree = "<group>"; };
- 037D176110F82BE800E41771 /* EGOPhotoSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOPhotoSource.h; sourceTree = "<group>"; };
- 037D176210F82BE800E41771 /* EGOPhotoSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOPhotoSource.m; sourceTree = "<group>"; };
- 037D176610F82C2600E41771 /* EGOPhoto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOPhoto.h; sourceTree = "<group>"; };
- 037D176710F82C2600E41771 /* EGOPhoto.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOPhoto.m; sourceTree = "<group>"; };
+ 037D16D610F8232900E41771 /* EGOPhotoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOPhotoViewController.h; sourceTree = "<group>"; };
+ 037D16D710F8232900E41771 /* EGOPhotoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOPhotoViewController.m; sourceTree = "<group>"; };
+ 037D16D810F8232900E41771 /* EGOPhotoViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = EGOPhotoViewController.xib; path = Resources/EGOPhotoViewController.xib; sourceTree = "<group>"; };
037D182A10F90B0C00E41771 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
- 037D2E1210FA548600E41771 /* left.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = left.png; sourceTree = "<group>"; };
- 037D2E1310FA548600E41771 /* right.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = right.png; sourceTree = "<group>"; };
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* EGOPhotoViewerAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOPhotoViewerAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* EGOPhotoViewerAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOPhotoViewerAppDelegate.m; sourceTree = "<group>"; };
@@ -63,17 +51,35 @@
28AD735F0D9D9599002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
28C286DF0D94DF7D0034E888 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = "<group>"; };
28C286E00D94DF7D0034E888 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = "<group>"; };
+ 28CB5A6F11065AC5004FF608 /* EGOPhoto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EGOPhoto.h; path = ../Library/EGOPhoto.h; sourceTree = SOURCE_ROOT; };
+ 28CB5A7011065AC5004FF608 /* EGOPhoto.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EGOPhoto.m; path = ../Library/EGOPhoto.m; sourceTree = SOURCE_ROOT; };
+ 28CB5A7211065AD0004FF608 /* EGOPhotoSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EGOPhotoSource.h; path = ../Library/EGOPhotoSource.h; sourceTree = SOURCE_ROOT; };
+ 28CB5A7311065AD0004FF608 /* EGOPhotoSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EGOPhotoSource.m; path = ../Library/EGOPhotoSource.m; sourceTree = SOURCE_ROOT; };
+ 28CB5A7511065AD9004FF608 /* EGOPhotoCaptionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EGOPhotoCaptionView.h; path = ../Library/EGOPhotoCaptionView.h; sourceTree = SOURCE_ROOT; };
+ 28CB5A7611065AD9004FF608 /* EGOPhotoCaptionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EGOPhotoCaptionView.m; path = ../Library/EGOPhotoCaptionView.m; sourceTree = SOURCE_ROOT; };
+ 28CB5A7811065AE1004FF608 /* EGOPhotoScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EGOPhotoScrollView.h; path = ../Library/EGOPhotoScrollView.h; sourceTree = SOURCE_ROOT; };
+ 28CB5A7911065AE1004FF608 /* EGOPhotoScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EGOPhotoScrollView.m; path = ../Library/EGOPhotoScrollView.m; sourceTree = SOURCE_ROOT; };
+ 28CB5A7B11065AEC004FF608 /* EGOPhotoImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EGOPhotoImageView.h; path = ../Library/EGOPhotoImageView.h; sourceTree = SOURCE_ROOT; };
+ 28CB5A7C11065AEC004FF608 /* EGOPhotoImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EGOPhotoImageView.m; path = ../Library/EGOPhotoImageView.m; sourceTree = SOURCE_ROOT; };
+ 28CB5AAD11065B5B004FF608 /* EGOCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOCache.h; sourceTree = "<group>"; };
+ 28CB5AAE11065B5B004FF608 /* EGOCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOCache.m; sourceTree = "<group>"; };
+ 28CB5AEC11065B5B004FF608 /* EGOImageButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOImageButton.h; sourceTree = "<group>"; };
+ 28CB5AED11065B5B004FF608 /* EGOImageButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOImageButton.m; sourceTree = "<group>"; };
+ 28CB5AEF11065B5B004FF608 /* EGOImageLoadConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOImageLoadConnection.h; sourceTree = "<group>"; };
+ 28CB5AF011065B5B004FF608 /* EGOImageLoadConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOImageLoadConnection.m; sourceTree = "<group>"; };
+ 28CB5AF111065B5B004FF608 /* EGOImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOImageLoader.h; sourceTree = "<group>"; };
+ 28CB5AF211065B5B004FF608 /* EGOImageLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOImageLoader.m; sourceTree = "<group>"; };
+ 28CB5AF411065B5B004FF608 /* EGOImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOImageView.h; sourceTree = "<group>"; };
+ 28CB5AF511065B5B004FF608 /* EGOImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOImageView.m; sourceTree = "<group>"; };
+ 28CB5B4011065BA0004FF608 /* caption_bar_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = caption_bar_bg.png; path = ../Library/Resources/caption_bar_bg.png; sourceTree = SOURCE_ROOT; };
+ 28CB5B4111065BA0004FF608 /* error_placeholder.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = error_placeholder.png; path = ../Library/Resources/error_placeholder.png; sourceTree = SOURCE_ROOT; };
+ 28CB5B4211065BA0004FF608 /* left.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = left.png; path = ../Library/Resources/left.png; sourceTree = SOURCE_ROOT; };
+ 28CB5B4311065BA0004FF608 /* photo_placeholder.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = photo_placeholder.png; path = ../Library/Resources/photo_placeholder.png; sourceTree = SOURCE_ROOT; };
+ 28CB5B4411065BA0004FF608 /* right.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = right.png; path = ../Library/Resources/right.png; sourceTree = SOURCE_ROOT; };
28F335F01007B36200424DE2 /* RootViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RootViewController.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- 3A88BE2610FBBFAC00781EFC /* EGOPhotoScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOPhotoScrollView.h; sourceTree = "<group>"; };
- 3A88BE2710FBBFAC00781EFC /* EGOPhotoScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOPhotoScrollView.m; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* EGOPhotoViewer-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "EGOPhotoViewer-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
- D071EF5111025B6000CB086D /* photo_placeholder.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = photo_placeholder.png; sourceTree = "<group>"; };
- D071EF5211025B6000CB086D /* error_placeholder.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = error_placeholder.png; sourceTree = "<group>"; };
D071EF5B11025D3F00CB086D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
- D071EF831102600E00CB086D /* EGOPhotoCaptionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOPhotoCaptionView.h; sourceTree = "<group>"; };
- D071EF841102600E00CB086D /* EGOPhotoCaptionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOPhotoCaptionView.m; sourceTree = "<group>"; };
- D071EF88110260A900CB086D /* caption_bar_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = caption_bar_bg.png; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -92,14 +98,15 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
- 037D16D310F8230400E41771 /* EGOPhotoViewerController */ = {
+ 037D16D310F8230400E41771 /* Library */ = {
isa = PBXGroup;
children = (
- 037D16D610F8232900E41771 /* EGOPhotoController.h */,
- 037D16D710F8232900E41771 /* EGOPhotoController.m */,
- 037D16D810F8232900E41771 /* EGOPhotoController.xib */,
+ 037D16D610F8232900E41771 /* EGOPhotoViewController.h */,
+ 037D16D710F8232900E41771 /* EGOPhotoViewController.m */,
+ 037D16D810F8232900E41771 /* EGOPhotoViewController.xib */,
);
- name = EGOPhotoViewerController;
+ name = Library;
+ path = ../../Library;
sourceTree = "<group>";
};
037D16DD10F824A100E41771 /* Views */ = {
@@ -115,8 +122,8 @@
037D16DF10F824B400E41771 /* EGOPhotoImageView */ = {
isa = PBXGroup;
children = (
- 037D16E010F824C600E41771 /* EGOPhotoImageView.h */,
- 037D16E110F824C600E41771 /* EGOPhotoImageView.m */,
+ 28CB5A7B11065AEC004FF608 /* EGOPhotoImageView.h */,
+ 28CB5A7C11065AEC004FF608 /* EGOPhotoImageView.m */,
);
name = EGOPhotoImageView;
sourceTree = "<group>";
@@ -124,32 +131,12 @@
037D16E910F8262D00E41771 /* Libraries */ = {
isa = PBXGroup;
children = (
- 037D170510F8264B00E41771 /* EGOImageLoader */,
- 037D16FE10F8263B00E41771 /* EGOCache */,
+ 28CB5A8811065B5B004FF608 /* EGOCache */,
+ 28CB5AAF11065B5B004FF608 /* EGOImageLoading */,
);
name = Libraries;
sourceTree = "<group>";
};
- 037D16FE10F8263B00E41771 /* EGOCache */ = {
- isa = PBXGroup;
- children = (
- 037D170210F8264500E41771 /* EGOCache.h */,
- 037D170310F8264500E41771 /* EGOCache.m */,
- );
- name = EGOCache;
- sourceTree = "<group>";
- };
- 037D170510F8264B00E41771 /* EGOImageLoader */ = {
- isa = PBXGroup;
- children = (
- 037D170910F8268300E41771 /* EGOImageLoadConnection.h */,
- 037D170A10F8268300E41771 /* EGOImageLoadConnection.m */,
- 037D170B10F8268300E41771 /* EGOImageLoader.h */,
- 037D170C10F8268300E41771 /* EGOImageLoader.m */,
- );
- name = EGOImageLoader;
- sourceTree = "<group>";
- };
037D175910F82B8700E41771 /* Model */ = {
isa = PBXGroup;
children = (
@@ -162,8 +149,8 @@
037D175A10F82B9800E41771 /* EGOPhotoSource */ = {
isa = PBXGroup;
children = (
- 037D176110F82BE800E41771 /* EGOPhotoSource.h */,
- 037D176210F82BE800E41771 /* EGOPhotoSource.m */,
+ 28CB5A7211065AD0004FF608 /* EGOPhotoSource.h */,
+ 28CB5A7311065AD0004FF608 /* EGOPhotoSource.m */,
);
name = EGOPhotoSource;
sourceTree = "<group>";
@@ -171,8 +158,8 @@
037D176510F82C1B00E41771 /* EGOPhoto */ = {
isa = PBXGroup;
children = (
- 037D176610F82C2600E41771 /* EGOPhoto.h */,
- 037D176710F82C2600E41771 /* EGOPhoto.m */,
+ 28CB5A6F11065AC5004FF608 /* EGOPhoto.h */,
+ 28CB5A7011065AC5004FF608 /* EGOPhoto.m */,
);
name = EGOPhoto;
sourceTree = "<group>";
@@ -180,7 +167,7 @@
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
- 037D16D310F8230400E41771 /* EGOPhotoViewerController */,
+ 037D16D310F8230400E41771 /* Library */,
28C286DF0D94DF7D0034E888 /* RootViewController.h */,
28C286E00D94DF7D0034E888 /* RootViewController.m */,
1D3623240D0F684500981E51 /* EGOPhotoViewerAppDelegate.h */,
@@ -197,6 +184,56 @@
name = Products;
sourceTree = "<group>";
};
+ 28CB5A8811065B5B004FF608 /* EGOCache */ = {
+ isa = PBXGroup;
+ children = (
+ 28CB5AAD11065B5B004FF608 /* EGOCache.h */,
+ 28CB5AAE11065B5B004FF608 /* EGOCache.m */,
+ );
+ name = EGOCache;
+ path = ../Library/EGOCache;
+ sourceTree = SOURCE_ROOT;
+ };
+ 28CB5AAF11065B5B004FF608 /* EGOImageLoading */ = {
+ isa = PBXGroup;
+ children = (
+ 28CB5AEB11065B5B004FF608 /* EGOImageButton */,
+ 28CB5AEE11065B5B004FF608 /* EGOImageLoader */,
+ 28CB5AF311065B5B004FF608 /* EGOImageView */,
+ );
+ name = EGOImageLoading;
+ path = ../Library/EGOImageLoading;
+ sourceTree = SOURCE_ROOT;
+ };
+ 28CB5AEB11065B5B004FF608 /* EGOImageButton */ = {
+ isa = PBXGroup;
+ children = (
+ 28CB5AEC11065B5B004FF608 /* EGOImageButton.h */,
+ 28CB5AED11065B5B004FF608 /* EGOImageButton.m */,
+ );
+ path = EGOImageButton;
+ sourceTree = "<group>";
+ };
+ 28CB5AEE11065B5B004FF608 /* EGOImageLoader */ = {
+ isa = PBXGroup;
+ children = (
+ 28CB5AEF11065B5B004FF608 /* EGOImageLoadConnection.h */,
+ 28CB5AF011065B5B004FF608 /* EGOImageLoadConnection.m */,
+ 28CB5AF111065B5B004FF608 /* EGOImageLoader.h */,
+ 28CB5AF211065B5B004FF608 /* EGOImageLoader.m */,
+ );
+ path = EGOImageLoader;
+ sourceTree = "<group>";
+ };
+ 28CB5AF311065B5B004FF608 /* EGOImageView */ = {
+ isa = PBXGroup;
+ children = (
+ 28CB5AF411065B5B004FF608 /* EGOImageView.h */,
+ 28CB5AF511065B5B004FF608 /* EGOImageView.m */,
+ );
+ path = EGOImageView;
+ sourceTree = "<group>";
+ };
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
@@ -226,11 +263,11 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
- D071EF88110260A900CB086D /* caption_bar_bg.png */,
- D071EF5111025B6000CB086D /* photo_placeholder.png */,
- D071EF5211025B6000CB086D /* error_placeholder.png */,
- 037D2E1210FA548600E41771 /* left.png */,
- 037D2E1310FA548600E41771 /* right.png */,
+ 28CB5B4011065BA0004FF608 /* caption_bar_bg.png */,
+ 28CB5B4111065BA0004FF608 /* error_placeholder.png */,
+ 28CB5B4211065BA0004FF608 /* left.png */,
+ 28CB5B4311065BA0004FF608 /* photo_placeholder.png */,
+ 28CB5B4411065BA0004FF608 /* right.png */,
28F335F01007B36200424DE2 /* RootViewController.xib */,
28AD735F0D9D9599002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* EGOPhotoViewer-Info.plist */,
@@ -251,8 +288,8 @@
3A88BE2510FBBF8E00781EFC /* EGOPhotoScrollView */ = {
isa = PBXGroup;
children = (
- 3A88BE2610FBBFAC00781EFC /* EGOPhotoScrollView.h */,
- 3A88BE2710FBBFAC00781EFC /* EGOPhotoScrollView.m */,
+ 28CB5A7811065AE1004FF608 /* EGOPhotoScrollView.h */,
+ 28CB5A7911065AE1004FF608 /* EGOPhotoScrollView.m */,
);
name = EGOPhotoScrollView;
sourceTree = "<group>";
@@ -260,8 +297,8 @@
D071EF7F11025FF200CB086D /* EGOPhotoCaptionView */ = {
isa = PBXGroup;
children = (
- D071EF831102600E00CB086D /* EGOPhotoCaptionView.h */,
- D071EF841102600E00CB086D /* EGOPhotoCaptionView.m */,
+ 28CB5A7511065AD9004FF608 /* EGOPhotoCaptionView.h */,
+ 28CB5A7611065AD9004FF608 /* EGOPhotoCaptionView.m */,
);
name = EGOPhotoCaptionView;
sourceTree = "<group>";
@@ -317,12 +354,12 @@
files = (
28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */,
28F335F11007B36200424DE2 /* RootViewController.xib in Resources */,
- 037D16DA10F8232900E41771 /* EGOPhotoController.xib in Resources */,
- 037D2E1410FA548600E41771 /* left.png in Resources */,
- 037D2E1510FA548600E41771 /* right.png in Resources */,
- D071EF5311025B6000CB086D /* photo_placeholder.png in Resources */,
- D071EF5411025B6000CB086D /* error_placeholder.png in Resources */,
- D071EF89110260A900CB086D /* caption_bar_bg.png in Resources */,
+ 037D16DA10F8232900E41771 /* EGOPhotoViewController.xib in Resources */,
+ 28CB5B4511065BA0004FF608 /* caption_bar_bg.png in Resources */,
+ 28CB5B4611065BA0004FF608 /* error_placeholder.png in Resources */,
+ 28CB5B4711065BA0004FF608 /* left.png in Resources */,
+ 28CB5B4811065BA0004FF608 /* photo_placeholder.png in Resources */,
+ 28CB5B4911065BA0004FF608 /* right.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -336,15 +373,17 @@
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* EGOPhotoViewerAppDelegate.m in Sources */,
28C286E10D94DF7D0034E888 /* RootViewController.m in Sources */,
- 037D16D910F8232900E41771 /* EGOPhotoController.m in Sources */,
- 037D16E210F824C600E41771 /* EGOPhotoImageView.m in Sources */,
- 037D170410F8264500E41771 /* EGOCache.m in Sources */,
- 037D170D10F8268300E41771 /* EGOImageLoadConnection.m in Sources */,
- 037D170E10F8268300E41771 /* EGOImageLoader.m in Sources */,
- 037D176310F82BE800E41771 /* EGOPhotoSource.m in Sources */,
- 037D176810F82C2600E41771 /* EGOPhoto.m in Sources */,
- 3A88BE2810FBBFAC00781EFC /* EGOPhotoScrollView.m in Sources */,
- D071EF851102600E00CB086D /* EGOPhotoCaptionView.m in Sources */,
+ 037D16D910F8232900E41771 /* EGOPhotoViewController.m in Sources */,
+ 28CB5A7111065AC5004FF608 /* EGOPhoto.m in Sources */,
+ 28CB5A7411065AD0004FF608 /* EGOPhotoSource.m in Sources */,
+ 28CB5A7711065AD9004FF608 /* EGOPhotoCaptionView.m in Sources */,
+ 28CB5A7A11065AE1004FF608 /* EGOPhotoScrollView.m in Sources */,
+ 28CB5A7D11065AEC004FF608 /* EGOPhotoImageView.m in Sources */,
+ 28CB5B0C11065B5B004FF608 /* EGOCache.m in Sources */,
+ 28CB5B2F11065B5B004FF608 /* EGOImageButton.m in Sources */,
+ 28CB5B3011065B5B004FF608 /* EGOImageLoadConnection.m in Sources */,
+ 28CB5B3111065B5B004FF608 /* EGOImageLoader.m in Sources */,
+ 28CB5B3211065B5B004FF608 /* EGOImageView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
0  EGOPhotoViewer_Prefix.pch → Demo/EGOPhotoViewer_Prefix.pch
File renamed without changes
View
0  MainWindow.xib → Demo/MainWindow.xib
File renamed without changes
View
0  RootViewController.xib → Demo/RootViewController.xib
File renamed without changes
View
0  main.m → Demo/main.m
File renamed without changes
View
70 EGOCache.h
@@ -1,70 +0,0 @@
-//
-// EGOCache.h
-// enormego
-//
-// Created by Shaun Harrison on 7/4/09.
-// Copyright (c) 2009-2010 enormego
-//
-// 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 <Foundation/Foundation.h>
-
-
-@interface EGOCache : NSObject {
-@private
- NSMutableDictionary* cacheDictionary;
- NSOperationQueue* diskOperationQueue;
- NSTimeInterval defaultTimeoutInterval;
-}
-
-+ (EGOCache*)currentCache;
-
-- (void)clearCache;
-- (void)removeCacheForKey:(NSString*)key;
-
-- (BOOL)hasCacheForKey:(NSString*)key;
-
-- (NSData*)dataForKey:(NSString*)key;
-- (void)setData:(NSData*)data forKey:(NSString*)key;
-- (void)setData:(NSData*)data forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval;
-
-- (NSString*)stringForKey:(NSString*)key;
-- (void)setString:(NSString*)aString forKey:(NSString*)key;
-- (void)setString:(NSString*)aString forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval;
-
-#if TARGET_OS_IPHONE
-- (UIImage*)imageForKey:(NSString*)key;
-- (void)setImage:(UIImage*)anImage forKey:(NSString*)key;
-- (void)setImage:(UIImage*)anImage forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval;
-#else
-- (NSImage*)imageForKey:(NSString*)key;
-- (void)setImage:(NSImage*)anImage forKey:(NSString*)key;
-- (void)setImage:(NSImage*)anImage forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval;
-#endif
-
-- (NSData*)plistForKey:(NSString*)key;
-- (void)setPlist:(id)plistObject forKey:(NSString*)key;
-- (void)setPlist:(id)plistObject forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval;
-
-- (void)copyFilePath:(NSString*)filePath asKey:(NSString*)key;
-- (void)copyFilePath:(NSString*)filePath asKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval;
-
-@property(nonatomic,assign) NSTimeInterval defaultTimeoutInterval; // Default is 1 day
-@end
View
295 EGOCache.m
@@ -1,295 +0,0 @@
-//
-// EGOCache.m
-// enormego
-//
-// Created by Shaun Harrison on 7/4/09.
-// Copyright (c) 2009-2010 enormego
-//
-// 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 "EGOCache.h"
-
-#if DEBUG
- #define CHECK_FOR_EGOCACHE_PLIST() if([key isEqualToString:@"EGOCache.plist"]) { \
- NSLog(@"EGOCache.plist is a reserved key and can not be modified."); \
- return; }
-#else
- #define CHECK_FOR_EGOCACHE_PLIST() if([key isEqualToString:@"EGOCache.plist"]) return;
-#endif
-
-
-
-static NSString* _EGOCacheDirectory;
-
-static inline NSString* EGOCacheDirectory() {
- if(!_EGOCacheDirectory) {
- NSString* cachesDirectory = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
- _EGOCacheDirectory = [[[cachesDirectory stringByAppendingPathComponent:[[NSProcessInfo processInfo] processName]] stringByAppendingPathComponent:@"EGOCache"] copy];
- }
-
- return _EGOCacheDirectory;
-}
-
-static inline NSString* cachePathForKey(NSString* key) {
- return [EGOCacheDirectory() stringByAppendingPathComponent:key];
-}
-
-static EGOCache* __instance;
-
-@interface EGOCache ()
-- (void)removeItemFromCache:(NSString*)key;
-- (void)performDiskWriteOperation:(NSInvocation *)invoction;
-- (void)saveCacheDictionary;
-@end
-
-#pragma mark -
-
-@implementation EGOCache
-@synthesize defaultTimeoutInterval;
-
-+ (EGOCache*)currentCache {
- @synchronized(self) {
- if(!__instance) {
- __instance = [[EGOCache alloc] init];
- __instance.defaultTimeoutInterval = 86400;
- }
- }
-
- return __instance;
-}
-
-- (id)init {
- if((self = [super init])) {
- NSDictionary* dict = [NSDictionary dictionaryWithContentsOfFile:cachePathForKey(@"EGOCache.plist")];
-
- if([dict isKindOfClass:[NSDictionary class]]) {
- cacheDictionary = [dict mutableCopy];
- } else {
- cacheDictionary = [[NSMutableDictionary alloc] init];
- }
-
- diskOperationQueue = [[NSOperationQueue alloc] init];
-
- [[NSFileManager defaultManager] createDirectoryAtPath:EGOCacheDirectory()
- withIntermediateDirectories:YES
- attributes:nil
- error:NULL];
-
- for(NSString* key in cacheDictionary) {
- NSDate* date = [cacheDictionary objectForKey:key];
- if([[[NSDate date] earlierDate:date] isEqualToDate:date]) {
- [[NSFileManager defaultManager] removeItemAtPath:cachePathForKey(key) error:NULL];
- }
- }
- }
-
- return self;
-}
-
-- (void)clearCache {
- for(NSString* key in [cacheDictionary allKeys]) {
- [self removeItemFromCache:key];
- }
-
- [self saveCacheDictionary];
-}
-
-- (void)removeCacheForKey:(NSString*)key {
- CHECK_FOR_EGOCACHE_PLIST();
-
- [self removeItemFromCache:key];
- [self saveCacheDictionary];
-}
-
-- (void)removeItemFromCache:(NSString*)key {
- NSString* cachePath = cachePathForKey(key);
-
- NSInvocation* deleteInvocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:@selector(deleteDataAtPath:)]];
- [deleteInvocation setTarget:self];
- [deleteInvocation setSelector:@selector(deleteDataAtPath:)];
- [deleteInvocation setArgument:&cachePath atIndex:2];
-
- [self performDiskWriteOperation:deleteInvocation];
- [cacheDictionary removeObjectForKey:key];
-}
-
-- (BOOL)hasCacheForKey:(NSString*)key {
- NSDate* date = [cacheDictionary objectForKey:key];
- if(!date) return NO;
- if([[[NSDate date] earlierDate:date] isEqualToDate:date]) return NO;
- return [[NSFileManager defaultManager] fileExistsAtPath:cachePathForKey(key)];
-}
-
-#pragma mark -
-#pragma mark Copy file methods
-
-- (void)copyFilePath:(NSString*)filePath asKey:(NSString*)key {
- [self copyFilePath:filePath asKey:key withTimeoutInterval:self.defaultTimeoutInterval];
-}
-
-- (void)copyFilePath:(NSString*)filePath asKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval {
- [[NSFileManager defaultManager] copyItemAtPath:filePath toPath:cachePathForKey(key) error:NULL];
- [cacheDictionary setObject:[NSDate dateWithTimeIntervalSinceNow:timeoutInterval] forKey:key];
- [self performSelectorOnMainThread:@selector(saveAfterDelay) withObject:nil waitUntilDone:YES];
-}
-
-#pragma mark -
-#pragma mark Data methods
-
-- (void)setData:(NSData*)data forKey:(NSString*)key {
- [self setData:data forKey:key withTimeoutInterval:self.defaultTimeoutInterval];
-}
-
-- (void)setData:(NSData*)data forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval {
- CHECK_FOR_EGOCACHE_PLIST();
-
- NSString* cachePath = cachePathForKey(key);
- NSInvocation* writeInvocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:@selector(writeData:toPath:)]];
- [writeInvocation setTarget:self];
- [writeInvocation setSelector:@selector(writeData:toPath:)];
- [writeInvocation setArgument:&data atIndex:2];
- [writeInvocation setArgument:&cachePath atIndex:3];
-
- [self performDiskWriteOperation:writeInvocation];
- [cacheDictionary setObject:[NSDate dateWithTimeIntervalSinceNow:timeoutInterval] forKey:key];
-
- [self performSelectorOnMainThread:@selector(saveAfterDelay) withObject:nil waitUntilDone:YES]; // Need to make sure the save delay get scheduled in the main runloop, not the current threads
-}
-
-- (void)saveAfterDelay { // Prevents multiple-rapid saves from happening, which will slow down your app
- [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(saveCacheDictionary) object:nil];
- [self performSelector:@selector(saveCacheDictionary) withObject:nil afterDelay:0.3];
-}
-
-- (NSData*)dataForKey:(NSString*)key {
- if([self hasCacheForKey:key]) {
- return [NSData dataWithContentsOfFile:cachePathForKey(key) options:0 error:NULL];
- } else {
- return nil;
- }
-}
-
-- (void)writeData:(NSData*)data toPath:(NSString *)path; {
- [data writeToFile:path atomically:YES];
-}
-
-- (void)deleteDataAtPath:(NSString *)path {
- [[NSFileManager defaultManager] removeItemAtPath:path error:NULL];
-}
-
-- (void)saveCacheDictionary {
- @synchronized(self) {
- [cacheDictionary writeToFile:cachePathForKey(@"EGOCache.plist") atomically:YES];
- }
-}
-
-#pragma mark -
-#pragma mark String methods
-
-- (NSString*)stringForKey:(NSString*)key {
- return [[[NSString alloc] initWithData:[self dataForKey:key] encoding:NSUTF8StringEncoding] autorelease];
-}
-
-- (void)setString:(NSString*)aString forKey:(NSString*)key {
- [self setString:aString forKey:key withTimeoutInterval:self.defaultTimeoutInterval];
-}
-
-- (void)setString:(NSString*)aString forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval {
- [self setData:[aString dataUsingEncoding:NSUTF8StringEncoding] forKey:key withTimeoutInterval:timeoutInterval];
-}
-
-#pragma mark -
-#pragma mark Image methds
-
-#if TARGET_OS_IPHONE
-
-- (UIImage*)imageForKey:(NSString*)key {
- return [UIImage imageWithData:[self dataForKey:key]];
-}
-
-- (void)setImage:(UIImage*)anImage forKey:(NSString*)key {
- [self setImage:anImage forKey:key withTimeoutInterval:self.defaultTimeoutInterval];
-}
-
-- (void)setImage:(UIImage*)anImage forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval {
- [self setData:UIImagePNGRepresentation(anImage) forKey:key withTimeoutInterval:timeoutInterval];
-}
-
-
-#else
-
-- (NSImage*)imageForKey:(NSString*)key {
- return [[[NSImage alloc] initWithData:[self dataForKey:key]] autorelease];
-}
-
-- (void)setImage:(NSImage*)anImage forKey:(NSString*)key {
- [self setImage:anImage forKey:key withTimeoutInterval:self.defaultTimeoutInterval];
-}
-
-- (void)setImage:(NSImage*)anImage forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval {
- [self setData:[[[anImage representations] objectAtIndex:0] representationUsingType:NSPNGFileType properties:nil]
- forKey:key withTimeoutInterval:timeoutInterval];
-}
-
-#endif
-
-#pragma mark -
-#pragma mark Property List methods
-
-- (NSData*)plistForKey:(NSString*)key; {
- NSData* plistData = [self dataForKey:key];
-
- return [NSPropertyListSerialization propertyListFromData:plistData
- mutabilityOption:NSPropertyListImmutable
- format:nil
- errorDescription:nil];
-}
-
-- (void)setPlist:(id)plistObject forKey:(NSString*)key; {
- [self setPlist:plistObject forKey:key withTimeoutInterval:self.defaultTimeoutInterval];
-}
-
-- (void)setPlist:(id)plistObject forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; {
- // Binary plists are used over XML for better performance
- NSData* plistData = [NSPropertyListSerialization dataFromPropertyList:plistObject
- format:NSPropertyListBinaryFormat_v1_0
- errorDescription:NULL];
-
- [self setData:plistData forKey:key withTimeoutInterval:timeoutInterval];
-}
-
-#pragma mark -
-#pragma mark Disk writing operations
-
-- (void)performDiskWriteOperation:(NSInvocation *)invoction {
- NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithInvocation:invoction];
- [diskOperationQueue addOperation:operation];
- [operation release];
-}
-
-#pragma mark -
-
-- (void)dealloc {
- [diskOperationQueue release];
- [cacheDictionary release];
- [super dealloc];
-}
-
-@end
View
60 EGOImageLoadConnection.h
@@ -1,60 +0,0 @@
-//
-// EGOImageLoadConnection.h
-// EGOImageLoading
-//
-// Created by Shaun Harrison on 12/1/09.
-// Copyright (c) 2009-2010 enormego
-//
-// 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 <Foundation/Foundation.h>
-
-@protocol EGOImageLoadConnectionDelegate;
-
-@interface EGOImageLoadConnection : NSObject {
-@private
- NSURL* _imageURL;
- NSURLResponse* _response;
- NSMutableData* _responseData;
- NSURLConnection* _connection;
- NSTimeInterval _timeoutInterval;
-
- id<EGOImageLoadConnectionDelegate> _delegate;
-}
-
-- (id)initWithImageURL:(NSURL*)aURL delegate:(id)delegate;
-
-- (void)start;
-- (void)cancel;
-
-@property(nonatomic,readonly) NSData* responseData;
-@property(nonatomic,readonly,getter=imageURL) NSURL* imageURL;
-
-@property(nonatomic,retain) NSURLResponse* response;
-@property(nonatomic,assign) id<EGOImageLoadConnectionDelegate> delegate;
-
-@property(nonatomic,assign) NSTimeInterval timeoutInterval; // Default is 30 seconds
-
-@end
-
-@protocol EGOImageLoadConnectionDelegate<NSObject>
-- (void)imageLoadConnectionDidFinishLoading:(EGOImageLoadConnection *)connection;
-- (void)imageLoadConnection:(EGOImageLoadConnection *)connection didFailWithError:(NSError *)error;
-@end
View
96 EGOImageLoadConnection.m
@@ -1,96 +0,0 @@
-//
-// EGOImageLoadConnection.m
-// EGOImageLoading
-//
-// Created by Shaun Harrison on 12/1/09.
-// Copyright (c) 2009-2010 enormego
-//
-// 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 "EGOImageLoadConnection.h"
-
-
-@implementation EGOImageLoadConnection
-@synthesize imageURL=_imageURL, response=_response, delegate=_delegate, timeoutInterval=_timeoutInterval;
-
-- (id)initWithImageURL:(NSURL*)aURL delegate:(id)delegate {
- if((self = [super init])) {
- _imageURL = [aURL retain];
- self.delegate = delegate;
- _responseData = [[NSMutableData alloc] init];
- self.timeoutInterval = 30;
- }
-
- return self;
-}
-
-- (void)start {
- NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:self.imageURL
- cachePolicy:NSURLRequestReturnCacheDataElseLoad
- timeoutInterval:self.timeoutInterval];
- [request setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"];
- _connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
- [request release];
-}
-
-- (void)cancel {
- [_connection cancel];
-}
-
-- (NSData*)responseData {
- return _responseData;
-}
-
-- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
- if(connection != _connection) return;
- [_responseData appendData:data];
-}
-
-- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
- if(connection != _connection) return;
- self.response = response;
-}
-
-- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
- if(connection != _connection) return;
-
- if([self.delegate respondsToSelector:@selector(imageLoadConnectionDidFinishLoading:)]) {
- [self.delegate imageLoadConnectionDidFinishLoading:self];
- }
-}
-
-- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
- if(connection != _connection) return;
-
- if([self.delegate respondsToSelector:@selector(imageLoadConnection:didFailWithError:)]) {
- [self.delegate imageLoadConnection:self didFailWithError:error];
- }
-}
-
-
-- (void)dealloc {
- self.response = nil;
- self.delegate = nil;
- [_connection release];
- [_imageURL release];
- [super dealloc];
-}
-
-@end
View
57 EGOImageLoader.h
@@ -1,57 +0,0 @@
-//
-// EGOImageLoader.h
-// EGOImageLoading
-//
-// Created by Shaun Harrison on 9/15/09.
-// Copyright (c) 2009-2010 enormego
-//
-// 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 <Foundation/Foundation.h>
-
-@protocol EGOImageLoaderObserver;
-@interface EGOImageLoader : NSObject/*<NSURLConnectionDelegate>*/ {
-@private
- NSDictionary* _currentConnections;
- NSMutableDictionary* currentConnections;
-
- NSLock* connectionsLock;
-}
-
-+ (EGOImageLoader*)sharedImageLoader;
-
-- (BOOL)isLoadingImageURL:(NSURL*)aURL;
-- (void)loadImageForURL:(NSURL*)aURL observer:(id<EGOImageLoaderObserver>)observer;
-- (UIImage*)imageForURL:(NSURL*)aURL shouldLoadWithObserver:(id<EGOImageLoaderObserver>)observer;
-- (BOOL)hasLoadedImageURL:(NSURL*)aURL;
-
-- (void)cancelLoadForURL:(NSURL*)aURL;
-
-- (void)removeObserver:(id<EGOImageLoaderObserver>)observer;
-- (void)removeObserver:(id<EGOImageLoaderObserver>)observer forURL:(NSURL*)aURL;
-
-@property(nonatomic,retain) NSDictionary* currentConnections;
-@end
-
-@protocol EGOImageLoaderObserver<NSObject>
-@optional
-- (void)imageLoaderDidLoad:(NSNotification*)notification; // Object will be EGOImageLoader, userInfo will contain imageURL and image
-- (void)imageLoaderDidFailToLoad:(NSNotification*)notification; // Object will be EGOImageLoader, userInfo will contain error
-@end
View
192 EGOImageLoader.m
@@ -1,192 +0,0 @@
-//
-// EGOImageLoader.m
-// EGOImageLoading
-//
-// Created by Shaun Harrison on 9/15/09.
-// Copyright (c) 2009-2010 enormego
-//
-// 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 "EGOImageLoader.h"
-#import "EGOImageLoadConnection.h"
-#import "EGOCache.h"
-
-static EGOImageLoader* __imageLoader;
-
-inline static NSString* keyForURL(NSURL* url) {
- return [NSString stringWithFormat:@"EGOImageLoader-%u", [[url description] hash]];
-}
-
-#define kImageNotificationLoaded(s) [@"kEGOImageLoaderNotificationLoaded-" stringByAppendingString:keyForURL(s)]
-#define kImageNotificationLoadFailed(s) [@"kEGOImageLoaderNotificationLoadFailed-" stringByAppendingString:keyForURL(s)]
-
-@implementation EGOImageLoader
-@synthesize currentConnections=_currentConnections;
-
-+ (EGOImageLoader*)sharedImageLoader {
- @synchronized(self) {
- if(!__imageLoader) {
- __imageLoader = [[[self class] alloc] init];
- }
- }
-
- return __imageLoader;
-}
-
-- (id)init {
- if((self = [super init])) {
- connectionsLock = [[NSLock alloc] init];
- currentConnections = [[NSMutableDictionary alloc] init];
- }
-
- return self;
-}
-
-- (EGOImageLoadConnection*)loadingConnectionForURL:(NSURL*)aURL {
- EGOImageLoadConnection* connection = [[self.currentConnections objectForKey:aURL] retain];
- if(!connection) return nil;
- else return [connection autorelease];
-}
-
-- (void)cleanUpConnection:(EGOImageLoadConnection*)connection {
- if(!connection.imageURL) return;
-
- connection.delegate = nil;
-
- [connectionsLock lock];
- [currentConnections removeObjectForKey:connection.imageURL];
- self.currentConnections = [[currentConnections copy] autorelease];
- [connectionsLock unlock];
-}
-
-- (BOOL)isLoadingImageURL:(NSURL*)aURL {
- return [self loadingConnectionForURL:aURL] ? YES : NO;
-}
-
-- (void)cancelLoadForURL:(NSURL*)aURL {
- EGOImageLoadConnection* connection = [self loadingConnectionForURL:aURL];
- [NSObject cancelPreviousPerformRequestsWithTarget:connection selector:@selector(start) object:nil];
- [connection cancel];
- [self cleanUpConnection:connection];
-}
-
-- (void)loadImageForURL:(NSURL*)aURL observer:(id<EGOImageLoaderObserver>)observer {
- if(!aURL) return;
-
- if([observer respondsToSelector:@selector(imageLoaderDidLoad:)]) {
- [[NSNotificationCenter defaultCenter] addObserver:observer selector:@selector(imageLoaderDidLoad:) name:kImageNotificationLoaded(aURL) object:self];
- }
-
- if([observer respondsToSelector:@selector(imageLoaderDidFailToLoad:)]) {
- [[NSNotificationCenter defaultCenter] addObserver:observer selector:@selector(imageLoaderDidFailToLoad:) name:kImageNotificationLoadFailed(aURL) object:self];
- }
-
- if([self loadingConnectionForURL:aURL]) {
- return;
- }
-
- EGOImageLoadConnection* connection = [[EGOImageLoadConnection alloc] initWithImageURL:aURL delegate:self];
-
- [connectionsLock lock];
- [currentConnections setObject:connection forKey:aURL];
- self.currentConnections = [[currentConnections copy] autorelease];
- [connectionsLock unlock];
- [connection performSelector:@selector(start) withObject:nil afterDelay:0.01];
- [connection release];
-}
-
-- (UIImage*)imageForURL:(NSURL*)aURL shouldLoadWithObserver:(id<EGOImageLoaderObserver>)observer {
- if(!aURL) return nil;
-
- id anImage = [[EGOCache currentCache] imageForKey:keyForURL(aURL)];
-
- if(anImage) {
- return anImage;
- } else {
- [self loadImageForURL:(NSURL*)aURL observer:observer];
- return nil;
- }
-}
-
-- (BOOL)hasLoadedImageURL:(NSURL*)aURL {
- return [[EGOCache currentCache] hasCacheForKey:keyForURL(aURL)];
-}
-
-- (void)removeObserver:(id<EGOImageLoaderObserver>)observer {
- [[NSNotificationCenter defaultCenter] removeObserver:observer name:nil object:self];
-}
-
-- (void)removeObserver:(id<EGOImageLoaderObserver>)observer forURL:(NSURL*)aURL {
- [[NSNotificationCenter defaultCenter] removeObserver:observer name:kImageNotificationLoaded(aURL) object:self];
- [[NSNotificationCenter defaultCenter] removeObserver:observer name:kImageNotificationLoadFailed(aURL) object:self];
-}
-
-#pragma mark -
-#pragma mark URL Connection delegate methods
-
-- (void)imageLoadConnectionDidFinishLoading:(EGOImageLoadConnection *)connection {
- UIImage* anImage = [UIImage imageWithData:connection.responseData];
-
- if(!anImage) {
- NSError* error = [NSError errorWithDomain:[connection.imageURL host] code:406 userInfo:nil];
- NSNotification* notification = [NSNotification notificationWithName:kImageNotificationLoadFailed(connection.imageURL)
- object:self
- userInfo:[NSDictionary dictionaryWithObjectsAndKeys:error,@"error",connection.imageURL,@"imageURL",nil]];
-
- [[NSNotificationCenter defaultCenter] performSelectorOnMainThread:@selector(postNotification:) withObject:notification waitUntilDone:YES];
- } else {
- [[EGOCache currentCache] setData:connection.responseData forKey:keyForURL(connection.imageURL) withTimeoutInterval:604800];
-
- [currentConnections removeObjectForKey:connection.imageURL];
- self.currentConnections = [[currentConnections copy] autorelease];
-
- NSNotification* notification = [NSNotification notificationWithName:kImageNotificationLoaded(connection.imageURL)
- object:self
- userInfo:[NSDictionary dictionaryWithObjectsAndKeys:anImage,@"image",connection.imageURL,@"imageURL",nil]];
-
- [[NSNotificationCenter defaultCenter] performSelectorOnMainThread:@selector(postNotification:) withObject:notification waitUntilDone:YES];
- }
-
- [self cleanUpConnection:connection];
-}
-
-- (void)imageLoadConnection:(EGOImageLoadConnection *)connection didFailWithError:(NSError *)error {
- [currentConnections removeObjectForKey:connection.imageURL];
- self.currentConnections = [[currentConnections copy] autorelease];
-
- NSNotification* notification = [NSNotification notificationWithName:kImageNotificationLoadFailed(connection.imageURL)
- object:self
- userInfo:[NSDictionary dictionaryWithObjectsAndKeys:error,@"error",connection.imageURL,@"imageURL",nil]];
-
- [[NSNotificationCenter defaultCenter] performSelectorOnMainThread:@selector(postNotification:) withObject:notification waitUntilDone:YES];
-
- [self cleanUpConnection:connection];
-}
-
-#pragma mark -
-
-- (void)dealloc {
- self.currentConnections = nil;
- [currentConnections release];
- [connectionsLock release];
- [super dealloc];
-}
-
-@end
1  Library/EGOCache
@@ -0,0 +1 @@
+Subproject commit bb917495a536a69e7612e91b9590872121c9547b
1  Library/EGOImageLoading
@@ -0,0 +1 @@
+Subproject commit 3a28f93ab0fddaeb66a396968abd50dbf0790d67
View
0  EGOPhoto.h → Library/EGOPhoto.h
File renamed without changes
View
0  EGOPhoto.m → Library/EGOPhoto.m
File renamed without changes
View
0  EGOPhotoCaptionView.h → Library/EGOPhotoCaptionView.h
File renamed without changes
View
0  EGOPhotoCaptionView.m → Library/EGOPhotoCaptionView.m
File renamed without changes
View
0  EGOPhotoImageView.h → Library/EGOPhotoImageView.h
File renamed without changes
View
0  EGOPhotoImageView.m → Library/EGOPhotoImageView.m
File renamed without changes
View
0  EGOPhotoScrollView.h → Library/EGOPhotoScrollView.h
File renamed without changes
View
0  EGOPhotoScrollView.m → Library/EGOPhotoScrollView.m
File renamed without changes
View
0  EGOPhotoSource.h → Library/EGOPhotoSource.h
File renamed without changes
View
0  EGOPhotoSource.m → Library/EGOPhotoSource.m
File renamed without changes
View
2  Classes/EGOPhotoController.h → Library/EGOPhotoViewController.h
@@ -12,7 +12,7 @@
@class EGOPhotoImageView, EGOPhotoSource, EGOPhoto, EGOPhotoCaptionView;
-@interface EGOPhotoController : UIViewController<UIScrollViewDelegate, UIActionSheetDelegate, MFMailComposeViewControllerDelegate> {
+@interface EGOPhotoViewController : UIViewController<UIScrollViewDelegate, UIActionSheetDelegate, MFMailComposeViewControllerDelegate> {
EGOPhotoSource *_photoSource;
NSMutableArray *_photoViews;
View
6 Classes/EGOPhotoController.m → Library/EGOPhotoViewController.m
@@ -6,7 +6,7 @@
// Copyright 2010 enormego. All rights reserved.
//
-#import "EGOPhotoController.h"
+#import "EGOPhotoViewController.h"
#import "EGOPhotoImageView.h"
#import "EGOCache.h"
#import "EGOPhoto.h"
@@ -15,7 +15,7 @@
#define IMAGE_GAP 30
-@interface EGOPhotoController (Private)
+@interface EGOPhotoViewController (Private)
- (void)loadScrollViewWithPage:(NSInteger)page;
- (void)layoutScrollViewSubviewsAnimated:(BOOL)animated;
- (void)setupScrollViewContentSize;
@@ -29,7 +29,7 @@ - (void)setBarsHidden:(BOOL)hidden;
@end
-@implementation EGOPhotoController
+@implementation EGOPhotoViewController
@synthesize scrollView=_scrollView, photoSource=_photoSource, photoViews=_photoViews, captionView=_captionView;
View
12 Classes/EGOPhotoController.xib → Library/Resources/EGOPhotoViewController.xib
@@ -12,7 +12,6 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -36,7 +35,7 @@
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
</object>
<object class="IBUIView" id="191373211">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -55,7 +54,6 @@
</object>
</object>
<string key="NSFrameSize">{320, 480}</string>
- <reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
@@ -141,7 +139,7 @@
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>EGOPhotoController</string>
+ <string>EGOPhotoViewController</string>
<string>UIResponder</string>
<string>{{79, 364}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -170,15 +168,15 @@
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
- <string key="className">EGOPhotoController</string>
+ <string key="className">EGOPhotoViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">scrollView</string>
<string key="NS.object.0">UIScrollView</string>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">Classes/EGOPhotoController.h</string>
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
</object>
</object>
</object>
View
0  caption_bar_bg.png → Library/Resources/caption_bar_bg.png
File renamed without changes
View
0  error_placeholder.png → Library/Resources/error_placeholder.png
File renamed without changes
View
0  left.png → Library/Resources/left.png
File renamed without changes
View
0  photo_placeholder.png → Library/Resources/photo_placeholder.png
File renamed without changes
View
0  right.png → Library/Resources/right.png
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.