Skip to content

Commit

Permalink
Update #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuclominus committed Mar 28, 2014
1 parent c0b5d47 commit 3c61621
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 26 deletions.
18 changes: 14 additions & 4 deletions PhotoWall.xcodeproj/project.pbxproj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
F02EC93F18E18A980054C833 /* PhotoWallTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F02EC93E18E18A980054C833 /* PhotoWallTests.m */; }; F02EC93F18E18A980054C833 /* PhotoWallTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F02EC93E18E18A980054C833 /* PhotoWallTests.m */; };
F0B32CB118E4499B008E9AD2 /* CellVC.m in Sources */ = {isa = PBXBuildFile; fileRef = F0B32CAF18E4499B008E9AD2 /* CellVC.m */; }; F0B32CB118E4499B008E9AD2 /* CellVC.m in Sources */ = {isa = PBXBuildFile; fileRef = F0B32CAF18E4499B008E9AD2 /* CellVC.m */; };
F0B32CB218E4499B008E9AD2 /* CellVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = F0B32CB018E4499B008E9AD2 /* CellVC.xib */; }; 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 */ /* End PBXBuildFile section */


/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -61,7 +63,9 @@
F0B32CAE18E4499B008E9AD2 /* CellVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CellVC.h; sourceTree = "<group>"; }; 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>"; }; 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>"; }; 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 */ /* End PBXFileReference section */


/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -121,7 +125,9 @@
F02EC91618E18A960054C833 /* PhotoWall */ = { F02EC91618E18A960054C833 /* PhotoWall */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
F0B8D70D18E46A0100CA46DD /* test.jpg */, F0B8D70D18E46A0100CA46DD /* test_0.jpg */,
F0B8D71118E57BD100CA46DD /* test_1.jpg */,
F0B8D70F18E57BC900CA46DD /* test_2.jpg */,
F02EC91F18E18A960054C833 /* AppDelegate.h */, F02EC91F18E18A960054C833 /* AppDelegate.h */,
F02EC92018E18A960054C833 /* AppDelegate.m */, F02EC92018E18A960054C833 /* AppDelegate.m */,
F02EC92218E18A960054C833 /* Main_iPhone.storyboard */, F02EC92218E18A960054C833 /* Main_iPhone.storyboard */,
Expand Down Expand Up @@ -244,9 +250,11 @@
files = ( files = (
F02EC92718E18A970054C833 /* Main_iPad.storyboard in Resources */, F02EC92718E18A970054C833 /* Main_iPad.storyboard in Resources */,
F0B32CB218E4499B008E9AD2 /* CellVC.xib in Resources */, F0B32CB218E4499B008E9AD2 /* CellVC.xib in Resources */,
F0B8D70E18E46A0100CA46DD /* test.jpg in Resources */, F0B8D70E18E46A0100CA46DD /* test_0.jpg in Resources */,
F02EC92C18E18A970054C833 /* Images.xcassets in Resources */, F02EC92C18E18A970054C833 /* Images.xcassets in Resources */,
F0B8D71218E57BD100CA46DD /* test_1.jpg in Resources */,
F02EC92418E18A960054C833 /* Main_iPhone.storyboard in Resources */, F02EC92418E18A960054C833 /* Main_iPhone.storyboard in Resources */,
F0B8D71018E57BC900CA46DD /* test_2.jpg in Resources */,
F02EC91B18E18A960054C833 /* InfoPlist.strings in Resources */, F02EC91B18E18A960054C833 /* InfoPlist.strings in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -407,6 +415,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "PhotoWall/PhotoWall-Prefix.pch"; GCC_PREFIX_HEADER = "PhotoWall/PhotoWall-Prefix.pch";
INFOPLIST_FILE = "PhotoWall/PhotoWall-Info.plist"; INFOPLIST_FILE = "PhotoWall/PhotoWall-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app; WRAPPER_EXTENSION = app;
}; };
Expand All @@ -420,6 +429,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "PhotoWall/PhotoWall-Prefix.pch"; GCC_PREFIX_HEADER = "PhotoWall/PhotoWall-Prefix.pch";
INFOPLIST_FILE = "PhotoWall/PhotoWall-Info.plist"; INFOPLIST_FILE = "PhotoWall/PhotoWall-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app; WRAPPER_EXTENSION = app;
}; };
Expand Down
1 change: 1 addition & 0 deletions PhotoWall/Base.lproj/Main_iPhone.storyboard
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?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"> <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> <dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies> </dependencies>
<scenes> <scenes>
Expand Down
7 changes: 4 additions & 3 deletions PhotoWall/CellVC.xib
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?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> <dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies> </dependencies>
<objects> <objects>
Expand All @@ -16,11 +17,11 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/> <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <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"/> <rect key="frame" x="0.0" y="0.0" width="150" height="150"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView> </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"/> <rect key="frame" x="65" y="65" width="20" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</activityIndicatorView> </activityIndicatorView>
Expand Down
29 changes: 10 additions & 19 deletions PhotoWall/ViewController.m
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,32 +25,16 @@ - (void)viewDidLoad
_scroll.contentSize = CGSizeMake(size, size); _scroll.contentSize = CGSizeMake(size, size);
_scroll.contentOffset = CGPointMake(size/2,size/2); _scroll.contentOffset = CGPointMake(size/2,size/2);
[self createStart]; [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 - (void)didReceiveMemoryWarning
{ {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
} }


-(void)createStart{ -(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]; _pointsArray = [[NSMutableArray alloc]init];
_cellsArray = [[NSMutableArray alloc]init]; _cellsArray = [[NSMutableArray alloc]init];
[self setDataImagesForWatching]; [self setDataImagesForWatching];
Expand Down Expand Up @@ -79,7 +63,9 @@ -(void)setDataImagesForWatching{


CellVC * view = [[CellVC alloc] initWithNibName:@"CellVC" bundle:nil]; CellVC * view = [[CellVC alloc] initWithNibName:@"CellVC" bundle:nil];
[view.view setFrame:CGRectMake(size/2+150*i, size/2+150*j, 150, 150)]; [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)]]; [_pointsArray addObject:[NSValue valueWithCGPoint:CGPointMake(size/2+150*i, size/2+150*j)]];


[view.view setBackgroundColor:[UIColor redColor]]; [view.view setBackgroundColor:[UIColor redColor]];
Expand Down Expand Up @@ -159,7 +145,9 @@ -(void)scrollViewDidScroll:(UIScrollView *)scrollView{
[viewPoint.view setBackgroundColor:[UIColor blackColor]]; [viewPoint.view setBackgroundColor:[UIColor blackColor]];
viewPoint.view.tag = iterator; 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]; viewPoint.adjacentPoints = [viewPoint cellAdjacentPoints];


UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapGestureCaptured:)]; UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapGestureCaptured:)];
Expand All @@ -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{ -(void)removePointFromArrays:(CGPoint)point{
// удаление точек размещенных ячеек // удаление точек размещенных ячеек
Expand Down
File renamed without changes
Binary file added PhotoWall/test_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added PhotoWall/test_2.jpg
Loading
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.