Permalink
Browse files

photo moves into view when addnotation selected... but photo still empty

  • Loading branch information...
cozmoboy committed Mar 27, 2013
1 parent e631e8b commit bce6d23590850eb5e8b7a708ba76d226bc8019b3
@@ -11,6 +11,7 @@
6B2D7B2A16F8FE2B00E6D3A5 /* Photo.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B2D7B2916F8FE2B00E6D3A5 /* Photo.m */; };
6B2D7B2D16F8FE2B00E6D3A5 /* Business.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B2D7B2C16F8FE2B00E6D3A5 /* Business.m */; };
6B2F834B16FF51C4004551F9 /* BookmarkedBusiness.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B2F834A16FF51C4004551F9 /* BookmarkedBusiness.m */; };
+ 6B66DA1217034B30001CC055 /* closeButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6B66DA1117034B30001CC055 /* closeButton@2x.png */; };
830729D416F766D6000F0037 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 830729D216F766D6000F0037 /* Model.xcdatamodeld */; };
830E6BB117011CDE009FBD5B /* yelpMapViewShader@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 830E6BB017011CDE009FBD5B /* yelpMapViewShader@2x.png */; };
830E6BB517011DB1009FBD5B /* mapShadow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 830E6BB417011DB1009FBD5B /* mapShadow@2x.png */; };
@@ -94,6 +95,7 @@
6B2D7B2C16F8FE2B00E6D3A5 /* Business.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Business.m; path = ../Business.m; sourceTree = "<group>"; };
6B2F834916FF51C4004551F9 /* BookmarkedBusiness.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BookmarkedBusiness.h; sourceTree = "<group>"; };
6B2F834A16FF51C4004551F9 /* BookmarkedBusiness.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BookmarkedBusiness.m; sourceTree = "<group>"; };
+ 6B66DA1117034B30001CC055 /* closeButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "closeButton@2x.png"; sourceTree = "<group>"; };
830729D316F766D6000F0037 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = "<group>"; };
830E6BB017011CDE009FBD5B /* yelpMapViewShader@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "yelpMapViewShader@2x.png"; sourceTree = "<group>"; };
830E6BB417011DB1009FBD5B /* mapShadow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mapShadow@2x.png"; sourceTree = "<group>"; };
@@ -234,7 +236,6 @@
8F372B0916F244C800302B80 /* MappingMashupApp */ = {
isa = PBXGroup;
children = (
- B482103C16FFE568004EE1CF /* Categories */,
83D97AF916FB970F00B525E2 /* CustomCalloutClasses */,
830729D216F766D6000F0037 /* Model.xcdatamodeld */,
8F372B1B16F244C800302B80 /* MainStoryboard.storyboard */,
@@ -286,13 +287,12 @@
8F372B5C16F2698B00302B80 /* Classes */ = {
isa = PBXGroup;
children = (
+ B482103C16FFE568004EE1CF /* Categories */,
B425501016F6B1D1005CCC9E /* Managed */,
B425500716F6B158005CCC9E /* Venue.h */,
B425500816F6B158005CCC9E /* Venue.m */,
8F372B5916F2678A00302B80 /* Annotation.h */,
8F372B5A16F2678A00302B80 /* Annotation.m */,
- 6B2A007616FB984600F0C703 /* NSString+Extended.h */,
- 6B2A007716FB984600F0C703 /* NSString+Extended.m */,
);
name = Classes;
sourceTree = "<group>";
@@ -327,6 +327,7 @@
8F3AD83816F90A0300BEEB3A /* Custom Images */ = {
isa = PBXGroup;
children = (
+ 6B66DA1117034B30001CC055 /* closeButton@2x.png */,
835CB1AF1702558B009190FA /* forwardArrow@2x.png */,
835CB1AD17025521009190FA /* backArrow@2x.png */,
836B862217024F1700B593A4 /* addBookmarkC@2x.png */,
@@ -378,6 +379,8 @@
children = (
B482103E16FFE579004EE1CF /* UIView+AnimationTools.h */,
B482103F16FFE579004EE1CF /* UIView+AnimationTools.m */,
+ 6B2A007616FB984600F0C703 /* NSString+Extended.h */,
+ 6B2A007716FB984600F0C703 /* NSString+Extended.m */,
);
name = Categories;
sourceTree = "<group>";
@@ -483,6 +486,7 @@
836B862317024F1700B593A4 /* addBookmarkC@2x.png in Resources */,
835CB1AE17025521009190FA /* backArrow@2x.png in Resources */,
835CB1B01702558B009190FA /* forwardArrow@2x.png in Resources */,
+ 6B66DA1217034B30001CC055 /* closeButton@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -32,13 +32,16 @@ @interface FlickrMapViewController ()
NSString * photoTitleToPass;
NSString * photoThumbnailStringToPass;
+ __weak IBOutlet UIView *enlargedPhotoViewOutlet;
__weak IBOutlet MKMapView *mapView;
__weak IBOutlet UIView *loadingOverlay;
//Just to deal with map zoom issue
BOOL isZoomedInYet;
__weak IBOutlet UIImageView *photoViewerUIImageView;
+ BOOL didSelectThumbnail;
}
+- (IBAction)closePhotoButtonPressed:(id)sender;
@end
@@ -51,6 +54,7 @@ - (void)viewDidLoad
{
[super viewDidLoad];
isZoomedInYet = NO;
+ didSelectThumbnail = NO;
//God help us, please make the location services work! Puh_LEASE JESUS
//[self startLocationUpdates];
//Moved this here (ross 3.25.13)
@@ -417,8 +421,54 @@ - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)o
//
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
{
-
+ if (didSelectThumbnail == NO)
+ {
+
+ didSelectThumbnail = YES;
[view squishImage];
+
+
+
+ //..............NEW 3/27.. TO BE PLAYED WITH TO SCALE PHOTO WHEN SELECTED..
+ //FROM CORE GRAPHIC EXERCIZE............
+
+// CGSize sizeOfNewImage =  CGSizeMake(sizeScaled, sizeScaled);
+//
+////This gets a new context of size sizeOfNewImage
+// UIGraphicsBeginImageContext(sizeOfNewImage);
+//
+// //
+// //THE BEGINNING OF DOING STUFF ON A NEW DESK (context)
+// //
+//
+////Grab whatever is on the desk (context)
+// CGContextRef context = UIGraphicsGetCurrentContext();
+////This changes the interpolation level. If you are using a small image, use low interpolation
+//CGContextSetInterpolationQuality(context, kCGInterpolationLow);
+//CGContextSetInterpolationQuality(context, kCGInterpolationMedium);
+//CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
+//
+////draw the jake picture on our new desk (context)
+////(This was originally the image size - 256x256 - we changed it)
+//[jake drawInRect:CGRectMake(0, 0, sizeOfNewImage.width, sizeOfNewImage.height)];
+//
+////pick up image from the desk (context)
+//UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext();
+//
+//UIGraphicsEndImageContext();
+//
+////THE END OF DOING STUFF
+//
+//myViewOfJake.image = scaledImage;
+////resizing the frame of the view of the image to match
+//myViewOfJake.frame = CGRectMake(0, 0, sizeOfNewImage.width, sizeOfNewImage.height);
+////recenter the view after changing the frame
+//myViewOfJake.center = self.view.center;
+
+ //NEW END 3/27 ..............TO BE PLAYED WITH TO SCALE PHOTO WHEN SELECTED
+
+
+
[photoViewerUIImageView raiseImageView];
selectedAnnotation = view.annotation;
@@ -429,9 +479,17 @@ - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *
NSData *photoData = [NSData dataWithContentsOfURL:photoFullSizeURL];
UIImage *photoFullSize = [UIImage imageWithData:photoData];
photoViewerUIImageView.image = photoFullSize;
+ //photoViewerUIImageView.image = [UIImage imageNamed:@"xmark.png"];
+ [enlargedPhotoViewOutlet addSubview:photoViewerUIImageView];
+ //enlargedPhotoViewOutlet.subvie
+
+ [enlargedPhotoViewOutlet lowerImageView];
+ }
+
+
//Note: This should break when we switch from Yelp annotations
//to Flickr photos.
//Once it doees work, delete this comment
@@ -448,6 +506,18 @@ - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *
//NSLog(@"Logging out the annotation %@", view.annotation.title);
}
+
+- (IBAction)closePhotoButtonPressed:(id)sender
+{
+ if (didSelectThumbnail == YES) {
+ [enlargedPhotoViewOutlet raiseImageView];
+ }
+
+
+ didSelectThumbnail = NO;
+}
+
+
//
// User taps on disclosure button to see more Yelp data.
//
@@ -516,4 +586,5 @@ - (void)didReceiveMemoryWarning
// Dispose of any resources that can be recreated.
}
+
@end
@@ -12,5 +12,6 @@
-(void)squishImage;
-(void)raiseImageView;
+-(void)lowerImageView;
@end
@@ -23,24 +23,28 @@ -(void)squishImage
}];
}
--(void)raiseImageView
+
+
+-(void)lowerImageView
{
[UIView animateWithDuration:0.5
animations:^void(void)
{
- self.center = CGPointMake(self.center.x, self.center.y+400);
- self.alpha = 0.90;
+ self.center = CGPointMake(self.center.x, self.center.y+229);
+ //self.alpha = 0.90;
}];
}
--(void)lowerImageView
+
+-(void)raiseImageView
{
[UIView animateWithDuration:0.5
animations:^void(void)
{
- self.center = CGPointMake(self.center.x, self.center.y-400);
- self.alpha = 0.90;
+ self.center = CGPointMake(self.center.x, self.center.y-229);
+ //self.alpha = 0.90;
}];
}
+
@end
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="3084" systemVersion="12D78" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="mW4-IJ-E2e">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="3084" systemVersion="12C60" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="mW4-IJ-E2e">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="2083"/>
</dependencies>
@@ -69,11 +69,33 @@
<rect key="frame" x="0.0" y="-25" width="320" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
- <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" id="O4r-WJ-Sly">
- <rect key="frame" x="0.0" y="-195" width="320" height="195"/>
+ <view contentMode="scaleToFill" id="OOa-i0-nDV">
+ <rect key="frame" x="10" y="-185" width="300" height="185"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
- <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
- </imageView>
+ <subviews>
+ <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" id="O4r-WJ-Sly">
+ <rect key="frame" x="5" y="5" width="290" height="175"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+ </imageView>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="l7g-9r-gcH">
+ <rect key="frame" x="257" y="-5" width="48" height="44"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+ <state key="normal" image="closeButton@2x.png">
+ <color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <state key="highlighted">
+ <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <action selector="closePhotoButtonPressed:" destination="L5I-mE-d7D" eventType="touchUpInside" id="NhX-y6-FHl"/>
+ </connections>
+ </button>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
<view contentMode="scaleToFill" id="QIi-SX-ZAA">
<rect key="frame" x="0.0" y="-64" width="325" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@@ -109,6 +131,7 @@
</view>
<navigationItem key="navigationItem" title="Wi-Where" id="UUg-sh-XIb"/>
<connections>
+ <outlet property="enlargedPhotoViewOutlet" destination="OOa-i0-nDV" id="xe8-AJ-DKV"/>
<outlet property="loadingOverlay" destination="QIi-SX-ZAA" id="TsT-yj-EFc"/>
<outlet property="mapView" destination="7uf-B3-ybP" id="qbj-0f-eqs"/>
<outlet property="photoViewerUIImageView" destination="O4r-WJ-Sly" id="tZu-Yk-TTA"/>
@@ -361,54 +384,14 @@
<resources>
<image name="appIcon@2x.png" width="114" height="114"/>
<image name="backArrow@2x.png" width="38" height="41"/>
+ <image name="closeButton@2x.png" width="64" height="64"/>
<image name="forwardArrow@2x.png" width="38" height="41"/>
<image name="mapShadow@2x.png" width="640" height="100"/>
<image name="mapShadowTop@2x.png" width="640" height="100"/>
<image name="silverBG@2x.png" width="640" height="1136"/>
<image name="webviewpopout_shelf@2x.png" width="640" height="94"/>
<image name="yelpMapViewShader@2x.png" width="640" height="390"/>
</resources>
- <classes>
- <class className="BookmarksViewController" superclassName="UIViewController">
- <source key="sourceIdentifier" type="project" relativePath="./Classes/BookmarksViewController.h"/>
- <relationships>
- <relationship kind="outlet" name="tableViewOutlet" candidateClass="UITableView"/>
- </relationships>
- </class>
- <class className="FlickrMapViewController" superclassName="UIViewController">
- <source key="sourceIdentifier" type="project" relativePath="./Classes/FlickrMapViewController.h"/>
- <relationships>
- <relationship kind="outlet" name="loadingOverlay" candidateClass="UIView"/>
- <relationship kind="outlet" name="mapView" candidateClass="MKMapView"/>
- <relationship kind="outlet" name="photoViewerUIImageView" candidateClass="UIImageView"/>
- </relationships>
- </class>
- <class className="HistoryViewController" superclassName="UIViewController">
- <source key="sourceIdentifier" type="project" relativePath="./Classes/HistoryViewController.h"/>
- <relationships>
- <relationship kind="outlet" name="historyTableViewOutlet" candidateClass="UITableView"/>
- </relationships>
- </class>
- <class className="YelpMapViewController" superclassName="UIViewController">
- <source key="sourceIdentifier" type="project" relativePath="./Classes/YelpMapViewController.h"/>
- <relationships>
- <relationship kind="outlet" name="photoViewerUIImageView" candidateClass="UIImageView"/>
- <relationship kind="outlet" name="yelpMapView" candidateClass="MKMapView"/>
- </relationships>
- </class>
- <class className="YelpWebPageBrowser" superclassName="UIViewController">
- <source key="sourceIdentifier" type="project" relativePath="./Classes/YelpWebPageBrowser.h"/>
- <relationships>
- <relationship kind="action" name="backButtonPress:"/>
- <relationship kind="action" name="forwardButtonPress:"/>
- <relationship kind="outlet" name="backButton" candidateClass="UIButton"/>
- <relationship kind="outlet" name="forwardButton" candidateClass="UIButton"/>
- <relationship kind="outlet" name="popoutView" candidateClass="UIView"/>
- <relationship kind="outlet" name="popoutViewTextLabel" candidateClass="UILabel"/>
- <relationship kind="outlet" name="webView" candidateClass="UIWebView"/>
- </relationships>
- </class>
- </classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
View
Binary file not shown.

0 comments on commit bce6d23

Please sign in to comment.