@@ -37,8 +37,7 @@ @interface TOCropViewControllerAspectRatioPreset ()
3737
3838@implementation TOCropViewControllerAspectRatioPreset
3939
40- - (instancetype )initWithSize : (CGSize)size title : (NSString *)title
41- {
40+ - (instancetype )initWithSize : (CGSize)size title : (NSString *)title {
4241 self = [super init ];
4342 if (self) {
4443 _size = size;
@@ -58,37 +57,49 @@ - (BOOL)isEqual:(id)object {
5857 return CGSizeEqualToSize (self.size , other.size ) && [self .title isEqualToString: other.title];
5958}
6059
61- + (NSArray <TOCropViewControllerAspectRatioPreset *> *)portraitPresets
62- {
60+ + (NSArray <TOCropViewControllerAspectRatioPreset *> *)portraitPresets {
6361 TOCropViewControllerAspectRatioPreset *object = [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeZero title: @" Original" ];
64- NSBundle *resourceBundle = TO_CROP_VIEW_RESOURCE_BUNDLE_FOR_OBJECT (object);
62+ NSBundle *resourceBundle = TO_CROP_VIEW_RESOURCE_BUNDLE_FOR_OBJECT (object);
6563 return @[
66- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeZero title: NSLocalizedStringFromTableInBundle(@" Original" , @" TOCropViewControllerLocalizable" , resourceBundle, nil )],
67- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (1 .0f , 1 .0f ) title: NSLocalizedStringFromTableInBundle(@" Square" , @" TOCropViewControllerLocalizable" , resourceBundle, nil )],
68- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (2 .0f , 3 .0f ) title: @" 2:3" ],
69- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (3 .0f , 5 .0f ) title: @" 3:5" ],
70- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (3 .0f , 4 .0f ) title: @" 3:4" ],
71- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (4 .0f , 5 .0f ) title: @" 4:5" ],
72- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (5 .0f , 7 .0f ) title: @" 5:7" ],
73- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (9 .0f , 16 .0f ) title: @" 9:16" ],
64+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeZero
65+ title: NSLocalizedStringFromTableInBundle(@" Original" , @" TOCropViewControllerLocalizable" , resourceBundle, nil )],
66+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (1 .0f , 1 .0f )
67+ title: NSLocalizedStringFromTableInBundle(@" Square" , @" TOCropViewControllerLocalizable" , resourceBundle, nil )],
68+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (2 .0f , 3 .0f )
69+ title: @" 2:3" ],
70+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (3 .0f , 5 .0f )
71+ title: @" 3:5" ],
72+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (3 .0f , 4 .0f )
73+ title: @" 3:4" ],
74+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (4 .0f , 5 .0f )
75+ title: @" 4:5" ],
76+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (5 .0f , 7 .0f )
77+ title: @" 5:7" ],
78+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (9 .0f , 16 .0f )
79+ title: @" 9:16" ],
7480 ];
7581}
7682
77- + (NSArray <TOCropViewControllerAspectRatioPreset *> *)landscapePresets
78- {
83+ + (NSArray <TOCropViewControllerAspectRatioPreset *> *)landscapePresets {
7984 TOCropViewControllerAspectRatioPreset *object = [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeZero title: @" Original" ];
80- NSBundle *resourceBundle = TO_CROP_VIEW_RESOURCE_BUNDLE_FOR_OBJECT (object);
85+ NSBundle *resourceBundle = TO_CROP_VIEW_RESOURCE_BUNDLE_FOR_OBJECT (object);
8186 return @[
82- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeZero title: NSLocalizedStringFromTableInBundle(@" Original" , @" TOCropViewControllerLocalizable" , resourceBundle, nil )],
83- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (1 .0f , 1 .0f ) title: NSLocalizedStringFromTableInBundle(@" Square" , @" TOCropViewControllerLocalizable" , resourceBundle, nil )],
84- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (3 .0f , 2 .0f ) title: @" 3:2" ],
85- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (5 .0f , 3 .0f ) title: @" 5:3" ],
86- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (4 .0f , 3 .0f ) title: @" 4:3" ],
87- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (5 .0f , 4 .0f ) title: @" 5:4" ],
88- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (7 .0f , 5 .0f ) title: @" 7:5" ],
89- [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (16 .0f , 9 .0f ) title: @" 16:9" ],
87+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeZero
88+ title: NSLocalizedStringFromTableInBundle(@" Original" , @" TOCropViewControllerLocalizable" , resourceBundle, nil )],
89+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (1 .0f , 1 .0f )
90+ title: NSLocalizedStringFromTableInBundle(@" Square" , @" TOCropViewControllerLocalizable" , resourceBundle, nil )],
91+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (3 .0f , 2 .0f )
92+ title: @" 3:2" ],
93+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (5 .0f , 3 .0f )
94+ title: @" 5:3" ],
95+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (4 .0f , 3 .0f )
96+ title: @" 4:3" ],
97+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (5 .0f , 4 .0f )
98+ title: @" 5:4" ],
99+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (7 .0f , 5 .0f )
100+ title: @" 7:5" ],
101+ [[TOCropViewControllerAspectRatioPreset alloc ] initWithSize: CGSizeMake (16 .0f , 9 .0f )
102+ title: @" 16:9" ],
90103 ];
91104}
92105@end
93-
94-
0 commit comments