Wednesday, August 10, 2016

Radio Button In iOS

Radio Button In iOS

For Radio button demo we used

Four Labels and two buttons

Label 1 - Radio button demo text
Label 2 - Select gender text
Label 3 - Male Text
Label 4 - Female Text

Two button for radio selection functionality.
Drag all labels and buttons to view controller at storyboard.

Create iboutlet to h file as follow
#import
#import "TestDelegate.h"
@interface ViewController : UIViewController<TestDelegate>
@property (weak, nonatomic) IBOutlet UILabel *lblValue;

@property (weak, nonatomic) IBOutlet UISlider *slider;

- (IBAction)sliderValueChanged:(id)sender;

- (IBAction)btnMale:(id)sender;
- (IBAction)btnFemale:(id)sender;
@property (weak, nonatomic) IBOutlet UIButton *ioMale;
@property (weak, nonatomic) IBOutlet UIButton *ioFemale;

@end

In .m File do following functionality

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



- (IBAction)btnMale:(id)sender {
   [self.ioMale setBackgroundImage:[UIImage imageNamed:@"radio_checked.png"] forState:UIControlStateNormal];
    [self.ioFemale setBackgroundImage:[UIImage imageNamed:@"radio_uncheck.png"] forState:UIControlStateNormal];
    
}

- (IBAction)btnFemale:(id)sender {[self.ioMale setBackgroundImage:[UIImage imageNamed:@"radio_uncheck.png"] forState:UIControlStateNormal];
    [self.ioFemale setBackgroundImage:[UIImage imageNamed:@"radio_checked.png"] forState:UIControlStateNormal];
}

#pragma mark - Sample protocol delegate
-(void)processCompleted{
   
}
@end

Upload UIImage as base64 String

Upload UIImage as Base64 String (Upload UIImage as string) //Select Pic From Camera or Gallery       @objc func btnPro...