Last active
January 3, 2016 15:29
-
-
Save ngutman/8483664 to your computer and use it in GitHub Desktop.
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 "GGOverlayView.h" | |
@interface GGOverlayView () | |
@property (nonatomic, strong) UIImageView *imageView; | |
@end | |
@implementation GGOverlayView | |
- (id)initWithFrame:(CGRect)frame { | |
self = [super initWithFrame:frame]; | |
if (!self) return nil; | |
self.backgroundColor = [UIColor whiteColor]; | |
self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"trollface_300x200"]]; | |
[self addSubview:self.imageView]; | |
return self; | |
} | |
- (void)setMode:(GGOverlayViewMode)mode | |
{ | |
if (_mode == mode) return; | |
_mode = mode; | |
if (mode == GGOverlayViewModeLeft) { | |
self.imageView.image = [UIImage imageNamed:@"trollface_300x200"]; | |
} else { | |
self.imageView.image = [UIImage imageNamed:@"thumbs_up_300x300"]; | |
} | |
} | |
- (void)layoutSubviews | |
{ | |
[super layoutSubviews]; | |
self.imageView.frame = CGRectMake(50, 50, 100, 100); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment