Skip to content
Browse files

Cleaning up shop a little.

  • Loading branch information...
1 parent ccdeffe commit d911c0e3ff4f6e4a0112efca456e353c70772abd @jakemarsh committed Jul 22, 2012
View
17 .gitignore
@@ -3,13 +3,20 @@
*.psd
# Xcode
+build/*
*.pbxuser
+!default.pbxuser
*.mode1v3
+!default.mode1v3
*.mode2v3
+!default.mode2v3
*.perspectivev3
-*.xcuserstate
-project.xcworkspace/
-xcuserdata/
+!default.perspectivev3
+*.xcworkspace
+!default.xcworkspace
+xcuserdata
+profile
+*.moved-aside
# Generated files
build/
@@ -18,4 +25,6 @@ build/
# Backup files
*~.nib
-/ graphics/
+/ graphics/
+
+
View
BIN ...eproj/project.xcworkspace/xcuserdata/jakemarsh.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
View
2 JMWhenTappedDemo/JMWhenTappedDemo/AppDelegate.m
@@ -13,7 +13,7 @@ @implementation AppDelegate
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
-
+
_viewController = [[DemoViewController alloc] init];
_window.rootViewController = _viewController;
View
5 JMWhenTappedDemo/JMWhenTappedDemo/DemoViewController.h
@@ -8,9 +8,6 @@
#import <UIKit/UIKit.h>
-@interface DemoViewController : UIViewController {
- UIView *_view1;
- UIView *_view2;
-}
+@interface DemoViewController : UIViewController
@end
View
61 JMWhenTappedDemo/JMWhenTappedDemo/DemoViewController.m
@@ -9,45 +9,72 @@
#import "DemoViewController.h"
#import "JMWhenTapped.h"
+@interface DemoViewController ()
+
+@property (strong, nonatomic) UIView *view1;
+@property (strong, nonatomic) UIView *view2;
+
+@end
+
@implementation DemoViewController
+@synthesize view1 = _view1;
+@synthesize view2 = _view2;
+
- (void) loadView {
[super loadView];
- _view1 = [[UIView alloc] initWithFrame:CGRectMake(20.0, 20.0, 100.0, 100.0)];
- _view1.backgroundColor = [UIColor redColor];
+ self.view1 = [[UIView alloc] initWithFrame:CGRectMake(20.0, 20.0, 100.0, 100.0)];
+ self.view1.backgroundColor = [UIColor redColor];
- [self.view addSubview:_view1];
+ [self.view addSubview:self.view1];
- [_view1 whenTapped:^{
- UIAlertView *a = [[UIAlertView alloc] initWithTitle:@"Tapped!" message:@"You tapped view1! Congratulations!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
+ [self.view1 whenTapped:^{
+ UIAlertView *a = [[UIAlertView alloc] initWithTitle:@"Tapped!"
+ message:@"You tapped view1! Congratulations!"
+ delegate:nil
+ cancelButtonTitle:@"OK"
+ otherButtonTitles:nil];
[a show];
}];
- [_view1 whenDoubleTapped:^{
- UIAlertView *a = [[UIAlertView alloc] initWithTitle:@"Double tapped!" message:@"You double tapped view1! Congratulations!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
+ [self.view1 whenDoubleTapped:^{
+ UIAlertView *a = [[UIAlertView alloc] initWithTitle:@"Double tapped!"
+ message:@"You double tapped view1! Congratulations!"
+ delegate:nil
+ cancelButtonTitle:@"OK"
+ otherButtonTitles:nil];
[a show];
}];
- [_view1 whenTwoFingerTapped:^{
- UIAlertView *a = [[UIAlertView alloc] initWithTitle:@"Two finger tapped!" message:@"You two finger tapped view1! Congratulations!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
+ [self.view1 whenTwoFingerTapped:^{
+ UIAlertView *a = [[UIAlertView alloc] initWithTitle:@"Two finger tapped!"
+ message:@"You two finger tapped view1! Congratulations!"
+ delegate:nil
+ cancelButtonTitle:@"OK"
+ otherButtonTitles:nil];
[a show];
}];
- _view2 = [[UIView alloc] initWithFrame:CGRectMake(140.0, 20.0, 100.0, 100.0)];
- _view2.backgroundColor = [UIColor blueColor];
+ self.view2 = [[UIView alloc] initWithFrame:CGRectMake(140.0, 20.0, 100.0, 100.0)];
+ self.view2.backgroundColor = [UIColor blueColor];
- [self.view addSubview:_view2];
+ [self.view addSubview:self.view2];
- [_view2 whenTouchedDown:^{
- _view2.backgroundColor = [UIColor yellowColor];
+ __block DemoViewController *safeSelf = self;
+ [self.view2 whenTouchedDown:^{
+ safeSelf.view2.backgroundColor = [UIColor yellowColor];
}];
- [_view2 whenTouchedUp:^{
- _view2.backgroundColor = [UIColor blueColor];
+ [self.view2 whenTouchedUp:^{
+ safeSelf.view2.backgroundColor = [UIColor blueColor];
- UIAlertView *a = [[UIAlertView alloc] initWithTitle:@"Tapped!" message:@"You tapped view2! Congratulations!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
+ UIAlertView *a = [[UIAlertView alloc] initWithTitle:@"Tapped!"
+ message:@"You tapped view2! Congratulations!"
+ delegate:nil
+ cancelButtonTitle:@"OK"
+ otherButtonTitles:nil];
[a show];
}];

0 comments on commit d911c0e

Please sign in to comment.
Something went wrong with that request. Please try again.