Skip to content

Instantly share code, notes, and snippets.

@setoh2000
Created November 15, 2012 20:43
Show Gist options
  • Save setoh2000/4081131 to your computer and use it in GitHub Desktop.
Save setoh2000/4081131 to your computer and use it in GitHub Desktop.
UIViewのhiddenの代わりにvisibleを使いたい人へ
#import <UIKit/UIKit.h>
@interface UIView (visible)
- (void)setVisible:(BOOL)flag;
- (BOOL)visible;
@end
#import "UIView+visible.h"
@implementation UIView (visible)
- (void)setVisible:(BOOL)flag
{
self.hidden =!flag;
}
- (BOOL)visible
{
return !self.hidden;
}
@end
@setoh2000
Copy link
Author

こんな感じでプロパティみたいに使えるよ。
view.visible = YES;
view.visible = NO;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment