1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 09:27:55 +01:00
Telegram/Share/TGShareImageView.m
2015-10-01 19:19:52 +03:00

31 lines
655 B
Objective-C

#import "TGShareImageView.h"
@interface TGShareImageView ()
{
SMetaDisposable *_disposable;
}
@end
@implementation TGShareImageView
- (void)setSignal:(SSignal *)signal
{
if (_disposable == nil)
_disposable = [[SMetaDisposable alloc] init];
self.image = nil;
__weak TGShareImageView *weakSelf = self;
[_disposable setDisposable:[[signal deliverOn:[SQueue mainQueue]] startWithNext:^(id next)
{
__strong TGShareImageView *strongSelf = weakSelf;
if (strongSelf != nil)
{
if ([next isKindOfClass:[UIImage class]])
strongSelf.image = next;
}
}]];
}
@end