Ignore:
Timestamp:
12/29/13 12:05:32 (6 years ago)
Author:
Steve Castellotti <sc@…>
Branches:
master, Servo
Children:
d5f1a91
Parents:
6db346c
Message:
  • Tilt Control UISwitches converted to use Storyboards
File:
1 edited

Legend:

Unmodified
Added
Removed
  • iOS/Orbit/Orbit/controllers/AdvancedViewController.m

    r6db346c rd42b042  
    3333//   [alert show]; 
    3434    
    35     
    36    UISwitch *switchTiltSensorControl = [[UISwitch alloc] initWithFrame:CGRectMake(10, 310, 0, 0)]; 
    37    [switchTiltSensorControl addTarget:self action:@selector(changeSwitchTiltSensorControl:) forControlEvents:UIControlEventValueChanged]; 
    38    [self.view addSubview:switchTiltSensorControl]; 
    39     
    40    UISwitch *switchTiltSensorControlThrottle = [[UISwitch alloc] initWithFrame:CGRectMake(148, 310, 0, 0)]; 
    41    [switchTiltSensorControlThrottle addTarget:self action:@selector(changeSwitchTiltSensorControlThrottle:) forControlEvents:UIControlEventValueChanged]; 
    42    [self.view addSubview:switchTiltSensorControlThrottle]; 
     35//   UISwitch *switchTiltSensorControl = [[UISwitch alloc] initWithFrame:CGRectMake(14, 310, 0, 0)]; 
     36//   [switchTiltSensorControl addTarget:self action:@selector(changeSwitchTiltSensorControl:) forControlEvents:UIControlEventValueChanged]; 
     37//   [self.view addSubview:switchTiltSensorControl]; 
     38//    
     39//   UISwitch *switchTiltSensorControlThrottle = [[UISwitch alloc] initWithFrame:CGRectMake(154, 310, 0, 0)]; 
     40//   [switchTiltSensorControlThrottle addTarget:self action:@selector(changeSwitchTiltSensorControlThrottle:) forControlEvents:UIControlEventValueChanged]; 
     41//   [self.view addSubview:switchTiltSensorControlThrottle]; 
    4342    
    4443} 
     
    9998} 
    10099 
    101 - (void)changeSwitchTiltSensorControl:(id)sender{ 
    102     
     100 
     101//-(IBAction)Switch { 
     102//    
     103//   if (Switch.on) { 
     104//      label.text = @"The switch is on, button 1 is now shown"; 
     105//      button1.hidden = NO; 
     106//      button2.hidden = YES; 
     107//   } 
     108//    
     109//   else { 
     110//      label.text = @"The switch is on, button 2 is now shown"; 
     111//      button1.hidden = YES; 
     112//      button2.hidden = NO; 
     113//   } 
     114//    
     115//} 
     116 
     117 
     118//- (void)changeSwitchTiltSensorControl:(id)sender{ 
     119- (IBAction)changeSwitchTiltSensorControl:(id)sender{ 
     120 
    103121   if([sender isOn]){ 
    104122      NSLog(@"DEBUG: Tilt Sensor Enabled"); 
     
    109127} 
    110128 
    111 - (void)changeSwitchTiltSensorControlThrottle:(id)sender{ 
     129//- (void)changeSwitchTiltSensorControlThrottle:(id)sender{ 
     130- (IBAction)changeSwitchTiltSensorControlThrottle:(id)sender{ 
    112131    
    113132   if([sender isOn]){ 
Note: See TracChangeset for help on using the changeset viewer.