Last active
August 29, 2015 14:26
-
-
Save hjanuschka/bfd81cab92eed5598d2c 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 <MWPhotoBrowser/MWCaptionView.h> | |
#import "MWCaptionView.h" | |
@interface HJ_MWCaption : MWCaptionView { | |
MWPhoto *_photo; | |
} | |
@property(nonatomic, strong) UIButton * like_button; |
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
@implementation HJ_MWCaption | |
-(id)initWithPhoto:(MWPhoto *)photo { | |
_photo = photo; | |
return [super initWithPhoto:photo]; | |
} | |
- (CGSize)sizeThatFits:(CGSize)size { | |
return CGSizeMake(self.bounds.size.width, 100); | |
} | |
- (void) likeClicked: (id) sender { | |
NSLog(@"LIKE CLICKED"); | |
} | |
- (void)setupCaption { | |
// self.backgroundColor=[UIColor colorWithRed:255 green:255 blue:255 alpha:0.3]; | |
self.userInteractionEnabled=YES; | |
} | |
- (void) layoutSubviews { | |
if(_like_button != nil) { | |
return; | |
} | |
_like_button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; | |
_like_button.backgroundColor = [UIColor clearColor]; | |
[_like_button setTitle:@"btn" forState:UIControlStateNormal]; | |
_like_button.tag=3; | |
[self addSubview:_like_button]; | |
[_like_button addTarget:self action:@selector(likeClicked:) forControlEvents:UIControlEventTouchUpInside]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment