Skip to content

Commit

Permalink
Added ability to customize the asset detail view controller
Browse files Browse the repository at this point in the history
  • Loading branch information
davbeck committed Apr 2, 2015
1 parent c97fc4d commit 37f4aa3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Pod/Classes/TNKAssetsDetailViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@

@property (nonatomic, weak) id<TNKAssetsDetailViewControllerDelegate> assetDelegate;

/** The class used to create individual asset view controllers
This class should be a subclass of `TNKAssetViewController`.
*/
@property (nonatomic, strong) Class assetViewControllerClass;

/** The asset collection the picker will display to the user.
nil (the default) will cause the picker to display the user's moments.
Expand Down
3 changes: 2 additions & 1 deletion Pod/Classes/TNKAssetsDetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ - (void)_init
self.dataSource = self;
self.hidesBottomBarWhenPushed = YES;
self.automaticallyAdjustsScrollViewInsets = NO;
_assetViewControllerClass = [TNKAssetViewController class];
}

- (id)initWithCoder:(NSCoder *)aDecoder
Expand Down Expand Up @@ -208,7 +209,7 @@ - (TNKAssetViewController *)_assetViewControllerWithAssetAtIndexPath:(NSIndexPat
asset = moment[indexPath.row];
}

TNKAssetViewController *next = [[TNKAssetViewController alloc] init];
TNKAssetViewController *next = [[self.assetViewControllerClass alloc] init];
next.view.backgroundColor = [UIColor clearColor];
next.view.frame = self.view.bounds;
objc_setAssociatedObject(next, @selector(indexPath), indexPath, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
Expand Down

0 comments on commit 37f4aa3

Please sign in to comment.