Created
August 13, 2014 21:29
-
-
Save RavisMsk/a9c60c50b2ac479f7c6c to your computer and use it in GitHub Desktop.
The Lost "Visible" Property
This file contains 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
// | |
// UILabel+Visible.h | |
// Gisting | |
// | |
// Created by Anisimov Nikita on 14.08.14. | |
// Copyright (c) 2014 Anisimov Nikita. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UILabel (Visible) | |
@property (nonatomic) BOOL visible; | |
@end |
This file contains 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
// | |
// UILabel+Visible.m | |
// Gisting | |
// | |
// Created by Anisimov Nikita on 14.08.14. | |
// Copyright (c) 2014 Anisimov Nikita. All rights reserved. | |
// | |
#import "UILabel+Visible.h" | |
@implementation UILabel (Visible) | |
- (void)setVisible:(BOOL)visible{ | |
self.alpha = visible?1.0:0.0; | |
} | |
- (BOOL)visible{ | |
return self.alpha>=.5; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment