mirror of
https://github.com/danog/Telegram.git
synced 2024-12-02 09:27:55 +01:00
31 lines
655 B
Objective-C
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
|