This repository has been archived by the owner on Dec 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial work on FRPFullSizePhotoViewModel.
- Loading branch information
Showing
6 changed files
with
98 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// FRPFullSizePhotoViewModel.h | ||
// FRP | ||
// | ||
// Created by Ash Furrow on 10/21/2013. | ||
// Copyright (c) 2013 Ash Furrow. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class FRPPhotoModel; | ||
|
||
@interface FRPFullSizePhotoViewModel : NSObject | ||
|
||
-(instancetype)initWithPhotoModelArray:(NSArray *)photoModelArray initialPhotoIndex:(NSInteger)initialPhotoIndex; | ||
|
||
@property (nonatomic, readonly) NSArray *photoArray; | ||
@property (nonatomic, readonly) NSInteger initialPhotoIndex; | ||
|
||
-(FRPPhotoModel *)initialPhotoModel; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// FRPFullSizePhotoViewModel.m | ||
// FRP | ||
// | ||
// Created by Ash Furrow on 10/21/2013. | ||
// Copyright (c) 2013 Ash Furrow. All rights reserved. | ||
// | ||
|
||
#import "FRPFullSizePhotoViewModel.h" | ||
|
||
// Model | ||
#import "FRPPhotoModel.h" | ||
|
||
|
||
@interface FRPFullSizePhotoViewModel () | ||
|
||
// Private access | ||
@property (nonatomic, strong) NSArray *photoArray; | ||
@property (nonatomic, assign) NSInteger initialPhotoIndex; | ||
|
||
@end | ||
|
||
@implementation FRPFullSizePhotoViewModel | ||
|
||
-(instancetype)initWithPhotoModelArray:(NSArray *)photoModelArray initialPhotoIndex:(NSInteger)initialPhotoIndex { | ||
self = [self init]; | ||
if (!self) return nil; | ||
|
||
self.photoArray = photoModelArray; | ||
self.initialPhotoIndex = initialPhotoIndex; | ||
|
||
return self; | ||
} | ||
|
||
-(FRPPhotoModel *)initialPhotoModel { | ||
return self.photoArray[self.initialPhotoIndex]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters