Created
November 15, 2012 20:43
-
-
Save setoh2000/4081131 to your computer and use it in GitHub Desktop.
UIViewのhiddenの代わりにvisibleを使いたい人へ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UIView (visible) | |
- (void)setVisible:(BOOL)flag; | |
- (BOOL)visible; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "UIView+visible.h" | |
@implementation UIView (visible) | |
- (void)setVisible:(BOOL)flag | |
{ | |
self.hidden =!flag; | |
} | |
- (BOOL)visible | |
{ | |
return !self.hidden; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
こんな感じでプロパティみたいに使えるよ。
view.visible = YES;
view.visible = NO;