Return to Snippet

Revision: 59381
at September 5, 2012 03:49 by Develomentional


Initial Code
-(void)hideShow:(BOOL)YN{
  Switch(YN)
    Case 0:

Self.button.layer.hidden = YES;
   
     break;
  
   Case 1:

Self.button.layer.hidden = NO;

     break;
}
//usage:

[self hideShow:YES];//button is visible

[self hideShow:NO];//button is hidden

//text field outlets will work too like this
Self.myTextFieldOutlet.hidden =YES;

Initial URL

                                

Initial Description
Shows how to make a text field or UIButton visible or hidden in a method by passing a bool in you can make it hide or show the object just change states if its hidden it would show or if visible it would become hidden but I like to control that so it does what I want when I want.

Initial Title
Hide and show buttons or textfields

Initial Tags

                                

Initial Language
Objective C