Changeset d42b042 in orbit for iOS/Orbit/Orbit/controllers


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

Legend:

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

    r6db346c rd42b042  
    2121@property (nonatomic, retain) IBOutlet UISlider *pitch; 
    2222@property (nonatomic, retain) IBOutlet UIBarButtonItem *resetButton; 
     23@property (nonatomic, retain) IBOutlet UISwitch *switchTiltSensorControl; 
     24@property (nonatomic, retain) IBOutlet UISwitch *switchTiltSensorControlThrottle; 
    2325 
    2426- (IBAction) pitchChanged:(id)sender; 
     
    2830- (IBAction) resetButtonPressed:(id)button; 
    2931 
     32//- (void)changeSwitchTiltSensorControl:(id)sender; 
     33//- (void)changeSwitchTiltSensorControlThrottle:(id)sender; 
     34- (IBAction)changeSwitchTiltSensorControl:(id)sender; 
     35- (IBAction)changeSwitchTiltSensorControlThrottle:(id)sender; 
     36 
    3037@end 
  • 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.