Skip to content

Commit

Permalink
implemented back action on tap
Browse files Browse the repository at this point in the history
  • Loading branch information
surganov committed Jul 31, 2013
1 parent a4eefe0 commit 7e64e8c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
3 changes: 3 additions & 0 deletions 09 Web Art/Web Art/WebArtViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@

@interface WebArtViewController : UIViewController

@property (nonatomic, strong) UIWebView *myWebView;
- (IBAction)tapRecognized:(id)sender;

@end
12 changes: 8 additions & 4 deletions 09 Web Art/Web Art/WebArtViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ - (void)viewDidLoad
{
[super viewDidLoad];

UIWebView *myWebView=[[UIWebView alloc] initWithFrame:CGRectMake(64, 38, 194, 226)];
[self.view addSubview:myWebView];
myWebView.scalesPageToFit = YES;
[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.newrafael.com/websites"]]];
self.myWebView = [[UIWebView alloc] initWithFrame:CGRectMake(64, 38, 194, 226)];
[self.view addSubview:self.myWebView];
self.myWebView.scalesPageToFit = YES;
[self.myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.newrafael.com/websites"]]];
}

- (IBAction)tapRecognized:(id)sender {
NSLog(@"tapped");
[self.myWebView goBack];
}
@end
21 changes: 19 additions & 2 deletions 09 Web Art/Web Art/en.lproj/MainStoryboard.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<objects>
<viewController id="2" customClass="WebArtViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="3">
<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="480"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="webart.png" id="QNq-CJ-rUo">
Expand All @@ -22,19 +22,36 @@
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<gestureRecognizers/>
<connections>
<outletCollection property="gestureRecognizers" destination="N1a-YB-Hs9" appends="YES" id="fug-oT-Y63"/>
</connections>
</view>
<nil key="simulatedStatusBarMetrics"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4" sceneMemberID="firstResponder"/>
<tapGestureRecognizer id="N1a-YB-Hs9">
<connections>
<action selector="tapRecognized:" destination="2" id="i2M-lY-rDv"/>
</connections>
</tapGestureRecognizer>
</objects>
</scene>
</scenes>
<resources>
<image name="webart.png" width="649" height="1136"/>
</resources>
<classes>
<class className="WebArtViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/WebArtViewController.h"/>
<relationships>
<relationship kind="action" name="tapRecognized:"/>
</relationships>
</class>
</classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

0 comments on commit 7e64e8c

Please sign in to comment.