Saturday 3 October 2015

How To Use Animated ANd Hide Show UIView In Ios/Iphone

==> First Take Pne IBOutlet Of UIView And Then Use Animated:
==> How to Hide ANd Show Some Kind Of UIView In Ios:
import <UIKit/UIKit.h>

@interface ViewController: UIViewController
@property (strong, nonatomic) IBOutlet UIView *cautionView;


- (IBAction)btnToggleClick:(id)sender;
@property (strong, nonatomic) IBOutlet UIButton *btnToggle;
@end
.m file:

#import "ViewController.h"

@interface ViewController()
@end

@implementation ViewController

bool isShown = false;
- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
=> USe tHIS Action To toggle Click On Button:-
 - (IBAction)btnToggleClick:(id)sender {
    if (!isShown) {
        _cautionView.frame =  CGRectMake(130, 20, 0, 0);
        [UIView animateWithDuration:0.25 animations:^{
            _cautionView.frame =  CGRectMake(130, 30, 100, 200);
        }];
        isShown = true;
    } else {
        [UIView animateWithDuration:0.25 animations:^{
            _cautionView.frame =  CGRectMake(130, 30, 0, 0);
        }];
        isShown = false;
    }
}
=> Based ON Button Click Hide And Show And Make UIView Frmae Size On
   Button Clikced:-