mirror of
https://github.com/nednal12/APLOC2.git
synced 2024-06-06 14:29:30 +00:00
Most of the UI is working
This commit is contained in:
parent
2dfac4a1dd
commit
36d5d035b7
Binary file not shown.
Binary file not shown.
|
@ -11,11 +11,20 @@
|
||||||
@interface ViewController : UIViewController
|
@interface ViewController : UIViewController
|
||||||
{
|
{
|
||||||
IBOutlet UISegmentedControl *segmentControl;
|
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)onChange:(id)sender;
|
||||||
|
|
||||||
-(IBAction)onClick:(id)sender;
|
-(IBAction)onClick:(id)sender;
|
||||||
|
|
||||||
|
-(IBAction)onStepChange:(id)sender;
|
||||||
|
|
||||||
|
-(IBAction)onClassButtonClick:(id)sender;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -15,6 +15,76 @@
|
||||||
|
|
||||||
@implementation ViewController
|
@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
|
-(IBAction)onClick:(id)sender
|
||||||
{
|
{
|
||||||
ViewController2 *secondView = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil];
|
ViewController2 *secondView = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil];
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user