Added images, and displaying first one.

This commit is contained in:
makowildcat
2014-04-10 11:51:10 +02:00
parent b47e46081b
commit da83305a1d
20 changed files with 177 additions and 2 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

+28
View File
@@ -7,6 +7,12 @@
objects = {
/* Begin PBXBuildFile section */
5A066DD718F68EA500A16494 /* PictureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A066DD618F68EA500A16494 /* PictureViewController.m */; };
5A066DDA18F68EE900A16494 /* ReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A066DD918F68EE900A16494 /* ReaderView.m */; };
5A066DDF18F6975200A16494 /* 1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 5A066DDB18F6975200A16494 /* 1.jpg */; };
5A066DE618F6982000A16494 /* 0.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 5A066DE318F6982000A16494 /* 0.jpg */; };
5A066DE718F6982000A16494 /* 3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 5A066DE418F6982000A16494 /* 3.jpg */; };
5A066DE818F6982000A16494 /* 2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 5A066DE518F6982000A16494 /* 2.jpg */; };
5A11DCFE18F68644007CE97C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A11DCFD18F68644007CE97C /* Foundation.framework */; };
5A11DD0018F68644007CE97C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A11DCFF18F68644007CE97C /* CoreGraphics.framework */; };
5A11DD0218F68644007CE97C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A11DD0118F68644007CE97C /* UIKit.framework */; };
@@ -36,6 +42,14 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
5A066DD518F68EA500A16494 /* PictureViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureViewController.h; sourceTree = "<group>"; };
5A066DD618F68EA500A16494 /* PictureViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureViewController.m; sourceTree = "<group>"; };
5A066DD818F68EE900A16494 /* ReaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderView.h; sourceTree = "<group>"; };
5A066DD918F68EE900A16494 /* ReaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderView.m; sourceTree = "<group>"; };
5A066DDB18F6975200A16494 /* 1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 1.jpg; sourceTree = "<group>"; };
5A066DE318F6982000A16494 /* 0.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = 0.jpg; path = ../0.jpg; sourceTree = "<group>"; };
5A066DE418F6982000A16494 /* 3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = 3.jpg; path = ../3.jpg; sourceTree = "<group>"; };
5A066DE518F6982000A16494 /* 2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = 2.jpg; path = ../2.jpg; sourceTree = "<group>"; };
5A11DCFA18F68644007CE97C /* Flikrkr.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Flikrkr.app; sourceTree = BUILT_PRODUCTS_DIR; };
5A11DCFD18F68644007CE97C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
5A11DCFF18F68644007CE97C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
@@ -117,9 +131,17 @@
5A11DD0518F68644007CE97C /* Flikrkr */ = {
isa = PBXGroup;
children = (
5A066DE318F6982000A16494 /* 0.jpg */,
5A066DDB18F6975200A16494 /* 1.jpg */,
5A066DE518F6982000A16494 /* 2.jpg */,
5A066DE418F6982000A16494 /* 3.jpg */,
5A11DD0E18F68644007CE97C /* AppDelegate.h */,
5A11DD0F18F68644007CE97C /* AppDelegate.m */,
5A11DD3218F6871F007CE97C /* Storyboard.storyboard */,
5A066DD518F68EA500A16494 /* PictureViewController.h */,
5A066DD618F68EA500A16494 /* PictureViewController.m */,
5A066DD818F68EE900A16494 /* ReaderView.h */,
5A066DD918F68EE900A16494 /* ReaderView.m */,
5A11DD1418F68644007CE97C /* Images.xcassets */,
5A11DD1118F68644007CE97C /* Flikrkr.xcdatamodeld */,
5A11DD0618F68644007CE97C /* Supporting Files */,
@@ -232,7 +254,11 @@
buildActionMask = 2147483647;
files = (
5A11DD0A18F68644007CE97C /* InfoPlist.strings in Resources */,
5A066DDF18F6975200A16494 /* 1.jpg in Resources */,
5A066DE818F6982000A16494 /* 2.jpg in Resources */,
5A11DD1518F68644007CE97C /* Images.xcassets in Resources */,
5A066DE718F6982000A16494 /* 3.jpg in Resources */,
5A066DE618F6982000A16494 /* 0.jpg in Resources */,
5A11DD3318F6871F007CE97C /* Storyboard.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -253,7 +279,9 @@
buildActionMask = 2147483647;
files = (
5A11DD1318F68644007CE97C /* Flikrkr.xcdatamodeld in Sources */,
5A066DD718F68EA500A16494 /* PictureViewController.m in Sources */,
5A11DD1018F68644007CE97C /* AppDelegate.m in Sources */,
5A066DDA18F68EE900A16494 /* ReaderView.m in Sources */,
5A11DD0C18F68644007CE97C /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 KiB

+13
View File
@@ -0,0 +1,13 @@
//
// PictureViewController.h
// Flikrkr
//
// Created by esgi on 10/04/2014.
// Copyright (c) 2014 Oui. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PictureViewController : UIViewController
@end
+59
View File
@@ -0,0 +1,59 @@
//
// PictureViewController.m
// Flikrkr
//
// Created by esgi on 10/04/2014.
// Copyright (c) 2014 Oui. All rights reserved.
//
#import "PictureViewController.h"
#import "ReaderView.h"
@interface PictureViewController () <ReaderViewDelegate>
@property (weak, nonatomic) IBOutlet ReaderView *readerView;
@end
@implementation PictureViewController
- (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.
self.readerView.delegate = self;
}
- (void) viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.readerView displayPageAtIndex:0];
}
- (int) numberOfPages
{
return 4;
}
- (UIView *) pageAtIndex:(int)index
{
NSString * imageName = [NSString stringWithFormat:@"%i.jpg",index];
UIImage * image = [UIImage imageNamed:imageName];
UIImageView * imageView = [[UIImageView alloc] initWithImage: image];
imageView.frame = self.readerView.bounds;
imageView.contentMode = UIViewContentModeScaleAspectFit;
return imageView;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
+24
View File
@@ -0,0 +1,24 @@
//
// ReaderView.h
// Flikrkr
//
// Created by esgi on 10/04/2014.
// Copyright (c) 2014 Oui. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol ReaderViewDelegate <NSObject>
- (int) numberOfPages;
- (UIView*) pageAtIndex:(int)index;
@end
@interface ReaderView : UIView
@property (nonatomic, weak) id<ReaderViewDelegate> delegate;
- (void) displayPageAtIndex:(int)index;
@end
+35
View File
@@ -0,0 +1,35 @@
//
// ReaderView.m
// Flikrkr
//
// Created by esgi on 10/04/2014.
// Copyright (c) 2014 Oui. All rights reserved.
//
#import "ReaderView.h"
@implementation ReaderView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
-(void)displayPageAtIndex:(int)index
{
UIView * view = [self.delegate pageAtIndex:index];
[self addSubview:view];
}
@end
+18 -2
View File
@@ -50,10 +50,10 @@
</objects>
<point key="canvasLocation" x="-596" y="-410"/>
</scene>
<!--View Controller-->
<!--Picture View Controller-->
<scene sceneID="KDs-Ng-sHE">
<objects>
<viewController id="yEh-Fv-q7w" sceneMemberID="viewController">
<viewController id="yEh-Fv-q7w" customClass="PictureViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="CVZ-F1-31E"/>
<viewControllerLayoutGuide type="bottom" id="oMx-j8-vFV"/>
@@ -61,9 +61,25 @@
<view key="view" contentMode="scaleToFill" id="lGe-eG-FQo">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ePE-iI-GY2" customClass="ReaderView">
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="ePE-iI-GY2" firstAttribute="top" secondItem="CVZ-F1-31E" secondAttribute="bottom" id="9XR-GX-DoH"/>
<constraint firstItem="ePE-iI-GY2" firstAttribute="leading" secondItem="lGe-eG-FQo" secondAttribute="leading" id="B0m-6h-Blz"/>
<constraint firstAttribute="trailing" secondItem="ePE-iI-GY2" secondAttribute="trailing" id="LXy-nF-TAL"/>
<constraint firstItem="oMx-j8-vFV" firstAttribute="top" secondItem="ePE-iI-GY2" secondAttribute="bottom" id="p9B-9g-6Gr"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="JLn-gk-HfS"/>
<connections>
<outlet property="readerView" destination="ePE-iI-GY2" id="7JD-i3-N5s"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ozi-Gb-rjv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 KiB