mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Clean up
This commit is contained in:
@@ -12,11 +12,9 @@
|
||||
#import "TGAttachmentCarouselItemView.h"
|
||||
|
||||
#import <LegacyComponents/TGCameraController.h>
|
||||
#import "TGLegacyCameraController.h"
|
||||
#import <LegacyComponents/TGImagePickerController.h>
|
||||
#import <LegacyComponents/TGMediaAssetsController.h>
|
||||
|
||||
@interface TGMediaAvatarMenuMixin () <TGLegacyCameraControllerDelegate>
|
||||
@interface TGMediaAvatarMenuMixin ()
|
||||
{
|
||||
TGViewController *_parentController;
|
||||
bool _hasSearchButton;
|
||||
@@ -278,13 +276,6 @@
|
||||
if ([_context currentlyInSplitView])
|
||||
return;
|
||||
|
||||
if ([TGCameraController useLegacyCamera])
|
||||
{
|
||||
[self _displayLegacyCamera];
|
||||
[menuController dismissAnimated:true];
|
||||
return;
|
||||
}
|
||||
|
||||
TGCameraController *controller = nil;
|
||||
CGSize screenSize = TGScreenSize();
|
||||
|
||||
@@ -376,16 +367,6 @@
|
||||
};
|
||||
}
|
||||
|
||||
- (void)_displayLegacyCamera
|
||||
{
|
||||
TGLegacyCameraController *legacyCameraController = [[TGLegacyCameraController alloc] initWithContext:_context];
|
||||
legacyCameraController.sourceType = UIImagePickerControllerSourceTypeCamera;
|
||||
legacyCameraController.avatarMode = true;
|
||||
legacyCameraController.completionDelegate = self;
|
||||
|
||||
[_parentController presentViewController:legacyCameraController animated:true completion:nil];
|
||||
}
|
||||
|
||||
- (void)_displayMediaPicker
|
||||
{
|
||||
if (![[[LegacyComponentsGlobals provider] accessChecker] checkPhotoAuthorizationStatusForIntent:TGPhotoAccessIntentRead alertDismissCompletion:nil])
|
||||
@@ -531,30 +512,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)imagePickerController:(TGImagePickerController *)__unused imagePicker didFinishPickingWithAssets:(NSArray *)assets
|
||||
{
|
||||
UIImage *resultImage = nil;
|
||||
|
||||
if (assets.count != 0)
|
||||
{
|
||||
if ([assets[0] isKindOfClass:[UIImage class]])
|
||||
resultImage = assets[0];
|
||||
}
|
||||
|
||||
if (self.didFinishWithImage != nil)
|
||||
self.didFinishWithImage(resultImage);
|
||||
|
||||
[_parentController dismissViewControllerAnimated:true completion:nil];
|
||||
}
|
||||
|
||||
- (void)legacyCameraControllerCompletedWithNoResult
|
||||
{
|
||||
[_parentController dismissViewControllerAnimated:true completion:nil];
|
||||
|
||||
if (self.didDismiss != nil)
|
||||
self.didDismiss();
|
||||
}
|
||||
|
||||
- (void)_performDelete
|
||||
{
|
||||
if (self.didFinishWithDelete != nil)
|
||||
|
||||
Reference in New Issue
Block a user