Skip to content

Instantly share code, notes, and snippets.

@RavisMsk
Created August 13, 2014 21:29
Show Gist options
  • Save RavisMsk/a9c60c50b2ac479f7c6c to your computer and use it in GitHub Desktop.
Save RavisMsk/a9c60c50b2ac479f7c6c to your computer and use it in GitHub Desktop.
The Lost "Visible" Property
//
// 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
//
// 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