diff --git a/Week1/APLOC2 Week 1/APLOC2 Week 1.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate b/Week1/APLOC2 Week 1/APLOC2 Week 1.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate index 4414114..399ce11 100644 Binary files a/Week1/APLOC2 Week 1/APLOC2 Week 1.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate and b/Week1/APLOC2 Week 1/APLOC2 Week 1.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Week2/APLOCWeek2/APLOCWeek2.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate b/Week2/APLOCWeek2/APLOCWeek2.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate index 26fdd6e..a5b741f 100644 Binary files a/Week2/APLOCWeek2/APLOCWeek2.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate and b/Week2/APLOCWeek2/APLOCWeek2.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Week2/APLOCWeek2/APLOCWeek2/ViewController.h b/Week2/APLOCWeek2/APLOCWeek2/ViewController.h index aed7509..8530307 100644 --- a/Week2/APLOCWeek2/APLOCWeek2/ViewController.h +++ b/Week2/APLOCWeek2/APLOCWeek2/ViewController.h @@ -11,11 +11,20 @@ @interface ViewController : UIViewController { IBOutlet UISegmentedControl *segmentControl; - UIViewController *viewController; + IBOutlet UIStepper *stepperControl; + IBOutlet UIButton *cricketButton; + IBOutlet UIButton *butterflyButton; + IBOutlet UIButton *antButton; + IBOutlet UIButton *executeButton; + IBOutlet UITextField *textBox; } -(IBAction)onChange:(id)sender; -(IBAction)onClick:(id)sender; +-(IBAction)onStepChange:(id)sender; + +-(IBAction)onClassButtonClick:(id)sender; + @end diff --git a/Week2/APLOCWeek2/APLOCWeek2/ViewController.m b/Week2/APLOCWeek2/APLOCWeek2/ViewController.m index e50c722..b17092e 100644 --- a/Week2/APLOCWeek2/APLOCWeek2/ViewController.m +++ b/Week2/APLOCWeek2/APLOCWeek2/ViewController.m @@ -15,6 +15,76 @@ @implementation ViewController +-(IBAction)onClassButtonClick:(id)sender +{ + UIButton *classButton = (UIButton*)sender; + if (classButton.tag == 0) + { + textBox.text = @"Cricket"; + stepperControl.enabled = TRUE; + classButton.enabled = FALSE; + antButton.enabled = TRUE; + butterflyButton.enabled = TRUE; + stepperControl.value = 0; + } + else if (classButton.tag == 1) + { + textBox.text = @"Butterfly"; + stepperControl.enabled = TRUE; + classButton.enabled = FALSE; + antButton.enabled = TRUE; + cricketButton.enabled = TRUE; + stepperControl.value = 0; + + } + else if (classButton.tag == 2) + { + textBox.text = @"Ant"; + stepperControl.enabled = TRUE; + classButton.enabled = FALSE; + cricketButton.enabled = TRUE; + butterflyButton.enabled = TRUE; + stepperControl.value = 0; + + } +} + +-(IBAction)onStepChange:(id)sender +{ + UIStepper *stepControl = (UIStepper*) sender; + if (stepControl != nil) + { + int currentValue = stepControl.value; + + if (currentValue == 1) + { + if (cricketButton.enabled == FALSE) + { + textBox.text = @"Cricket"; + } + else if (butterflyButton.enabled == FALSE) + { + textBox.text = @"Butterfly"; + } + else textBox.text = @"Ant"; + } + + else + { + if (cricketButton.enabled == FALSE) + { + textBox.text = [NSString stringWithFormat:@"%d Crickets", currentValue]; + } + else if (butterflyButton.enabled == FALSE) + { + textBox.text = [NSString stringWithFormat:@"%d Butterflies", currentValue]; + } + else textBox.text = [NSString stringWithFormat:@"%d Ants", currentValue]; + } + + } +} + -(IBAction)onClick:(id)sender { ViewController2 *secondView = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil]; diff --git a/Week2/APLOCWeek2/APLOCWeek2/en.lproj/ViewController_iPhone.xib b/Week2/APLOCWeek2/APLOCWeek2/en.lproj/ViewController_iPhone.xib index 1fe6e4d..8b5280f 100644 --- a/Week2/APLOCWeek2/APLOCWeek2/en.lproj/ViewController_iPhone.xib +++ b/Week2/APLOCWeek2/APLOCWeek2/en.lproj/ViewController_iPhone.xib @@ -15,6 +15,8 @@ IBProxyObject IBUIButton IBUISegmentedControl + IBUIStepper + IBUITextField IBUIView @@ -37,19 +39,17 @@ 274 - + 292 {{0, 519}, {320, 30}} - _NS:9 NO IBCocoaTouchFramework 2 3 - 0 Red Blue @@ -76,12 +76,13 @@ - + 292 {{247, 0}, {73, 33}} + _NS:9 NO IBCocoaTouchFramework @@ -89,7 +90,7 @@ 0 1 Info - + 3 MQA @@ -97,31 +98,179 @@ 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - + 3 MC41AA - + 2 15 - + Helvetica-Bold 15 16 + + + 292 + {{122, 80}, {178, 30}} + + + + _NS:9 + NO + YES + NO + IBCocoaTouchFramework + 0 + + 3 + Select Insect + + 3 + MAA + + 2 + + + YES + 17 + + IBCocoaTouchFramework + + + 1 + 14 + + + Helvetica + 14 + 16 + + + + + 268 + {{20, 82}, {94, 27}} + + + + _NS:9 + NO + YES + IBCocoaTouchFramework + NO + 0 + 0 + YES + 1 + 1 + 10 + + + + 292 + {{20, 164}, {86, 44}} + + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Cricket + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + + + 292 + {{208, 164}, {86, 44}} + + + + _NS:9 + NO + 2 + IBCocoaTouchFramework + 0 + 0 + 1 + Ant + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + + + 292 + {{114, 164}, {86, 44}} + + + + _NS:9 + NO + 1 + IBCocoaTouchFramework + 0 + 0 + 1 + Butterfly + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + + + 292 + {{20, 416}, {280, 44}} + + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Execute + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + {{0, 20}, {320, 548}} - + 3 MC43NQA - - 2 - + NO @@ -159,14 +308,62 @@ segmentControl - + 15 + + + stepperControl + + + + 85 + + + + antButton + + + + 86 + + + + butterflyButton + + + + 87 + + + + cricketButton + + + + 88 + + + + executeButton + + + + 89 + + + + textBox + + + + 93 + onChange: - + 13 @@ -175,12 +372,48 @@ onClick: - + 7 27 + + + onStepChange: + + + 13 + + 84 + + + + onClassButtonClick: + + + 7 + + 90 + + + + onClassButtonClick: + + + 7 + + 92 + + + + onClassButtonClick: + + + 7 + + 91 + @@ -205,8 +438,8 @@ 6 - - + + 6 0 @@ -221,8 +454,8 @@ 29 3 - - + + 5 0 @@ -237,8 +470,8 @@ 29 3 - - + + 4 0 @@ -253,8 +486,88 @@ 29 3 - - + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 4 + 0 + + 4 + 1 + + 89 + + 1000 + + 3 + 9 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + 3 0 @@ -269,8 +582,8 @@ 29 3 - - + + 6 0 @@ -285,37 +598,187 @@ 29 3 - - + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 3 + 0 + + 3 + 1 + + 164 + + 1000 + + 3 + 9 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 3 + 0 + + 3 + 1 + + 80 + + 1000 + + 3 + 9 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + + + + + + 8 - + 14 - + 13 - + 11 - + 18 - + - - + + 8 0 @@ -325,13 +788,13 @@ 32 1000 - + 3 9 1 - - + + 7 0 @@ -341,7 +804,7 @@ 73 1000 - + 3 9 1 @@ -351,23 +814,194 @@ 21 - + 22 - + 24 - - + + 26 - - + + + + + 28 + + + + + + 36 + + + + + 37 + + + + + 38 + + + + + 7 + 0 + + 0 + 1 + + 94 + + 1000 + + 3 + 9 + 1 + + + + + + 42 + + + + + 43 + + + + + 44 + + + + + 45 + + + + + 46 + + + + + 7 + 0 + + 0 + 1 + + 86 + + 1000 + + 3 + 9 + 1 + + + + + + 49 + + + + + 50 + + + + + 51 + + + + + 7 + 0 + + 0 + 1 + + 86 + + 1000 + + 3 + 9 + 1 + + + + + + 54 + + + + + 65 + + + + + 69 + + + + + 70 + + + + + 72 + + + + + 73 + + + + + 74 + + + + + + 81 + + + + + 83 + + + + + 78 + + + + + 66 + + @@ -381,31 +1015,84 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + + + + + + + + + + + + + + + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 27 + 97 @@ -422,29 +1109,67 @@ UIViewController id + id id + id onChange: id + + onClassButtonClick: + id + onClick: id + + onStepChange: + id + - - segmentControl - UISegmentedControl - - - segmentControl - + + UIButton + UIButton + UIButton + UIButton + UISegmentedControl + UIStepper + UITextField + + + + antButton + UIButton + + + butterflyButton + UIButton + + + cricketButton + UIButton + + + executeButton + UIButton + + segmentControl UISegmentedControl - + + stepperControl + UIStepper + + + textBox + UITextField + + IBProjectSource ./Classes/ViewController.h