1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-04 10:27:46 +01:00
Telegram/Share/TGShareImageView.m

31 lines
655 B
Mathematica
Raw Normal View History

2015-10-01 18:19:52 +02:00
#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