Skip to content
Open

V2.0 #62

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
56c145d
Migrates project to ARC
gdavis Jun 19, 2012
e90f03f
change project structure for 2.0 version
gdavis Dec 9, 2013
c557adc
rework project to use multiple targets and improved organization
gdavis Dec 9, 2013
70d726e
move project contents up one level
gdavis Dec 9, 2013
55ef777
change file structure following recommended cocoapod practices
gdavis Dec 9, 2013
c2ae108
setup demo project using development pod installation
gdavis Dec 9, 2013
de51e0c
remove instances of 'FGallery' and replace with 'GDIImageGallery'
gdavis Dec 9, 2013
ac9a2ee
fix warning about uninitialized number
gdavis Dec 9, 2013
81ae78c
Migrates project to ARC
gdavis Jun 19, 2012
eb9df75
change project structure for 2.0 version
gdavis Dec 9, 2013
73447ae
rework project to use multiple targets and improved organization
gdavis Dec 9, 2013
16ba85a
move project contents up one level
gdavis Dec 9, 2013
98e7192
change file structure following recommended cocoapod practices
gdavis Dec 9, 2013
6c9dc97
setup demo project using development pod installation
gdavis Dec 9, 2013
f81635a
remove instances of 'FGallery' and replace with 'GDIImageGallery'
gdavis Dec 9, 2013
400b797
fix warning about uninitialized number
gdavis Dec 9, 2013
886414f
fix merge issues
gdavis Dec 9, 2013
d9fa334
Merge branch 'v2.0' of https://github.com/gdavis/FGallery-iPhone into…
gdavis Dec 9, 2013
4f10d1a
change protocol signature to use NSUInteger instead of int
gdavis Dec 9, 2013
0441143
fix string formatting errors when using NSInteger and %i
gdavis Dec 9, 2013
d56f53d
set demo app build number to integer
gdavis Dec 9, 2013
840af94
update change log
gdavis Dec 9, 2013
9f74464
update read me
gdavis Dec 9, 2013
164c177
update read me and change log with new project name
gdavis Dec 9, 2013
0718d86
fix zombie crash with scroll view delegates
gdavis Dec 9, 2013
18b839d
replace KVO observing with viewDidLayoutSubviews method override
gdavis Dec 9, 2013
cf96c07
fix integer formatting
gdavis Dec 9, 2013
898b76b
change initial build for photo views until viewDidLoad. allows for ta…
gdavis Dec 9, 2013
35fb11e
remove generated pods folder from repo
gdavis Dec 9, 2013
7b8a9ea
add collection view to replace old thumbs view. update minimum projec…
gdavis Dec 10, 2013
ad49002
cleanup
gdavis Jan 22, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
FGallery/FGallery.xcodeproj/project.xcworkspace/contents.xcworkspacedata
FGallery/FGallery.xcodeproj/project.xcworkspace/xcuserdata/grantdavis.xcuserdatad/UserInterfaceState.xcuserstate
FGallery/FGallery.xcodeproj/xcuserdata/grantdavis.xcuserdatad/xcschemes/FGallery.xcscheme
FGallery/FGallery.xcodeproj/xcuserdata/grantdavis.xcuserdatad/xcschemes/xcschememanagement.plist
FGallery/FGallery.xcodeproj/project.xcworkspace/xcuserdata/grantdavis.xcuserdatad/WorkspaceSettings.xcsettings


# Xcode
build/*
*.pbxuser
Expand All @@ -30,3 +23,5 @@ profile
# Files that might appear on external disk
.Spotlight-V100
.Trashes

Project/Pods
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FGalleryStrings.strings
GDIImageGalleryStrings.strings
Created by Zadia Software on 06/04/12.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FGalleryStrings.strings
GDIImageGalleryStrings.strings
Created by Zadia Software on 06/04/12.
*/

Expand Down
File renamed without changes
File renamed without changes
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# GDIImageGallery CHANGELOG

## 2.0
* FGallery has been renamed to GDIImageGallery
* iOS7 Support
* Cocoapod support
* Major project restructuring (for cocoapds)

In Development:
* Rebuild thumbnail view with UICollectionView
* Add support for thumbnail view subclasses to customize the UICollectionView

## 1.3
* Various fixes and merged pull requests.

## 1.2
* Adds new 'startingIndex' property. As you might guess, it allows a developer to specify what the starting index should be for the gallery. This must be set before the view is built in the ViewController. Defaults to 0.
* Adds new 'beginsInThumbnailView' property. Allows the developer to indicate that the view should initialize and show the thumbnail view when first displaying instead of starting on the first image. This must be set before the view is presented. Defaults to 'NO'.
* FGallery classes are now contained in an FGallery group, separate from other code classes that are part of the demo.


## 1.1
* Added support for translucent navigation bars
* Added support to hide the right navigation button and therefore disable thumbnails through a new useThumbnailView property.
* Added better memory management for building and destroying view objects.
* Fixed a crash in the network images demo.

## 1.0
* First release!
9 changes: 9 additions & 0 deletions Classes/GDIImageGallery.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// GDIImageGallery.h
// GDIImageGallery
//
// Created by Grant Davis on 12/8/13.
// Copyright (c) 2013 Grant Davis Interactive, LLC. All rights reserved.
//

#import "GDIImageGalleryViewController.h"
17 changes: 17 additions & 0 deletions Classes/GDIImageGalleryCollectionViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// GDIThumbnailCollectionViewController.h
// GDIImageGallery
//
// Created by Grant Davis on 12/9/13.
// Copyright (c) 2013 Grant Davis Interactive, LLC. All rights reserved.
//

#import <UIKit/UIKit.h>

@class GDIImageGalleryViewController;
@interface GDIImageGalleryCollectionViewController : UICollectionViewController

@property (nonatomic, weak) GDIImageGalleryViewController *imageGalleryVC;
@property (nonatomic) CGSize thumbnailSize;

@end
85 changes: 85 additions & 0 deletions Classes/GDIImageGalleryCollectionViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
//
// GDIThumbnailCollectionViewController.m
// GDIImageGallery
//
// Created by Grant Davis on 12/9/13.
// Copyright (c) 2013 Grant Davis Interactive, LLC. All rights reserved.
//
#import "GDIImageGalleryCollectionViewController.h"
#import "GDIImageGalleryViewController.h"


@interface GDIImageGalleryCollectionViewController ()

@end


@implementation GDIImageGalleryCollectionViewController


- (id)initWithCollectionViewLayout:(UICollectionViewLayout *)layout
{
if (self = [super initWithCollectionViewLayout:layout]) {
self.thumbnailSize = CGSizeMake(88.f, 88.f);
}
return self;
}


- (void)viewDidLoad
{
[super viewDidLoad];

self.view.layer.borderColor = [UIColor yellowColor].CGColor;
self.view.layer.borderWidth = 1.f;

self.collectionView.backgroundColor =
self.view.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:.5];
NSLog(@"top layout guide length %.2f", self.topLayoutGuide.length);

[self.collectionView registerClass:[UICollectionViewCell class]
forCellWithReuseIdentifier:@"thumb"];
UICollectionViewFlowLayout *flowLayout = (UICollectionViewFlowLayout *)self.collectionViewLayout;
flowLayout.sectionInset = UIEdgeInsetsMake(10.f, 10.f, 10.f, 10.f);
}


- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
self.collectionView.contentInset = UIEdgeInsetsMake(self.imageGalleryVC.topLayoutGuide.length,
0,
self.imageGalleryVC.bottomLayoutGuide.length,
0);
}


- (void)setThumbnailSize:(CGSize)thumbnailSize
{
_thumbnailSize = thumbnailSize;

if ([self.collectionViewLayout isKindOfClass:[UICollectionViewFlowLayout class]]) {
UICollectionViewFlowLayout *flowLayout = (UICollectionViewFlowLayout *)self.collectionViewLayout;
flowLayout.itemSize = thumbnailSize;
}
}


#pragma mark - UICollectionViewDataSource


- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return [self.imageGalleryVC.photoSource numberOfPhotosForPhotoGallery:self.imageGalleryVC];
}


- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"thumb"
forIndexPath:indexPath];
cell.backgroundColor = [UIColor yellowColor];
return cell;
}

@end
30 changes: 15 additions & 15 deletions FGallery/Classes/FGalleryPhoto.h → Classes/GDIImageGalleryPhoto.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// FGalleryPhoto.h
// FGallery
// GDIImageGalleryPhoto.h
// GDIImageGallery
//
// Created by Grant Davis on 5/20/10.
// Copyright 2011 Grant Davis Interactive, LLC. All rights reserved.
Expand All @@ -9,9 +9,9 @@
#import <Foundation/Foundation.h>


@protocol FGalleryPhotoDelegate;
@protocol GDIImageGalleryPhotoDelegate;

@interface FGalleryPhoto : NSObject {
@interface GDIImageGalleryPhoto : NSObject {

// value which determines if the photo was initialized with local file paths or network paths.
BOOL _useNetwork;
Expand All @@ -34,14 +34,14 @@
UIImage *_thumbnail;
UIImage *_fullsize;

NSObject <FGalleryPhotoDelegate> *_delegate;
NSObject <GDIImageGalleryPhotoDelegate> *__unsafe_unretained _delegate;

NSUInteger tag;
}


- (id)initWithThumbnailUrl:(NSString*)thumb fullsizeUrl:(NSString*)fullsize delegate:(NSObject<FGalleryPhotoDelegate>*)delegate;
- (id)initWithThumbnailPath:(NSString*)thumb fullsizePath:(NSString*)fullsize delegate:(NSObject<FGalleryPhotoDelegate>*)delegate;
- (id)initWithThumbnailUrl:(NSString*)thumb fullsizeUrl:(NSString*)fullsize delegate:(NSObject<GDIImageGalleryPhotoDelegate>*)delegate;
- (id)initWithThumbnailPath:(NSString*)thumb fullsizePath:(NSString*)fullsize delegate:(NSObject<GDIImageGalleryPhotoDelegate>*)delegate;

- (void)loadThumbnail;
- (void)loadFullsize;
Expand All @@ -60,22 +60,22 @@
@property (nonatomic,readonly) UIImage *thumbnail;
@property (nonatomic,readonly) UIImage *fullsize;

@property (nonatomic,assign) NSObject<FGalleryPhotoDelegate> *delegate;
@property (nonatomic,unsafe_unretained) NSObject<GDIImageGalleryPhotoDelegate> *delegate;

@end


@protocol FGalleryPhotoDelegate
@protocol GDIImageGalleryPhotoDelegate

@required
- (void)galleryPhoto:(FGalleryPhoto*)photo didLoadThumbnail:(UIImage*)image;
- (void)galleryPhoto:(FGalleryPhoto*)photo didLoadFullsize:(UIImage*)image;
- (void)galleryPhoto:(GDIImageGalleryPhoto*)photo didLoadThumbnail:(UIImage*)image;
- (void)galleryPhoto:(GDIImageGalleryPhoto*)photo didLoadFullsize:(UIImage*)image;

@optional
- (void)galleryPhoto:(FGalleryPhoto*)photo willLoadThumbnailFromUrl:(NSString*)url;
- (void)galleryPhoto:(FGalleryPhoto*)photo willLoadFullsizeFromUrl:(NSString*)url;
- (void)galleryPhoto:(GDIImageGalleryPhoto*)photo willLoadThumbnailFromUrl:(NSString*)url;
- (void)galleryPhoto:(GDIImageGalleryPhoto*)photo willLoadFullsizeFromUrl:(NSString*)url;

- (void)galleryPhoto:(FGalleryPhoto*)photo willLoadThumbnailFromPath:(NSString*)path;
- (void)galleryPhoto:(FGalleryPhoto*)photo willLoadFullsizeFromPath:(NSString*)path;
- (void)galleryPhoto:(GDIImageGalleryPhoto*)photo willLoadThumbnailFromPath:(NSString*)path;
- (void)galleryPhoto:(GDIImageGalleryPhoto*)photo willLoadFullsizeFromPath:(NSString*)path;

@end
Loading