Skip to content

Commit

Permalink
Add buttons to views
Browse files Browse the repository at this point in the history
  • Loading branch information
zachwill committed Apr 30, 2012
1 parent 69c27a3 commit eac6ae7
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 4 deletions.
9 changes: 9 additions & 0 deletions Beautiful Maps.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
797F30F9154E439B002EB3DD /* compass@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 797F30F8154E439B002EB3DD /* compass@2x.png */; };
79B82D4A154DF7A2009DF3FB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79B82D49154DF7A2009DF3FB /* UIKit.framework */; };
79B82D4C154DF7A2009DF3FB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79B82D4B154DF7A2009DF3FB /* Foundation.framework */; };
79B82D4E154DF7A2009DF3FB /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79B82D4D154DF7A2009DF3FB /* CoreGraphics.framework */; };
Expand All @@ -25,9 +26,11 @@
79B82D7F154E199B009DF3FB /* screenshot.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 79B82D7E154E199B009DF3FB /* screenshot.jpg */; };
79B82D81154E2181009DF3FB /* manhattan.png in Resources */ = {isa = PBXBuildFile; fileRef = 79B82D80154E2181009DF3FB /* manhattan.png */; };
79B82D83154E2E5A009DF3FB /* tokyo.png in Resources */ = {isa = PBXBuildFile; fileRef = 79B82D82154E2E59009DF3FB /* tokyo.png */; };
79B82D85154E3FAE009DF3FB /* compass.png in Resources */ = {isa = PBXBuildFile; fileRef = 79B82D84154E3FAE009DF3FB /* compass.png */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
797F30F8154E439B002EB3DD /* compass@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "compass@2x.png"; sourceTree = "<group>"; };
79B82D45154DF7A2009DF3FB /* Beautiful Maps.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Beautiful Maps.app"; sourceTree = BUILT_PRODUCTS_DIR; };
79B82D49154DF7A2009DF3FB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
79B82D4B154DF7A2009DF3FB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
Expand All @@ -53,6 +56,7 @@
79B82D7E154E199B009DF3FB /* screenshot.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = screenshot.jpg; sourceTree = "<group>"; };
79B82D80154E2181009DF3FB /* manhattan.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = manhattan.png; sourceTree = "<group>"; };
79B82D82154E2E59009DF3FB /* tokyo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tokyo.png; sourceTree = "<group>"; };
79B82D84154E3FAE009DF3FB /* compass.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = compass.png; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -154,6 +158,8 @@
79B82D77154E12FA009DF3FB /* Images */ = {
isa = PBXGroup;
children = (
79B82D84154E3FAE009DF3FB /* compass.png */,
797F30F8154E439B002EB3DD /* compass@2x.png */,
79B82D7E154E199B009DF3FB /* screenshot.jpg */,
79B82D78154E13C1009DF3FB /* dfw.png */,
79B82D80154E2181009DF3FB /* manhattan.png */,
Expand Down Expand Up @@ -226,6 +232,8 @@
79B82D7F154E199B009DF3FB /* screenshot.jpg in Resources */,
79B82D81154E2181009DF3FB /* manhattan.png in Resources */,
79B82D83154E2E5A009DF3FB /* tokyo.png in Resources */,
79B82D85154E3FAE009DF3FB /* compass.png in Resources */,
797F30F9154E439B002EB3DD /* compass@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -358,6 +366,7 @@
79B82D6D154DF7A2009DF3FB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
1 change: 1 addition & 0 deletions Beautiful Maps/BeautifulMapsDataViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@

@property (strong, nonatomic) id dataObject;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UIButton *compassButton;

@end
3 changes: 3 additions & 0 deletions Beautiful Maps/BeautifulMapsDataViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ @interface BeautifulMapsDataViewController ()

@implementation BeautifulMapsDataViewController
@synthesize imageView;
@synthesize compassButton;

- (void)viewDidLoad
{
Expand All @@ -22,6 +23,7 @@ - (void)viewDidLoad
NSString *city = [[self.dataObject description] lowercaseString];
NSString *imageName = [NSString stringWithFormat:@"%@.png", city];
self.imageView.image = [UIImage imageNamed:imageName];
[compassButton setShowsTouchWhenHighlighted:YES];
}

- (void)viewWillAppear:(BOOL)animated
Expand All @@ -36,6 +38,7 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface

- (void)viewDidUnload {
[self setImageView:nil];
[self setCompassButton:nil];
[super viewDidUnload];
}
@end
Binary file added Beautiful Maps/compass.png
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 Beautiful Maps/compass@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 37 additions & 4 deletions Beautiful Maps/en.lproj/MainStoryboard.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,53 @@
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="6" sceneMemberID="firstResponder"/>
<viewController storyboardIdentifier="BeautifulMapsDataViewController" id="5" customClass="BeautifulMapsDataViewController" sceneMemberID="viewController">
<imageView key="view" userInteractionEnabled="NO" contentMode="scaleAspectFill" image="dfw.png" id="r42-xN-Mr4">
<view key="view" contentMode="scaleToFill" id="jLm-r3-qc6">
<rect key="frame" x="0.0" y="20" width="768" height="1004"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" image="manhattan.png" id="X02-J7-TWR">
<rect key="frame" x="0.0" y="0.0" width="768" height="1004"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="IFc-lZ-jub">
<rect key="frame" x="10" y="947" width="44" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="compass.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>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="infoLight" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="Bs2-SM-biy">
<rect key="frame" x="730" y="956" width="18" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal">
<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>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<connections>
<outlet property="imageView" destination="r42-xN-Mr4" id="uTr-8H-a5C"/>
<outlet property="compassButton" destination="IFc-lZ-jub" id="WxW-QP-hHL"/>
<outlet property="imageView" destination="X02-J7-TWR" id="Off-zt-9MJ"/>
</connections>
</viewController>
</objects>
<point key="canvasLocation" x="896" y="-243"/>
</scene>
</scenes>
<resources>
<image name="dfw.png" width="2048" height="1536"/>
<image name="compass.png" width="20" height="20"/>
<image name="manhattan.png" width="2048" height="1536"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
Expand Down

0 comments on commit eac6ae7

Please sign in to comment.