Permalink
Browse files

Update #2

  • Loading branch information...
1 parent c0b5d47 commit 3c61621cc09a8c3bb68a9885426dbe9db9e6ad8b @Nuclominus committed Mar 28, 2014
@@ -24,7 +24,9 @@
F02EC93F18E18A980054C833 /* PhotoWallTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F02EC93E18E18A980054C833 /* PhotoWallTests.m */; };
F0B32CB118E4499B008E9AD2 /* CellVC.m in Sources */ = {isa = PBXBuildFile; fileRef = F0B32CAF18E4499B008E9AD2 /* CellVC.m */; };
F0B32CB218E4499B008E9AD2 /* CellVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = F0B32CB018E4499B008E9AD2 /* CellVC.xib */; };
- F0B8D70E18E46A0100CA46DD /* test.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F0B8D70D18E46A0100CA46DD /* test.jpg */; };
+ F0B8D70E18E46A0100CA46DD /* test_0.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F0B8D70D18E46A0100CA46DD /* test_0.jpg */; };
+ F0B8D71018E57BC900CA46DD /* test_2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F0B8D70F18E57BC900CA46DD /* test_2.jpg */; };
+ F0B8D71218E57BD100CA46DD /* test_1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F0B8D71118E57BD100CA46DD /* test_1.jpg */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -61,7 +63,9 @@
F0B32CAE18E4499B008E9AD2 /* CellVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CellVC.h; sourceTree = "<group>"; };
F0B32CAF18E4499B008E9AD2 /* CellVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CellVC.m; sourceTree = "<group>"; };
F0B32CB018E4499B008E9AD2 /* CellVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CellVC.xib; sourceTree = "<group>"; };
- F0B8D70D18E46A0100CA46DD /* test.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = test.jpg; sourceTree = "<group>"; };
+ F0B8D70D18E46A0100CA46DD /* test_0.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = test_0.jpg; sourceTree = "<group>"; };
+ F0B8D70F18E57BC900CA46DD /* test_2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = test_2.jpg; sourceTree = "<group>"; };
+ F0B8D71118E57BD100CA46DD /* test_1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = test_1.jpg; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -121,7 +125,9 @@
F02EC91618E18A960054C833 /* PhotoWall */ = {
isa = PBXGroup;
children = (
- F0B8D70D18E46A0100CA46DD /* test.jpg */,
+ F0B8D70D18E46A0100CA46DD /* test_0.jpg */,
+ F0B8D71118E57BD100CA46DD /* test_1.jpg */,
+ F0B8D70F18E57BC900CA46DD /* test_2.jpg */,
F02EC91F18E18A960054C833 /* AppDelegate.h */,
F02EC92018E18A960054C833 /* AppDelegate.m */,
F02EC92218E18A960054C833 /* Main_iPhone.storyboard */,
@@ -244,9 +250,11 @@
files = (
F02EC92718E18A970054C833 /* Main_iPad.storyboard in Resources */,
F0B32CB218E4499B008E9AD2 /* CellVC.xib in Resources */,
- F0B8D70E18E46A0100CA46DD /* test.jpg in Resources */,
+ F0B8D70E18E46A0100CA46DD /* test_0.jpg in Resources */,
F02EC92C18E18A970054C833 /* Images.xcassets in Resources */,
+ F0B8D71218E57BD100CA46DD /* test_1.jpg in Resources */,
F02EC92418E18A960054C833 /* Main_iPhone.storyboard in Resources */,
+ F0B8D71018E57BC900CA46DD /* test_2.jpg in Resources */,
F02EC91B18E18A960054C833 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -407,6 +415,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "PhotoWall/PhotoWall-Prefix.pch";
INFOPLIST_FILE = "PhotoWall/PhotoWall-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -420,6 +429,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "PhotoWall/PhotoWall-Prefix.pch";
INFOPLIST_FILE = "PhotoWall/PhotoWall-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
+ <deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies>
<scenes>
View
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
+ <deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies>
<objects>
@@ -16,11 +17,11 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
- <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="X1z-dm-ZRW">
+ <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="X1z-dm-ZRW">
<rect key="frame" x="0.0" y="0.0" width="150" height="150"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
- <activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="t1v-K9-Fj9">
+ <activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" style="gray" id="t1v-K9-Fj9">
<rect key="frame" x="65" y="65" width="20" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
View
@@ -25,32 +25,16 @@ - (void)viewDidLoad
_scroll.contentSize = CGSizeMake(size, size);
_scroll.contentOffset = CGPointMake(size/2,size/2);
[self createStart];
-
-// _pointsArray = [[NSMutableArray alloc]init];
-// for (int i = 0;i < MAXFLOAT; i++) {
-// for (int j = 0; j<MAXFLOAT; j++) {
-// [_pointsArray addObject:[NSValue valueWithCGPoint:CGPointMake(150 * i, 150 * j)]];
-// }
-// }
+
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
}
-(void)createStart{
-// for (int i = 0; i < 4; i++) {
-// for (int j = 0; j < 4; j++) {
-// UIView * view = [[UIView alloc]init];
-// [view setBackgroundColor:[UIColor redColor]];
-// [view setFrame:CGRectMake(size/2+150*i, size/2+150*j, 150, 150)];
-// [_scroll addSubview:view];
-// }
-// }
-// _scroll.bounces = NO;
_pointsArray = [[NSMutableArray alloc]init];
_cellsArray = [[NSMutableArray alloc]init];
[self setDataImagesForWatching];
@@ -79,7 +63,9 @@ -(void)setDataImagesForWatching{
CellVC * view = [[CellVC alloc] initWithNibName:@"CellVC" bundle:nil];
[view.view setFrame:CGRectMake(size/2+150*i, size/2+150*j, 150, 150)];
-
+ NSString * imageName = [NSString stringWithFormat:@"test_%d.jpg",[self getRandomNumberBetween:0 to:2]];
+ [view.image setFrame:CGRectMake(0, 0, view.view.frame.size.width, view.view.frame.size.height)];
+ view.image.image = [UIImage imageNamed:imageName];
[_pointsArray addObject:[NSValue valueWithCGPoint:CGPointMake(size/2+150*i, size/2+150*j)]];
[view.view setBackgroundColor:[UIColor redColor]];
@@ -159,7 +145,9 @@ -(void)scrollViewDidScroll:(UIScrollView *)scrollView{
[viewPoint.view setBackgroundColor:[UIColor blackColor]];
viewPoint.view.tag = iterator;
// тестовая картинка
- viewPoint.image.image = [UIImage imageNamed:@"test.jpg"];
+ NSString * imageName = [NSString stringWithFormat:@"test_%d.jpg",[self getRandomNumberBetween:0 to:2]];
+ [viewPoint.image setFrame:CGRectMake(0, 0, viewPoint.view.frame.size.width, viewPoint.view.frame.size.height)];
+ viewPoint.image.image = [UIImage imageNamed:imageName];
viewPoint.adjacentPoints = [viewPoint cellAdjacentPoints];
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapGestureCaptured:)];
@@ -179,6 +167,9 @@ -(void)scrollViewDidScroll:(UIScrollView *)scrollView{
}
}
+-(int)getRandomNumberBetween:(int)from to:(int)to {
+ return (int)from + arc4random() % (to-from+1);
+}
-(void)removePointFromArrays:(CGPoint)point{
// удаление точек размещенных ячеек
File renamed without changes
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3c61621

Please sign in to comment.