Skip to content

Commit 01a7716

Browse files
committed
add lecture 6 dani example
1 parent f91093e commit 01a7716

36 files changed

+1912
-0
lines changed

examples/lecture_6/NavigationTests/NavigationTests.xcodeproj/project.pbxproj

Lines changed: 354 additions & 0 deletions
Large diffs are not rendered by default.

examples/lecture_6/NavigationTests/NavigationTests.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
6+
<true/>
7+
<key>IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges</key>
8+
<false/>
9+
</dict>
10+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
type = "1"
4+
version = "1.0">
5+
<FileBreakpoints>
6+
<FileBreakpoint
7+
shouldBeEnabled = "No"
8+
ignoreCount = "0"
9+
continueAfterRunningActions = "No"
10+
isPathRelative = "1"
11+
filePath = "NavigationTests/TestTableVC.m"
12+
timestampString = "349025957.99755"
13+
startingColumnNumber = "9223372036854775807"
14+
endingColumnNumber = "9223372036854775807"
15+
startingLineNumber = "86"
16+
endingLineNumber = "86"
17+
landmarkName = "-tableView:cellForRowAtIndexPath:"
18+
landmarkType = "5">
19+
</FileBreakpoint>
20+
</FileBreakpoints>
21+
</Bucket>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
version = "1.3">
4+
<BuildAction
5+
parallelizeBuildables = "YES"
6+
buildImplicitDependencies = "YES">
7+
<BuildActionEntries>
8+
<BuildActionEntry
9+
buildForTesting = "YES"
10+
buildForRunning = "YES"
11+
buildForProfiling = "YES"
12+
buildForArchiving = "YES"
13+
buildForAnalyzing = "YES">
14+
<BuildableReference
15+
BuildableIdentifier = "primary"
16+
BlueprintIdentifier = "5E96154B14B4831700D53517"
17+
BuildableName = "NavigationTests.app"
18+
BlueprintName = "NavigationTests"
19+
ReferencedContainer = "container:NavigationTests.xcodeproj">
20+
</BuildableReference>
21+
</BuildActionEntry>
22+
</BuildActionEntries>
23+
</BuildAction>
24+
<TestAction
25+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
26+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
27+
shouldUseLaunchSchemeArgsEnv = "YES"
28+
buildConfiguration = "Debug">
29+
<Testables>
30+
</Testables>
31+
<MacroExpansion>
32+
<BuildableReference
33+
BuildableIdentifier = "primary"
34+
BlueprintIdentifier = "5E96154B14B4831700D53517"
35+
BuildableName = "NavigationTests.app"
36+
BlueprintName = "NavigationTests"
37+
ReferencedContainer = "container:NavigationTests.xcodeproj">
38+
</BuildableReference>
39+
</MacroExpansion>
40+
</TestAction>
41+
<LaunchAction
42+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
43+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
44+
launchStyle = "0"
45+
useCustomWorkingDirectory = "NO"
46+
buildConfiguration = "Debug"
47+
debugDocumentVersioning = "YES"
48+
allowLocationSimulation = "YES">
49+
<BuildableProductRunnable>
50+
<BuildableReference
51+
BuildableIdentifier = "primary"
52+
BlueprintIdentifier = "5E96154B14B4831700D53517"
53+
BuildableName = "NavigationTests.app"
54+
BlueprintName = "NavigationTests"
55+
ReferencedContainer = "container:NavigationTests.xcodeproj">
56+
</BuildableReference>
57+
</BuildableProductRunnable>
58+
<AdditionalOptions>
59+
</AdditionalOptions>
60+
</LaunchAction>
61+
<ProfileAction
62+
shouldUseLaunchSchemeArgsEnv = "YES"
63+
savedToolIdentifier = ""
64+
useCustomWorkingDirectory = "NO"
65+
buildConfiguration = "Release"
66+
debugDocumentVersioning = "YES">
67+
<BuildableProductRunnable>
68+
<BuildableReference
69+
BuildableIdentifier = "primary"
70+
BlueprintIdentifier = "5E96154B14B4831700D53517"
71+
BuildableName = "NavigationTests.app"
72+
BlueprintName = "NavigationTests"
73+
ReferencedContainer = "container:NavigationTests.xcodeproj">
74+
</BuildableReference>
75+
</BuildableProductRunnable>
76+
</ProfileAction>
77+
<AnalyzeAction
78+
buildConfiguration = "Debug">
79+
</AnalyzeAction>
80+
<ArchiveAction
81+
buildConfiguration = "Release"
82+
revealArchiveInOrganizer = "YES">
83+
</ArchiveAction>
84+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>NavigationTests.xcscheme</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
<key>SuppressBuildableAutocreation</key>
14+
<dict>
15+
<key>5E96154B14B4831700D53517</key>
16+
<dict>
17+
<key>primary</key>
18+
<true/>
19+
</dict>
20+
</dict>
21+
</dict>
22+
</plist>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// AnotherVC.h
3+
// NavigationTests
4+
//
5+
// Created by Dani Rangelov on 1/4/12.
6+
// Copyright (c) 2012 Ten Touch. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@class CustomView;
12+
13+
@interface AnotherVC : UIViewController <UIGestureRecognizerDelegate> {
14+
CustomView *containerView;
15+
}
16+
17+
18+
@property(nonatomic, copy, getter = anotherGetter) NSString *myString;
19+
20+
@end
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
//
2+
// AnotherVC.m
3+
// NavigationTests
4+
//
5+
// Created by Dani Rangelov on 1/4/12.
6+
// Copyright (c) 2012 Ten Touch. All rights reserved.
7+
//
8+
9+
#import "AnotherVC.h"
10+
#import "BlueVC.h"
11+
#import "CustomView.h"
12+
13+
@implementation AnotherVC
14+
15+
@synthesize myString = _myString;
16+
17+
- (void)dealloc {
18+
[containerView release];
19+
20+
[super dealloc];
21+
}
22+
23+
- (NSString *)anotherGetter {
24+
return _myString;
25+
}
26+
27+
- (void)setMyString:(NSString *)newString {
28+
29+
//if ([_myString isEqualToString:newString]) {
30+
if (_myString != newString) {
31+
[_myString release];
32+
_myString = nil;
33+
_myString = [newString copy];
34+
}
35+
}
36+
37+
#pragma mark - View lifecycle
38+
39+
40+
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
41+
- (void)viewDidLoad
42+
{
43+
[super viewDidLoad];
44+
45+
self.view.backgroundColor = [UIColor blueColor];
46+
UIImageView *bkImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Fatal_Error.gif"]];
47+
//[self.view addSubview:bkImage];
48+
49+
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)];
50+
tapGesture.delegate = self;
51+
52+
[self.view addGestureRecognizer:tapGesture];
53+
[tapGesture release];
54+
55+
UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"FATAL ERROR 404!"
56+
message:@"You MUST enter text before going back!."
57+
delegate:nil
58+
cancelButtonTitle:@"I am entering text"
59+
otherButtonTitles:nil];
60+
61+
//[message show];
62+
63+
UITextField *myTextField = [[UITextField alloc] initWithFrame:CGRectMake(30, 100, 200, 30)];
64+
65+
66+
myTextField.borderStyle = UITextBorderStyleRoundedRect;
67+
myTextField.placeholder = @"Email";
68+
myTextField.text = [[NSUserDefaults standardUserDefaults] stringForKey:@"email"];
69+
myTextField.spellCheckingType = UITextSpellCheckingTypeNo;
70+
myTextField.autocorrectionType = UITextAutocorrectionTypeNo;
71+
myTextField.delegate = self;
72+
[self.view addSubview:myTextField];
73+
74+
[myTextField release];
75+
76+
containerView = [[CustomView alloc] initWithFrame:CGRectMake(20, 20, 200, 200)];
77+
//[self.view addSubview:containerView];
78+
}
79+
80+
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
81+
if (touch.view == self.view) return YES;
82+
return NO;
83+
}
84+
85+
- (void)handleTapGesture:(UITapGestureRecognizer*)tap {
86+
87+
NSLog(@"tap.view = %@", tap.view);
88+
89+
90+
NSLog(@"Go to BlueVC");
91+
UIViewController *anotherController = [[BlueVC alloc] init];
92+
[self.navigationController pushViewController:anotherController animated:YES];
93+
[anotherController release];
94+
}
95+
96+
97+
98+
99+
@end
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// AppDelegate.h
3+
// NavigationTests
4+
//
5+
// Created by Dani Rangelov on 1/4/12.
6+
// Copyright (c) 2012 Ten Touch. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
//@class ViewController;
12+
13+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
14+
15+
@property (strong, nonatomic) UIWindow *window;
16+
@property (nonatomic, retain) UINavigationController *navigationController;
17+
18+
//@property (strong, nonatomic) ViewController *viewController;
19+
20+
@end

0 commit comments

Comments
 (0)